CreateContainer
Creates a storage container to hold objects. A container is similar to a bucket in the Amazon S3 service.
Request Syntax
{
"ContainerName": "string
",
"Tags": [
{
"Key": "string
",
"Value": "string
"
}
]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ContainerName
-
The name for the container. The name must be from 1 to 255 characters. Container names must be unique to your AWS account within a specific region. As an example, you could create a container named
movies
in every region, as long as you don’t have an existing container with that name.Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Pattern:
[\w-]+
Required: Yes
- Tags
-
An array of key:value pairs that you define. These values can be anything that you want. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each container. For more information about tagging, including naming and usage conventions, see Tagging Resources in MediaStore.
Type: Array of Tag objects
Array Members: Minimum number of 1 item. Maximum number of 200 items.
Required: No
Response Syntax
{
"Container": {
"AccessLoggingEnabled": boolean,
"ARN": "string",
"CreationTime": number,
"Endpoint": "string",
"Name": "string",
"Status": "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.
- Container
-
ContainerARN: The Amazon Resource Name (ARN) of the newly created container. The ARN has the following format: arn:aws:<region>:<account that owns this container>:container/<name of container>. For example: arn:aws:mediastore:us-west-2:111122223333:container/movies
ContainerName: The container name as specified in the request.
CreationTime: Unix time stamp.
Status: The status of container creation or deletion. The status is one of the following:
CREATING
,ACTIVE
, orDELETING
. While the service is creating the container, the status isCREATING
. When an endpoint is available, the status changes toACTIVE
.The return value does not include the container's endpoint. To make downstream requests, you must obtain this value by using DescribeContainer or ListContainers.
Type: Container object
Errors
For information about the errors that are common to all actions, see Common Errors.
- ContainerInUseException
-
The container that you specified in the request already exists or is being updated.
HTTP Status Code: 400
- InternalServerError
-
The service is temporarily unavailable.
HTTP Status Code: 500
- LimitExceededException
-
A service limit has been exceeded.
HTTP Status Code: 400
Examples
Example Request
The following example shows how to create a container with the name
movies
:
POST / HTTP/1.1 Host: mediastore.us-west-2.amazonaws.com x-amz-Date: 20170323T120000Z x-amz-target:ElementalMediaStoreService_20160711.CreateContainer content-type:application/x-amz-json-1.1 Content-Length:30 Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20141123/us-west-2/mediastore/aws4_request, SignedHeaders=host;x-amz-date;x-amz-mediastore-version, Signature=9257c16da6b25a715ce900a5b45b03da0447acf430195dcb540091b12966f2a2 { "ContainerName": "movies", }
Example Response
This example illustrates one usage of CreateContainer.
HTTP/1.1 { "Container": { "ContainerARN": "arn:aws:mediastore:us-west-2:111122223333:container/movies" "ContainerName": "movies" "CreationTime": "1491522511.486", "Status": "CREATING" }
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: