End User Portal#

Instantiate a Services Portal object#

class cterasdk.object.Portal.ServicesPortal(host=None, port=None, https=True, *, url=None)

Class for End User or Tenant Administrator Functions

__init__(host=None, port=None, https=True, *, url=None)
Parameters:
  • host (str) – The fully qualified domain name, hostname or an IPv4 address of the Portal

  • port (int,optional) – Set a custom port number (0 - 65535), If not set defaults to 80 for http and 443 for https

  • https (bool,optional) – Set to True to require HTTPS, defaults to True

user = ServicesPortal('portal.ctera.com') # will use HTTPS over port 443

Warning

for any certificate related error, this library will prompt for your consent in order to proceed. to avoid the prompt, you may configure chopin-core to automatically trust the server’s certificate, using: config.http['ssl'] = 'Trust'

Logging in#

ServicesPortal.test()

Verification check to ensure the target host is a Portal.

user.test()
ServicesPortal.login(username, password)

Log in

Parameters:
  • username (str) – User name to log in

  • password (str) – User password

user.login('walice', 'G3neralZ0d!')
ServicesPortal.logout()

Log out

user.logout()

Managing S3 Credentials#

S3.all(user_account=None)

List Credentials

Parameters:

user_account (cterasdk.core.types.UserAccount,optional) – User account

"""List all S3 credentials"""
for credential in user.credentials.s3.all():
    print(credential.accessKey, credential.activated)
S3.create(user_account=None)

Create Credential

Parameters:

user_account (cterasdk.core.types.UserAccount,optional) – User account

"""Create an S3 credential"""
credential = user.credentials.s3.create()
S3.delete(access_key_id, user_account=None)

Delete Credential

Parameters:
"""Delete an S3 credentials"""
access_key_id = 'ABCDEFGHIJKLMOP'
user.credentials.s3.delete(access_key_id)