Method Documentation

The main SDK object by which all other methods are accessed is created by calling py42.sdk.from_local_account. For example:

import py42.sdk

sdk = py42.sdk.from_local_account("console.us.code42.com", "john.doe@example.com", "my_pw")
# access properties on 'sdk' to explore all the available methods

Important

py42 cannot be used with SAML or Sigle Sign-On based accounts such as Okta or Active Directory. Only accounts that are added by having an administrator create them within the Code42 console are currently supported.

Explore the complete public documentation for py42 below.

py42.sdk.from_local_account(host_address, username, password)

Creates a SDKClient object for accessing the Code42 REST APIs using the supplied credentials. Currently, only accounts created within the Code42 console or using the APIs (including py42) are supported. 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 Code42 instance being authenticated to, e.g. console.us.code42.com
  • username (str) – The username of the authenticating account.
  • password (str) – The password of the authenticating account.
Returns:

py42.sdk.SDKClient

class py42.sdk.SDKClient(main_connection, auth)

Bases: object

alerts

A collection of methods related to retrieving and updating alerts rules.

Returns:py42.services.alertrules.AlertRulesClient
archive

A collection of methods for accessing Code42 storage archives. Useful for doing web-restores or finding a file on an archive.

Returns:py42.services.archive.ArchiveClient
detectionlists

A collection of properties each containing methods for managing specific detection lists, such as departing employees.

Returns:py42.services.detectionlists.DetectionListsClient
devices

A collection of methods for retrieving or updating data about devices in the Code42 environment.

Returns:py42.services.devices.DeviceService
classmethod from_local_account(host_address, username, password)

Creates a SDKClient object for accessing the Code42 REST APIs using the supplied credentials. Currently, only accounts created within the Code42 console or using the APIs (including py42) are supported. 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 Code42 instance being authenticated to, e.g. console.us.code42.com
  • username (str) – The username of the authenticating account.
  • password (str) – The password of the authenticating account.
Returns:

py42.sdk.SDKClient

legalhold

A collection of methods for retrieving and updating legal-hold matters, policies, and custodians.

Returns:py42.services.legalhold.LegalHoldService
orgs

A collection of methods for retrieving or updating data about organizations in the Code42 environment.

Returns:py42.services.orgs.OrgService
securitydata
  • File events
    • Alerts
    • Security plan information
Returns:py42.services.securitydata.SecurityDataClient
Type:A collection of methods and properties for getting security data such as
serveradmin

A collection of methods for getting server information for on-premise environments and tenant information for cloud environments.

Returns:py42.services.administration.AdministrationService
usercontext

A collection of methods related to getting information about the currently logged in user, such as the tenant ID.

Returns:py42.usercontext.UserContext
users

A collection of methods for retrieving or updating data about users in the Code42 environment.

Returns:py42.services.users.UserService