session#

The following methods allow for interaction with the ZCON Session API endpoints.

Methods are accessible via zcon.session

class ZCONSessionAPI#
create(api_key, username, password)#

Create a new ZCON authentication session.

Parameters:
  • api_key (str) – The ZCON API Key.

  • username (str) – Username of admin user for the authentication session.

  • password (str) – Password of the admin user for the authentication session.

Returns:

The authenticated session information.

Return type:

Box

Examples

Create a new authentication session:

zcon.session.create(
    api_key='123456789',
    username='admin@example.com',
    password='MyInsecurePassword'
)
delete()#

End the authentication session.

Returns:

The status code of the operation.

Return type:

int

Examples

End the authentication session:

print(zcon.session.delete())
status()#

Returns the status of the authentication session if it exists.

Returns:

Session authentication information.

Return type:

Box

Examples

Check the status of the authentication session:

print(zcon.session.status())