Partner Central Analytics API 2018-05-10
- Client: Aws\PartnerCentralAnalytics\PartnerCentralAnalyticsClient
- Service ID: partnercentral-analytics
- Version: 2018-05-10
This page describes the parameters and results for the operations of the Partner Central Analytics API (2018-05-10), and shows how to use the Aws\PartnerCentralAnalytics\PartnerCentralAnalyticsClient object to call the described operations. This documentation is specific to the 2018-05-10 API version of the service.
Service Description
Partner Central Analytics Service
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName'), where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */).
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */).
- CreateDataSubscription ( array $params = [] )
- Creates a data subscription that delivers a partner analytics dataset to an S3 bucket in the caller's AWS account on a schedule.
- DeleteDataSubscription ( array $params = [] )
- Deletes a data subscription owned by the calling account.
- GetDataSubscription ( array $params = [] )
- Returns the full details of a data subscription owned by the calling account, including its delivery status and how far delivery has progressed.
- ListDataSubscriptions ( array $params = [] )
- Lists the data subscriptions owned by the calling account in the given catalog.
- ListTagsForResource ( array $params = [] )
- Lists the tags on a data subscription owned by the calling account.
- TagResource ( array $params = [] )
- Adds or overwrites tags on a data subscription owned by the calling account.
- UntagResource ( array $params = [] )
- Removes the named tag keys from a data subscription owned by the calling account.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
CreateDataSubscription
$result = $client->createDataSubscription([/* ... */]); $promise = $client->createDataSubscriptionAsync([/* ... */]);
Creates a data subscription that delivers a partner analytics dataset to an S3 bucket in the caller's AWS account on a schedule. The delivery destination is validated before the subscription is created: the service performs a test write to the bucket as its delivery principal using the supplied KMS key. Subscriptions are immutable; delete and recreate to change one.
Parameter Syntax
$result = $client->createDataSubscription([
'catalog' => '<string>', // REQUIRED
'clientToken' => '<string>',
'datasetName' => '<string>', // REQUIRED
'deliveryMethod' => 'S3', // REQUIRED
'kmsKeyArn' => '<string>', // REQUIRED
's3Arn' => '<string>', // REQUIRED
'tags' => ['<string>', ...],
]);
Parameter Details
Members
- catalog
-
- Required: Yes
- Type: string
The catalog the subscription belongs to.
- clientToken
-
- Type: string
A unique, case-sensitive identifier that ensures the idempotency of the request. Reusing a token within 24 hours with the same parameters returns the original subscription; reusing it with different parameters is rejected.
- datasetName
-
- Required: Yes
- Type: string
The name of the dataset to subscribe to.
- deliveryMethod
-
- Required: Yes
- Type: string
How the dataset is delivered.
- kmsKeyArn
-
- Required: Yes
- Type: string
The ARN of the caller-owned KMS key used to encrypt delivered objects.
- s3Arn
-
- Required: Yes
- Type: string
The ARN of the S3 bucket in the caller's account that receives deliveries.
- tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
Optional tags to apply to the subscription at creation (tag-on-create). Up to 50 tags; key length 1-128, value length 0-256; keys beginning with the reserved
aws:prefix are rejected. The backend authorizes the tags (aws:RequestTag / aws:TagKeys) and registers them with Tagris as part of the create.
Result Syntax
[
'dataSubscriptionIdentifier' => '<string>',
]
Result Details
Members
- dataSubscriptionIdentifier
-
- Required: Yes
- Type: string
The ARN of the created data subscription.
Errors
- ServiceQuotaExceededException:
Creating the data subscription would exceed the per-dataset subscription quota for the caller.
- TooManyRequestsException:
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
- InternalServerException:
Thrown when an unexpected error occurs while processing the request
- ConflictException:
An active data subscription with the same dataset, delivery method, and destination already exists for the caller.
- AccessDeniedException:
This exception is thrown when the client is not authorized to perform an action
- BadRequestException:
This exception is thrown when the request is not formatted correctly.
- IdempotentParameterMismatchException:
The supplied clientToken was used on a prior successful request with different parameters.
- S3AccessException:
The destination S3 bucket is not accessible to the delivery principal. Check the bucket policy and ownership.
- KmsKeyAccessException:
The KMS key is not usable by the delivery principal for the destination bucket. Check the key policy.
Examples
Example 1: Creating a data subscription
The following example creates a subscription that delivers the ACE Opportunity Pipeline dataset to an S3 bucket in the calling account, encrypted with a KMS key the account owns.
$result = $client->createDataSubscription([
'catalog' => 'AWS',
'datasetName' => 'opportunity_pipeline',
'deliveryMethod' => 'S3',
'kmsKeyArn' => 'arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab',
's3Arn' => 'arn:aws:s3:::example-partner-analytics-bucket',
]);
Result syntax:
[
'dataSubscriptionIdentifier' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
]
Example 2: Creating a data subscription with tags and an idempotency token
The following example subscribes to the ACE Leads dataset, applies tags at creation, and supplies a client token so the request can be retried safely for 24 hours.
$result = $client->createDataSubscription([
'catalog' => 'AWS',
'clientToken' => '7d3c1f0e-5b2a-4c9d-8e6f-0a1b2c3d4e5f',
'datasetName' => 'leads',
'deliveryMethod' => 'S3',
'kmsKeyArn' => 'arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab',
's3Arn' => 'arn:aws:s3:::example-partner-analytics-bucket',
'tags' => [
'environment' => 'production',
'team' => 'analytics',
],
]);
Result syntax:
[
'dataSubscriptionIdentifier' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Engagement_V1/DataSubscription/ds-1a2b3c4d5e6f7g8',
]
DeleteDataSubscription
$result = $client->deleteDataSubscription([/* ... */]); $promise = $client->deleteDataSubscriptionAsync([/* ... */]);
Deletes a data subscription owned by the calling account. Delivery stops immediately; data already delivered stays in the caller's bucket. Deleting an already-deleted subscription succeeds.
Parameter Syntax
$result = $client->deleteDataSubscription([
'catalog' => '<string>', // REQUIRED
'dataSubscriptionIdentifier' => '<string>', // REQUIRED
]);
Parameter Details
Members
- catalog
-
- Required: Yes
- Type: string
The catalog the subscription belongs to.
- dataSubscriptionIdentifier
-
- Required: Yes
- Type: string
The ARN of the data subscription to delete.
Result Syntax
[]
Result Details
Errors
- TooManyRequestsException:
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
- InternalServerException:
Thrown when an unexpected error occurs while processing the request
- AccessDeniedException:
This exception is thrown when the client is not authorized to perform an action
- BadRequestException:
This exception is thrown when the request is not formatted correctly.
- ResourceNotFoundException:
Thrown when the requested resource does not exist
Examples
Example 1: Deleting a data subscription
The following example deletes a data subscription. Delivery stops immediately; objects already delivered remain in the bucket.
$result = $client->deleteDataSubscription([
'catalog' => 'AWS',
'dataSubscriptionIdentifier' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
]);
Result syntax:
[ ]
GetDataSubscription
$result = $client->getDataSubscription([/* ... */]); $promise = $client->getDataSubscriptionAsync([/* ... */]);
Returns the full details of a data subscription owned by the calling account, including its delivery status and how far delivery has progressed.
Parameter Syntax
$result = $client->getDataSubscription([
'catalog' => '<string>', // REQUIRED
'dataSubscriptionIdentifier' => '<string>', // REQUIRED
]);
Parameter Details
Members
- catalog
-
- Required: Yes
- Type: string
The catalog the subscription belongs to.
- dataSubscriptionIdentifier
-
- Required: Yes
- Type: string
The ARN of the data subscription.
Result Syntax
[
'catalog' => '<string>',
'createTimestamp' => <DateTime>,
'dataSubscriptionIdentifier' => '<string>',
'datasetName' => '<string>',
'deleteTimestamp' => <DateTime>,
'deliveredThrough' => <DateTime>,
'deliveryCompleteness' => <DateTime>,
'deliveryMethod' => 'S3',
'deliveryState' => 'ACTIVE|INITIAL_DELIVERY|DELAYED|ACTION_NEEDED|CANCELLED',
'deliveryStateMessage' => '<string>',
'deliveryStatus' => 'Initiated|Pending|Created|Create_Failed|Deleted|Delete_Failed',
'deliveryStatusMessage' => '<string>',
'initialDeliveryProgress' => [
'daysDelivered' => <integer>,
'daysTotal' => <integer>,
],
'kmsKeyArn' => '<string>',
'lastDeliveryTime' => <DateTime>,
's3Arn' => '<string>',
]
Result Details
Members
- catalog
-
- Required: Yes
- Type: string
Specifies the catalog associated with the request.
- createTimestamp
-
- Required: Yes
- Type: timestamp (string|DateTime or anything parsable by strtotime)
When the subscription was created.
- dataSubscriptionIdentifier
-
- Required: Yes
- Type: string
The ARN of a data subscription.
- datasetName
-
- Required: Yes
- Type: string
Specifies the name of a dataset. A bare dataset name (not an ARN); the resource ARN is composed by the runtime/authorizer.
- deleteTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
When the subscription was deleted. Present only on deleted subscriptions.
- deliveredThrough
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The extract date through which data has been delivered to your bucket. Same value as deliveryCompleteness; prefer this member. Absent until the first successful delivery.
- deliveryCompleteness
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The extract date through which data has been delivered. Absent until the first successful delivery.
- deliveryMethod
-
- Required: Yes
- Type: string
How a dataset is delivered.
- deliveryState
-
- Type: string
The delivery state of the subscription, summarizing whether data is arriving in your bucket as expected. See DeliveryState for what each value means. Absent when the service cannot determine it.
- deliveryStateMessage
-
- Type: string
A message that explains the delivery state. Present when deliveryState is ACTION_NEEDED, where it describes why the last write to your bucket was refused so you can fix the bucket policy or KMS key.
- deliveryStatus
-
- Required: Yes
- Type: string
The lifecycle state of the subscription.
- deliveryStatusMessage
-
- Type: string
Additional detail about the delivery status, when available.
- initialDeliveryProgress
-
- Type: InitialDeliveryProgress structure
How far the first fill of the dataset's history has progressed. Present only when deliveryState is INITIAL_DELIVERY.
- kmsKeyArn
-
- Required: Yes
- Type: string
The ARN of a KMS key.
- lastDeliveryTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
When the most recent delivery cycle finished. Absent until a delivery cycle has finished.
- s3Arn
-
- Required: Yes
- Type: string
The ARN of an S3 bucket.
Errors
- TooManyRequestsException:
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
- InternalServerException:
Thrown when an unexpected error occurs while processing the request
- AccessDeniedException:
This exception is thrown when the client is not authorized to perform an action
- BadRequestException:
This exception is thrown when the request is not formatted correctly.
- ResourceNotFoundException:
Thrown when the requested resource does not exist
Examples
Example 1: Getting a data subscription
The following example returns a data subscription whose delivery is active, including the extract date through which data has been delivered and when the most recent delivery cycle finished.
$result = $client->getDataSubscription([
'catalog' => 'AWS',
'dataSubscriptionIdentifier' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
]);
Result syntax:
[
'catalog' => 'AWS',
'createTimestamp' => ,
'dataSubscriptionIdentifier' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
'datasetName' => 'opportunity_pipeline',
'deliveredThrough' => ,
'deliveryCompleteness' => ,
'deliveryMethod' => 'S3',
'deliveryState' => 'ACTIVE',
'deliveryStatus' => 'Created',
'kmsKeyArn' => 'arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab',
'lastDeliveryTime' => ,
's3Arn' => 'arn:aws:s3:::example-partner-analytics-bucket',
]
ListDataSubscriptions
$result = $client->listDataSubscriptions([/* ... */]); $promise = $client->listDataSubscriptionsAsync([/* ... */]);
Lists the data subscriptions owned by the calling account in the given catalog. Deleted subscriptions are not listed; use GetDataSubscription to retrieve a deleted subscription by its ARN.
Parameter Syntax
$result = $client->listDataSubscriptions([
'catalog' => '<string>', // REQUIRED
'maxResults' => <integer>,
'nextToken' => '<string>',
]);
Parameter Details
Members
- catalog
-
- Required: Yes
- Type: string
The catalog whose subscriptions to list.
- maxResults
-
- Type: int
The maximum number of subscriptions to return per page.
- nextToken
-
- Type: string
Opaque pagination token from a previous response.
Result Syntax
[
'dataSubscriptions' => [
[
'dataSubscriptionIdentifier' => '<string>',
'datasetName' => '<string>',
'deliveredThrough' => <DateTime>,
'deliveryState' => 'ACTIVE|INITIAL_DELIVERY|DELAYED|ACTION_NEEDED|CANCELLED',
'deliveryStateMessage' => '<string>',
'initialDeliveryProgress' => [
'daysDelivered' => <integer>,
'daysTotal' => <integer>,
],
'lastDeliveryTime' => <DateTime>,
],
// ...
],
'nextToken' => '<string>',
]
Result Details
Members
- dataSubscriptions
-
- Required: Yes
- Type: Array of DataSubscriptionSummary structures
The data subscriptions owned by the caller, as summaries. Empty when the caller has no subscriptions. Call GetDataSubscription for the full detail of an entry.
- nextToken
-
- Type: string
Opaque pagination token to fetch the next page. Absent when no more results exist.
Errors
- TooManyRequestsException:
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
- InternalServerException:
Thrown when an unexpected error occurs while processing the request
- AccessDeniedException:
This exception is thrown when the client is not authorized to perform an action
- BadRequestException:
This exception is thrown when the request is not formatted correctly.
Examples
Example 1: Listing data subscriptions
The following example lists the data subscriptions owned by the calling account in the AWS catalog, up to ten per page. One subscription is active and the other is still receiving its initial delivery. The response carries no nextToken, so there are no further pages.
$result = $client->listDataSubscriptions([
'catalog' => 'AWS',
'maxResults' => 10,
]);
Result syntax:
[
'dataSubscriptions' => [
[
'dataSubscriptionIdentifier' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
'datasetName' => 'opportunity_pipeline',
'deliveredThrough' => ,
'deliveryState' => 'ACTIVE',
'lastDeliveryTime' => ,
],
[
'dataSubscriptionIdentifier' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Engagement_V1/DataSubscription/ds-1a2b3c4d5e6f7g8',
'datasetName' => 'leads',
'deliveryState' => 'INITIAL_DELIVERY',
'initialDeliveryProgress' => [
'daysDelivered' => 1,
'daysTotal' => 2,
],
],
],
]
ListTagsForResource
$result = $client->listTagsForResource([/* ... */]); $promise = $client->listTagsForResourceAsync([/* ... */]);
Lists the tags on a data subscription owned by the calling account.
Parameter Syntax
$result = $client->listTagsForResource([
'catalog' => '<string>', // REQUIRED
'resourceArn' => '<string>', // REQUIRED
]);
Parameter Details
Members
- catalog
-
- Required: Yes
- Type: string
The catalog the subscription belongs to.
- resourceArn
-
- Required: Yes
- Type: string
The ARN of the data subscription.
Result Syntax
[
'tags' => ['<string>', ...],
]
Result Details
Members
- tags
-
- Required: Yes
- Type: Associative array of custom strings keys (TagKey) to strings
The tags on the subscription.
Errors
- TooManyRequestsException:
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
- InternalServerException:
Thrown when an unexpected error occurs while processing the request
- AccessDeniedException:
This exception is thrown when the client is not authorized to perform an action
- BadRequestException:
This exception is thrown when the request is not formatted correctly.
- ResourceNotFoundException:
Thrown when the requested resource does not exist
Examples
Example 1: Listing the tags on a data subscription
The following example lists the tags on a data subscription.
$result = $client->listTagsForResource([
'catalog' => 'AWS',
'resourceArn' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
]);
Result syntax:
[
'tags' => [
'environment' => 'production',
'team' => 'analytics',
],
]
TagResource
$result = $client->tagResource([/* ... */]); $promise = $client->tagResourceAsync([/* ... */]);
Adds or overwrites tags on a data subscription owned by the calling account.
Parameter Syntax
$result = $client->tagResource([
'catalog' => '<string>', // REQUIRED
'resourceArn' => '<string>', // REQUIRED
'tags' => ['<string>', ...], // REQUIRED
]);
Parameter Details
Members
- catalog
-
- Required: Yes
- Type: string
The catalog the subscription belongs to.
- resourceArn
-
- Required: Yes
- Type: string
The ARN of the data subscription to tag.
- tags
-
- Required: Yes
- Type: Associative array of custom strings keys (TagKey) to strings
The tags to add or overwrite. Up to 50 tags; key length 1-128, value length 0-256; keys beginning with the reserved
aws:prefix are rejected.
Result Syntax
[]
Result Details
Errors
- TooManyRequestsException:
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
- InternalServerException:
Thrown when an unexpected error occurs while processing the request
- AccessDeniedException:
This exception is thrown when the client is not authorized to perform an action
- BadRequestException:
This exception is thrown when the request is not formatted correctly.
- ResourceNotFoundException:
Thrown when the requested resource does not exist
Examples
Example 1: Adding tags to a data subscription
The following example adds two tags to a data subscription.
$result = $client->tagResource([
'catalog' => 'AWS',
'resourceArn' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
'tags' => [
'environment' => 'production',
'team' => 'analytics',
],
]);
Result syntax:
[ ]
UntagResource
$result = $client->untagResource([/* ... */]); $promise = $client->untagResourceAsync([/* ... */]);
Removes the named tag keys from a data subscription owned by the calling account.
Parameter Syntax
$result = $client->untagResource([
'catalog' => '<string>', // REQUIRED
'resourceArn' => '<string>', // REQUIRED
'tagKeys' => ['<string>', ...], // REQUIRED
]);
Parameter Details
Members
- catalog
-
- Required: Yes
- Type: string
The catalog the subscription belongs to.
- resourceArn
-
- Required: Yes
- Type: string
The ARN of the data subscription to untag.
- tagKeys
-
- Required: Yes
- Type: Array of strings
The tag keys to remove.
Result Syntax
[]
Result Details
Errors
- TooManyRequestsException:
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
- InternalServerException:
Thrown when an unexpected error occurs while processing the request
- AccessDeniedException:
This exception is thrown when the client is not authorized to perform an action
- BadRequestException:
This exception is thrown when the request is not formatted correctly.
- ResourceNotFoundException:
Thrown when the requested resource does not exist
Examples
Example 1: Removing tags from a data subscription
The following example removes the environment tag from a data subscription.
$result = $client->untagResource([
'catalog' => 'AWS',
'resourceArn' => 'arn:aws:partnercentral::123456789012:catalog/AWS/ReportingData/Opportunity_V1/DataSubscription/ds-0123456789abcde',
'tagKeys' => [
'environment',
],
]);
Result syntax:
[ ]
Shapes
AccessDeniedException
Description
This exception is thrown when the client is not authorized to perform an action
Members
- message
-
- Type: string
BadRequestException
Description
This exception is thrown when the request is not formatted correctly.
Members
- message
-
- Type: string
ConflictException
Description
An active data subscription with the same dataset, delivery method, and destination already exists for the caller.
Members
- message
-
- Type: string
DataSubscriptionSummary
Description
A summary of a data subscription.
Members
- dataSubscriptionIdentifier
-
- Required: Yes
- Type: string
The ARN of a data subscription.
- datasetName
-
- Required: Yes
- Type: string
Specifies the name of a dataset. A bare dataset name (not an ARN); the resource ARN is composed by the runtime/authorizer.
- deliveredThrough
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The extract date through which data has been delivered to your bucket. Same value as deliveryCompleteness; prefer this member. Absent until the first successful delivery.
- deliveryState
-
- Type: string
The delivery state of the subscription, summarizing whether data is arriving in your bucket as expected. See DeliveryState for what each value means. Absent when the service cannot determine it.
- deliveryStateMessage
-
- Type: string
A message that explains the delivery state. Present when deliveryState is ACTION_NEEDED, where it describes why the last write to your bucket was refused so you can fix the bucket policy or KMS key.
- initialDeliveryProgress
-
- Type: InitialDeliveryProgress structure
How far the first fill of the dataset's history has progressed. Present only when deliveryState is INITIAL_DELIVERY.
- lastDeliveryTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
When the most recent delivery cycle finished. Absent until a delivery cycle has finished.
IdempotentParameterMismatchException
Description
The supplied clientToken was used on a prior successful request with different parameters.
Members
- message
-
- Type: string
InitialDeliveryProgress
Description
Progress of the initial delivery, which is the first fill of the dataset's history. Present while deliveryState is INITIAL_DELIVERY. Delivery is complete when daysDelivered equals daysTotal.
Members
- daysDelivered
-
- Type: int
The number of days of history delivered to your bucket so far. Zero before the first day is delivered.
- daysTotal
-
- Type: int
The total number of days of history the initial delivery covers, from the dataset's first available date up to the most recent complete day.
InternalServerException
Description
Thrown when an unexpected error occurs while processing the request
Members
- message
-
- Type: string
KmsKeyAccessException
Description
The KMS key is not usable by the delivery principal for the destination bucket. Check the key policy.
Members
- message
-
- Type: string
ResourceNotFoundException
Description
Thrown when the requested resource does not exist
Members
- message
-
- Type: string
S3AccessException
Description
The destination S3 bucket is not accessible to the delivery principal. Check the bucket policy and ownership.
Members
- message
-
- Type: string
ServiceQuotaExceededException
Description
Creating the data subscription would exceed the per-dataset subscription quota for the caller.
Members
- message
-
- Type: string
TooManyRequestsException
Description
The request was denied due to request throttling. Reduce your request rate and retry with exponential backoff.
Members
- message
-
- Type: string