Note

You are viewing the documentation for an older version of boto (boto2).

Boto3, the next version of Boto, is now stable and recommended for general use. It can be used side-by-side with Boto in the same project, so it is easy to start using Boto3 in your existing projects as well as new projects. Going forward, API updates and all new feature work will be focused on Boto3.

For more information, see the documentation for boto3.

Cognito Sync

boto.cognito.sync

boto.cognito.sync.connect_to_region(region_name, **kw_params)
boto.cognito.sync.regions()

Get all available regions for the Amazon Cognito Sync service.

Return type:list
Returns:A list of boto.regioninfo.RegionInfo

boto.cognito.sync.layer1

class boto.cognito.sync.layer1.CognitoSyncConnection(**kwargs)

Amazon Cognito Sync Amazon Cognito Sync provides an AWS service and client library that enable cross-device syncing of application-related user data. High-level client libraries are available for both iOS and Android. You can use these libraries to persist data locally so that it’s available even if the device is offline. Developer credentials don’t need to be stored on the mobile device to access the service. You can use Amazon Cognito to obtain a normalized user ID and credentials. User data is persisted in a dataset that can store up to 1 MB of key-value pairs, and you can have up to 20 datasets per user identity.

With Amazon Cognito Sync, the data stored for each identity is accessible only to credentials assigned to that identity. In order to use the Cognito Sync service, you need to make API calls using credentials retrieved with `Amazon Cognito Identity service`_.

APIVersion = '2014-06-30'
DefaultRegionEndpoint = 'cognito-sync.us-east-1.amazonaws.com'
DefaultRegionName = 'us-east-1'
ResponseError

alias of boto.exception.JSONResponseError

delete_dataset(identity_pool_id, identity_id, dataset_name)

Deletes the specific dataset. The dataset will be deleted permanently, and the action can’t be undone. Datasets that this dataset was merged with will no longer report the merge. Any consequent operation on this dataset will result in a ResourceNotFoundException.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • identity_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • dataset_name (string) – A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, ‘_’ (underscore), ‘-‘ (dash), and ‘.’ (dot).
describe_dataset(identity_pool_id, identity_id, dataset_name)

Gets metadata about a dataset by identity and dataset name. The credentials used to make this API call need to have access to the identity data. With Amazon Cognito Sync, each identity has access only to its own data. You should use Amazon Cognito Identity service to retrieve the credentials necessary to make this API call.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • identity_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • dataset_name (string) – A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, ‘_’ (underscore), ‘-‘ (dash), and ‘.’ (dot).
describe_identity_pool_usage(identity_pool_id)

Gets usage details (for example, data storage) about a particular identity pool.

Parameters:identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
describe_identity_usage(identity_pool_id, identity_id)

Gets usage information for an identity, including number of datasets and data usage.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • identity_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
get_identity_pool_configuration(identity_pool_id)

Gets the configuration settings of an identity pool.

Parameters:identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool for which to return a configuration.
list_datasets(identity_pool_id, identity_id, next_token=None, max_results=None)

Lists datasets for an identity. The credentials used to make this API call need to have access to the identity data. With Amazon Cognito Sync, each identity has access only to its own data. You should use Amazon Cognito Identity service to retrieve the credentials necessary to make this API call.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • identity_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • next_token (string) – A pagination token for obtaining the next page of results.
  • max_results (integer) – The maximum number of results to be returned.
list_identity_pool_usage(next_token=None, max_results=None)

Gets a list of identity pools registered with Cognito.

Parameters:
  • next_token (string) – A pagination token for obtaining the next page of results.
  • max_results (integer) – The maximum number of results to be returned.
list_records(identity_pool_id, identity_id, dataset_name, last_sync_count=None, next_token=None, max_results=None, sync_session_token=None)

Gets paginated records, optionally changed after a particular sync count for a dataset and identity. The credentials used to make this API call need to have access to the identity data. With Amazon Cognito Sync, each identity has access only to its own data. You should use Amazon Cognito Identity service to retrieve the credentials necessary to make this API call.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • identity_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • dataset_name (string) – A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, ‘_’ (underscore), ‘-‘ (dash), and ‘.’ (dot).
  • last_sync_count (long) – The last server sync count for this record.
  • next_token (string) – A pagination token for obtaining the next page of results.
  • max_results (integer) – The maximum number of results to be returned.
  • sync_session_token (string) – A token containing a session ID, identity ID, and expiration.
make_request(verb, resource, headers=None, data='', expected_status=None, params=None)

Makes a request to the server, with stock multiple-retry logic.

register_device(identity_pool_id, identity_id, platform, token)

Registers a device to receive push sync notifications.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. Here, the ID of the pool that the identity belongs to.
  • identity_id (string) – The unique ID for this identity.
  • platform (string) – The SNS platform type (e.g. GCM, SDM, APNS, APNS_SANDBOX).
  • token (string) – The push token.
set_identity_pool_configuration(identity_pool_id, push_sync=None)

Sets the necessary configuration for push sync.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool to modify.
  • push_sync (dict) – Configuration options to be applied to the identity pool.
subscribe_to_dataset(identity_pool_id, identity_id, dataset_name, device_id)

Subscribes to receive notifications when a dataset is modified by another device.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which the identity belongs.
  • identity_id (string) – Unique ID for this identity.
  • dataset_name (string) – The name of the dataset to subcribe to.
  • device_id (string) – The unique ID generated for this device by Cognito.
unsubscribe_from_dataset(identity_pool_id, identity_id, dataset_name, device_id)

Unsubscribe from receiving notifications when a dataset is modified by another device.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. The ID of the pool to which this identity belongs.
  • identity_id (string) – Unique ID for this identity.
  • dataset_name (string) – The name of the dataset from which to unsubcribe.
  • device_id (string) – The unique ID generated for this device by Cognito.
update_records(identity_pool_id, identity_id, dataset_name, sync_session_token, device_id=None, record_patches=None, client_context=None)

Posts updates to records and add and delete records for a dataset and user. The credentials used to make this API call need to have access to the identity data. With Amazon Cognito Sync, each identity has access only to its own data. You should use Amazon Cognito Identity service to retrieve the credentials necessary to make this API call.

Parameters:
  • identity_pool_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • identity_id (string) – A name-spaced GUID (for example, us- east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
  • dataset_name (string) – A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, ‘_’ (underscore), ‘-‘ (dash), and ‘.’ (dot).
  • device_id (string) – The unique ID generated for this device by Cognito.
  • record_patches (list) – A list of patch operations.
  • sync_session_token (string) – The SyncSessionToken returned by a previous call to ListRecords for this dataset and identity.
  • client_context (string) – Intended to supply a device ID that will populate the lastModifiedBy field referenced in other methods. The ClientContext field is not yet implemented.

boto.cognito.sync.exceptions

exception boto.cognito.sync.exceptions.InternalErrorException(status, reason, body=None, *args)
exception boto.cognito.sync.exceptions.InvalidConfigurationException(status, reason, body=None, *args)
exception boto.cognito.sync.exceptions.InvalidParameterException(status, reason, body=None, *args)
exception boto.cognito.sync.exceptions.LimitExceededException(status, reason, body=None, *args)
exception boto.cognito.sync.exceptions.NotAuthorizedException(status, reason, body=None, *args)
exception boto.cognito.sync.exceptions.ResourceConflictException(status, reason, body=None, *args)
exception boto.cognito.sync.exceptions.ResourceNotFoundException(status, reason, body=None, *args)
exception boto.cognito.sync.exceptions.TooManyRequestsException(status, reason, body=None, *args)