Connecting to the PCE

The first step for any application is connecting to the Policy Compute Engine. Make sure you have the library installed, then read on.

Create a client

The PolicyComputeEngine class is the entry point for everything:

>>> from illumio import PolicyComputeEngine
>>> pce = PolicyComputeEngine('my.pce.com', port=443, org_id=1)

Note

The first parameter can be a full URL — useful if your PCE does not have TLS certificates configured — or an FQDN as shown above. When you pass just the domain name, the scheme defaults to https://.

Authenticate

Provide credentials to authorize the client. Both an API key/secret pair and a username/password can be passed to set_credentials:

>>> pce.set_credentials('api_key', 'api_secret')

Confirm the connection

>>> pce.check_connection()
True

With a few lines of code you now have a working, persistent connection to the PCE. If your PCE uses self-signed or internal certificates, see Connecting to the PCE for TLS and proxy options.

Next, build your first policy in Your first policy.

Note

This guide assumes some familiarity with the PCE APIs. See the Illumio PCE REST API Developer Guide for a fuller introduction to API usage and schema.