MediaStoreData

Table of Contents

Client

class MediaStoreData.Client

A low-level client representing AWS Elemental MediaStore Data Plane:

import boto3

client = boto3.client('mediastore-data')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
delete_object(**kwargs)

Deletes an object at the specified path.

See also: AWS API Documentation

Request Syntax

response = client.delete_object(
    Path='string'
)
Parameters
Path (string) --

[REQUIRED]

The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name>

Return type
dict
Returns
Response Syntax
{}

Response Structure

  • (dict) --
describe_object(**kwargs)

Gets the headers for an object at the specified path.

See also: AWS API Documentation

Request Syntax

response = client.describe_object(
    Path='string'
)
Parameters
Path (string) --

[REQUIRED]

The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name>

Return type
dict
Returns
Response Syntax
{
    'ETag': 'string',
    'ContentType': 'string',
    'ContentLength': 123,
    'CacheControl': 'string',
    'LastModified': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --
    • ETag (string) --

      The ETag that represents a unique instance of the object.

    • ContentType (string) --

      The content type of the object.

    • ContentLength (integer) --

      The length of the object in bytes.

    • CacheControl (string) --

      An optional CacheControl header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 .

      Headers with a custom user-defined value are also accepted.

    • LastModified (datetime) --

      The date and time that the object was last modified.

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_object(**kwargs)

Downloads the object at the specified path.

See also: AWS API Documentation

Request Syntax

response = client.get_object(
    Path='string',
    Range='string'
)
Parameters
  • Path (string) --

    [REQUIRED]

    The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name>

    For example, to upload the file mlaw.avi to the folder path premium\canada in the container movies , enter the path premium/canada/mlaw.avi .

    Do not include the container name in this path.

    If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing premium/usa subfolder. If you specify premium/canada , the service creates a canada subfolder in the premium folder. You then have two subfolders, usa and canada , in the premium folder.

    There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore.

    For more information about folders and how they exist in a container, see the AWS Elemental MediaStore User Guide .

    The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension.

  • Range (string) -- The range bytes of an object to retrieve. For more information about the Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 .
Return type

dict

Returns

Response Syntax

{
    'Body': StreamingBody(),
    'CacheControl': 'string',
    'ContentRange': 'string',
    'ContentLength': 123,
    'ContentType': 'string',
    'ETag': 'string',
    'LastModified': datetime(2015, 1, 1),
    'StatusCode': 123
}

Response Structure

  • (dict) --

    • Body (StreamingBody) --

      The bytes of the object.

    • CacheControl (string) --

      An optional CacheControl header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP spec at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 .

      Headers with a custom user-defined value are also accepted.

    • ContentRange (string) --

      The range of bytes to retrieve.

    • ContentLength (integer) --

      The length of the object in bytes.

    • ContentType (string) --

      The content type of the object.

    • ETag (string) --

      The ETag that represents a unique instance of the object.

    • LastModified (datetime) --

      The date and time that the object was last modified.

    • StatusCode (integer) --

      The HTML status code of the request. Status codes ranging from 200 to 299 indicate success. All other status codes indicate the type of error that occurred.

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_items(**kwargs)

Provides a list of metadata entries about folders and objects in the specified folder.

See also: AWS API Documentation

Request Syntax

response = client.list_items(
    Path='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • Path (string) -- The path in the container from which to retrieve items. Format: <folder name>/<folder name>/<file name>
  • MaxResults (integer) --

    The maximum number of results to return per API request. For example, you submit a ListItems request with MaxResults set at 500. Although 2,000 items match your request, the service returns no more than the first 500 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.) The service might return fewer results than the MaxResults value.

    If MaxResults is not included in the request, the service defaults to pagination with a maximum of 1,000 results per page.

  • NextToken (string) --

    The token that identifies which batch of results that you want to see. For example, you submit a ListItems request with MaxResults set at 500. The service returns the first batch of results (up to 500) and a NextToken value. To see the next batch of results, you can submit the ListItems request a second time and specify the NextToken value.

    Tokens expire after 15 minutes.

Return type

dict

Returns

Response Syntax

{
    'Items': [
        {
            'Name': 'string',
            'Type': 'OBJECT'|'FOLDER',
            'ETag': 'string',
            'LastModified': datetime(2015, 1, 1),
            'ContentType': 'string',
            'ContentLength': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Items (list) --

      The metadata entries for the folders and objects at the requested path.

      • (dict) --

        A metadata entry for a folder or object.

        • Name (string) --

          The name of the item.

        • Type (string) --

          The item type (folder or object).

        • ETag (string) --

          The ETag that represents a unique instance of the item.

        • LastModified (datetime) --

          The date and time that the item was last modified.

        • ContentType (string) --

          The content type of the item.

        • ContentLength (integer) --

          The length of the item in bytes.

    • NextToken (string) --

      The token that can be used in a request to view the next set of results. For example, you submit a ListItems request that matches 2,000 items with MaxResults set at 500. The service returns the first batch of results (up to 500) and a NextToken value that can be used to fetch the next batch of results.

put_object(**kwargs)

Uploads an object to the specified path. Object sizes are limited to 25 MB.

See also: AWS API Documentation

Request Syntax

response = client.put_object(
    Body=b'bytes'|file,
    Path='string',
    ContentType='string',
    CacheControl='string',
    StorageClass='TEMPORAL'
)
Parameters
  • Body (bytes or seekable file-like object) --

    [REQUIRED]

    The bytes to be stored.

  • Path (string) --

    [REQUIRED]

    The path (including the file name) where the object is stored in the container. Format: <folder name>/<folder name>/<file name>

    For example, to upload the file mlaw.avi to the folder path premium\canada in the container movies , enter the path premium/canada/mlaw.avi .

    Do not include the container name in this path.

    If the path includes any folders that don't exist yet, the service creates them. For example, suppose you have an existing premium/usa subfolder. If you specify premium/canada , the service creates a canada subfolder in the premium folder. You then have two subfolders, usa and canada , in the premium folder.

    There is no correlation between the path to the source and the path (folders) in the container in AWS Elemental MediaStore.

    For more information about folders and how they exist in a container, see the AWS Elemental MediaStore User Guide .

    The file name is the name that is assigned to the file that you upload. The file can have the same name inside and outside of AWS Elemental MediaStore, or it can have the same name. The file name can include or omit an extension.

  • ContentType (string) -- The content type of the object.
  • CacheControl (string) --

    An optional CacheControl header that allows the caller to control the object's cache behavior. Headers can be passed in as specified in the HTTP at https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 .

    Headers with a custom user-defined value are also accepted.

  • StorageClass (string) -- Indicates the storage class of a Put request. Defaults to high-performance temporal storage class, and objects are persisted into durable storage shortly after being received.
Return type

dict

Returns

Response Syntax

{
    'ContentSHA256': 'string',
    'ETag': 'string',
    'StorageClass': 'TEMPORAL'
}

Response Structure

  • (dict) --

    • ContentSHA256 (string) --

      The SHA256 digest of the object that is persisted.

    • ETag (string) --

      Unique identifier of the object in the container.

    • StorageClass (string) --

      The storage class where the object was persisted. The class should be “Temporal”.

Paginators

The available paginators are:

class MediaStoreData.Paginator.ListItems
paginator = client.get_paginator('list_items')
paginate(**kwargs)

Creates an iterator that will paginate through responses from MediaStoreData.Client.list_items().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    Path='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • Path (string) -- The path in the container from which to retrieve items. Format: <folder name>/<folder name>/<file name>
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'Items': [
        {
            'Name': 'string',
            'Type': 'OBJECT'|'FOLDER',
            'ETag': 'string',
            'LastModified': datetime(2015, 1, 1),
            'ContentType': 'string',
            'ContentLength': 123
        },
    ],

}

Response Structure

  • (dict) --

    • Items (list) --

      The metadata entries for the folders and objects at the requested path.

      • (dict) --

        A metadata entry for a folder or object.

        • Name (string) --

          The name of the item.

        • Type (string) --

          The item type (folder or object).

        • ETag (string) --

          The ETag that represents a unique instance of the item.

        • LastModified (datetime) --

          The date and time that the item was last modified.

        • ContentType (string) --

          The content type of the item.

        • ContentLength (integer) --

          The length of the item in bytes.