CreateCampaign
Creates a campaign that deploys a solution version. When a client calls the GetRecommendations and GetPersonalizedRanking APIs, a campaign is specified in the request.
Minimum Provisioned TPS and Auto-Scaling
Important
A high minProvisionedTPS
will increase your bill. We recommend starting with 1 for minProvisionedTPS
(the default). Track
your usage using Amazon CloudWatch metrics, and increase the minProvisionedTPS
as necessary.
A transaction is a single GetRecommendations
or
GetPersonalizedRanking
call. Transactions per second (TPS) is the throughput
and unit of billing for Amazon Personalize. The minimum provisioned TPS
(minProvisionedTPS
) specifies the baseline throughput provisioned by
Amazon Personalize, and thus, the minimum billing charge.
If your TPS increases beyond
minProvisionedTPS
, Amazon Personalize auto-scales the provisioned capacity up and down,
but never below minProvisionedTPS
.
There's a short time delay while the capacity is increased that might cause loss of
transactions.
The actual TPS used is calculated as the average requests/second within a 5-minute window.
You pay for maximum of either the minimum provisioned TPS or the actual TPS.
We recommend starting with a low minProvisionedTPS
, track
your usage using Amazon CloudWatch metrics, and then increase the minProvisionedTPS
as necessary.
Status
A campaign can be in one of the following states:
-
CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED
-
DELETE PENDING > DELETE IN_PROGRESS
To get the campaign status, call DescribeCampaign.
Note
Wait until the status
of the campaign
is ACTIVE
before asking the campaign for recommendations.
Related APIs
Request Syntax
{
"campaignConfig": {
"itemExplorationConfig": {
"string
" : "string
"
}
},
"minProvisionedTPS": number
,
"name": "string
",
"solutionVersionArn": "string
",
"tags": [
{
"tagKey": "string
",
"tagValue": "string
"
}
]
}
Request Parameters
The request accepts the following data in JSON format.
- campaignConfig
-
The configuration details of a campaign.
Type: CampaignConfig object
Required: No
- minProvisionedTPS
-
Specifies the requested minimum provisioned transactions (recommendations) per second that Amazon Personalize will support. A high
minProvisionedTPS
will increase your bill. We recommend starting with 1 forminProvisionedTPS
(the default). Track your usage using Amazon CloudWatch metrics, and increase theminProvisionedTPS
as necessary.Type: Integer
Valid Range: Minimum value of 1.
Required: No
- name
-
A name for the new campaign. The campaign name must be unique within your account.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 63.
Pattern:
^[a-zA-Z0-9][a-zA-Z0-9\-_]*
Required: Yes
- solutionVersionArn
-
The Amazon Resource Name (ARN) of the solution version to deploy.
Type: String
Length Constraints: Maximum length of 256.
Pattern:
arn:([a-z\d-]+):personalize:.*:.*:.+
Required: Yes
- tags
-
A list of tags to apply to the campaign.
Type: Array of Tag objects
Array Members: Minimum number of 0 items. Maximum number of 200 items.
Required: No
Response Syntax
{
"campaignArn": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- campaignArn
-
The Amazon Resource Name (ARN) of the campaign.
Type: String
Length Constraints: Maximum length of 256.
Pattern:
arn:([a-z\d-]+):personalize:.*:.*:.+
Errors
- InvalidInputException
-
Provide a valid value for the field or parameter.
HTTP Status Code: 400
- LimitExceededException
-
The limit on the number of requests per second has been exceeded.
HTTP Status Code: 400
- ResourceAlreadyExistsException
-
The specified resource already exists.
HTTP Status Code: 400
- ResourceInUseException
-
The specified resource is in use.
HTTP Status Code: 400
- ResourceNotFoundException
-
Could not find the specified resource.
HTTP Status Code: 400
- TooManyTagsException
-
You have exceeded the maximum number of tags you can apply to this resource.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: