Method Documentation
The main SDK object by which all other methods are accessed is created by
calling pycpg.sdk.from_local_account or pycpg.sdk.from_jwt_provider. For example:
import pycpg.sdk
sdk = pycpg.sdk.from_local_account("console.us1.crashplan.com", "john.doe@example.com", "my_pw")
# access properties on 'sdk' to explore all the available methods
Important
pycpg only supports token-based authentication.
Explore the complete public documentation for pycpg below.
- pycpg.sdk.from_api_client(host_address, client_id, secret)
Creates a
SDKClientobject for accessing the CrashPlan REST APIs using an API client ID and secret.- Parameters:
host_address (str) – The domain name of the CrashPlan instance being authenticated to, e.g. console.us1.crashplan.com
client_id (str) – The client ID of the API client to authenticate with.
secret (str) – The secret of the API client to authenticate with.
- Returns:
- pycpg.sdk.from_jwt_provider(host_address, jwt_provider)
Creates a
SDKClientobject for accessing the CrashPlan REST APIs using a custom auth mechanism. User can use any authentication mechanism like that returns a JSON Web token on authentication which would then be used for all subsequent requests.- Parameters:
host_address (str) – The domain name of the CrashPlan instance being authenticated to, e.g. console.us1.crashplan.com
jwt_provider (function) – A function that accepts no parameters and on execution returns a JSON web token string.
- Returns:
- pycpg.sdk.from_local_account(host_address, username, password, totp=None)
Creates a
SDKClientobject for accessing the CrashPlan REST APIs using the supplied credentials. This method supports only accounts created within the CrashPlan console or using the APIs (including pycpg). Username/passwords that are based on Active Directory, Okta, or other Identity providers cannot be used with this method.- Parameters:
host_address (str) – The domain name of the CrashPlan instance being authenticated to, e.g. console.us1.crashplan.com
username (str) – The username of the authenticating account.
password (str) – The password of the authenticating account.
totp (callable or str, optional) – The time-based one-time password of the authenticating account. Include only if the account uses CrashPlan’s two-factor authentication. Defaults to None.
- Returns:
- class pycpg.sdk.SDKClient(main_connection, auth, auth_flag=None)
Bases:
object- property archive
A collection of methods for accessing CrashPlan storage archives. Useful for doing web-restores or finding a file on an archive.
- Returns:
- property auditlogs
A collection of methods for retrieving audit logs.
- property devices
A collection of methods for retrieving or updating data about devices in the CrashPlan environment.
- Returns:
- classmethod from_api_client(host_address, client_id, secret)
Creates a
SDKClientobject for accessing the CrashPlan REST APIs using an API client ID and secret.- Parameters:
host_address (str) – The domain name of the CrashPlan instance being authenticated to, e.g. console.us1.crashplan.com
client_id (str) – The client ID of the API client to authenticate with.
secret (str) – The secret of the API client to authenticate with.
- Returns:
- classmethod from_jwt_provider(host_address, jwt_provider)
- Creates a
SDKClientobject for accessing the CrashPlan REST APIs using a custom auth mechanism. User can use any authentication mechanism like that returns a JSON Web token on authentication which would then be used for all subsequent requests.
- Parameters:
host_address (str) – The domain name of the CrashPlan instance being authenticated to, e.g. console.us1.crashplan.com
jwt_provider (function) – A function that accepts no parameters and on execution returns a
string. (JSON web token)
- Returns:
- Creates a
- classmethod from_local_account(host_address, username, password, totp=None)
Creates a
SDKClientobject for accessing the CrashPlan REST APIs using the supplied credentials. This method supports only accounts created within the CrashPlan console or using the APIs (including pycpg). Username/passwords that are based on Active Directory, Okta, or other Identity providers should use the from_jwt_provider method.- Parameters:
host_address (str) – The domain name of the CrashPlan instance being authenticated to, e.g. console.us1.crashplan.com
username (str) – The username of the authenticating account.
password (str) – The password of the authenticating account.
totp (callable or str, optional) – The time-based one-time password of the authenticating account. Include only if the account uses CrashPlan’s two-factor authentication. Defaults to None.
- Returns:
- property legalhold
A collection of methods for retrieving and updating legal-hold matters, policies, and custodians.
- property loginconfig
A collection of methods related to getting information about the login configuration of user accounts.
- Returns:
pycpg.clients.loginconfig.LoginConfigurationClient.
- property orgs
A collection of methods for retrieving or updating data about organizations in the CrashPlan environment.
- Returns:
- property serveradmin
A collection of methods for getting server information for on-premise environments and tenant information for cloud environments.
- Returns:
pycpg.services.administration.AdministrationService
- property usercontext
A collection of methods related to getting information about the currently logged in user, such as the tenant ID.
- Returns:
- property users
A collection of methods for retrieving or updating data about users in the CrashPlan environment.
- Returns: