You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::MediaStore::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



163
164
165
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 163

def initialize(*args)
  super
end

Instance Method Details

#create_container(params = {}) ⇒ Types::CreateContainerOutput

Creates a storage container to hold objects. A container is similar to a bucket in the Amazon S3 service.

Examples:

Request syntax with placeholder values


resp = client.create_container({
  container_name: "ContainerName", # required
})

Response structure


resp.container.endpoint #=> String
resp.container.creation_time #=> Time
resp.container.arn #=> String
resp.container.name #=> String
resp.container.status #=> String, one of "ACTIVE", "CREATING", "DELETING"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    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.

Returns:

See Also:



201
202
203
204
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 201

def create_container(params = {}, options = {})
  req = build_request(:create_container, params)
  req.send_request(options)
end

#delete_container(params = {}) ⇒ Struct

Deletes the specified container. Before you make a DeleteContainer request, delete any objects in the container or in any folders in the container. You can delete only empty containers.

Examples:

Request syntax with placeholder values


resp = client.delete_container({
  container_name: "ContainerName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    The name of the container to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



225
226
227
228
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 225

def delete_container(params = {}, options = {})
  req = build_request(:delete_container, params)
  req.send_request(options)
end

#delete_container_policy(params = {}) ⇒ Struct

Deletes the access policy that is associated with the specified container.

Examples:

Request syntax with placeholder values


resp = client.delete_container_policy({
  container_name: "ContainerName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    The name of the container that holds the policy.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



248
249
250
251
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 248

def delete_container_policy(params = {}, options = {})
  req = build_request(:delete_container_policy, params)
  req.send_request(options)
end

#delete_cors_policy(params = {}) ⇒ Struct

Deletes the cross-origin resource sharing (CORS) configuration information that is set for the container.

To use this operation, you must have permission to perform the MediaStore:DeleteCorsPolicy action. The container owner has this permission by default and can grant this permission to others.

Examples:

Request syntax with placeholder values


resp = client.delete_cors_policy({
  container_name: "ContainerName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    The name of the container to remove the policy from.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



275
276
277
278
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 275

def delete_cors_policy(params = {}, options = {})
  req = build_request(:delete_cors_policy, params)
  req.send_request(options)
end

#describe_container(params = {}) ⇒ Types::DescribeContainerOutput

Retrieves the properties of the requested container. This request is commonly used to retrieve the endpoint of a container. An endpoint is a value assigned by the service when a new container is created. A container's endpoint does not change after it has been assigned. The DescribeContainer request returns a single Container object based on ContainerName. To return all Container objects that are associated with a specified AWS account, use ListContainers.

Examples:

Request syntax with placeholder values


resp = client.describe_container({
  container_name: "ContainerName",
})

Response structure


resp.container.endpoint #=> String
resp.container.creation_time #=> Time
resp.container.arn #=> String
resp.container.name #=> String
resp.container.status #=> String, one of "ACTIVE", "CREATING", "DELETING"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (String)

    The name of the container to query.

Returns:

See Also:



313
314
315
316
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 313

def describe_container(params = {}, options = {})
  req = build_request(:describe_container, params)
  req.send_request(options)
end

#get_container_policy(params = {}) ⇒ Types::GetContainerPolicyOutput

Retrieves the access policy for the specified container. For information about the data that is included in an access policy, see the AWS Identity and Access Management User Guide.

Examples:

Request syntax with placeholder values


resp = client.get_container_policy({
  container_name: "ContainerName", # required
})

Response structure


resp.policy #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    The name of the container.

Returns:

See Also:



347
348
349
350
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 347

def get_container_policy(params = {}, options = {})
  req = build_request(:get_container_policy, params)
  req.send_request(options)
end

#get_cors_policy(params = {}) ⇒ Types::GetCorsPolicyOutput

Returns the cross-origin resource sharing (CORS) configuration information that is set for the container.

To use this operation, you must have permission to perform the MediaStore:GetCorsPolicy action. By default, the container owner has this permission and can grant it to others.

Examples:

Request syntax with placeholder values


resp = client.get_cors_policy({
  container_name: "ContainerName", # required
})

Response structure


resp.cors_policy #=> Array
resp.cors_policy[0].allowed_origins #=> Array
resp.cors_policy[0].allowed_origins[0] #=> String
resp.cors_policy[0].allowed_methods #=> Array
resp.cors_policy[0].allowed_methods[0] #=> String, one of "PUT", "GET", "DELETE", "HEAD"
resp.cors_policy[0].allowed_headers #=> Array
resp.cors_policy[0].allowed_headers[0] #=> String
resp.cors_policy[0].max_age_seconds #=> Integer
resp.cors_policy[0].expose_headers #=> Array
resp.cors_policy[0].expose_headers[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    The name of the container that the policy is assigned to.

Returns:

See Also:



389
390
391
392
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 389

def get_cors_policy(params = {}, options = {})
  req = build_request(:get_cors_policy, params)
  req.send_request(options)
end

#list_containers(params = {}) ⇒ Types::ListContainersOutput

Lists the properties of all containers in AWS Elemental MediaStore.

You can query to receive all the containers in one response. Or you can include the MaxResults parameter to receive a limited number of containers in each response. In this case, the response includes a token. To get the next set of containers, send the command again, this time with the NextToken parameter (with the returned token as its value). The next set of responses appears, with a token if there are still more containers to receive.

See also DescribeContainer, which gets the properties of one container.

Examples:

Request syntax with placeholder values


resp = client.list_containers({
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.containers #=> Array
resp.containers[0].endpoint #=> String
resp.containers[0].creation_time #=> Time
resp.containers[0].arn #=> String
resp.containers[0].name #=> String
resp.containers[0].status #=> String, one of "ACTIVE", "CREATING", "DELETING"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    Only if you used MaxResults in the first command, enter the token (which was included in the previous response) to obtain the next set of containers. This token is included in a response only if there actually are more containers to list.

  • :max_results (Integer)

    Enter the maximum number of containers in the response. Use from 1 to 255 characters.

Returns:

See Also:



443
444
445
446
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 443

def list_containers(params = {}, options = {})
  req = build_request(:list_containers, params)
  req.send_request(options)
end

#put_container_policy(params = {}) ⇒ Struct

Creates an access policy for the specified container to restrict the users and clients that can access it. For information about the data that is included in an access policy, see the AWS Identity and Access Management User Guide.

For this release of the REST API, you can create only one policy for a container. If you enter PutContainerPolicy twice, the second command modifies the existing policy.

Examples:

Request syntax with placeholder values


resp = client.put_container_policy({
  container_name: "ContainerName", # required
  policy: "ContainerPolicy", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    The name of the container.

  • :policy (required, String)

    The contents of the policy, which includes the following:

    • One Version tag

    • One Statement tag that contains the standard tags for the policy.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



484
485
486
487
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 484

def put_container_policy(params = {}, options = {})
  req = build_request(:put_container_policy, params)
  req.send_request(options)
end

#put_cors_policy(params = {}) ⇒ Struct

Sets the cross-origin resource sharing (CORS) configuration on a container so that the container can service cross-origin requests. For example, you might want to enable a request whose origin is http://www.example.com to access your AWS Elemental MediaStore container at my.example.container.com by using the browser's XMLHttpRequest capability.

To enable CORS on a container, you attach a CORS policy to the container. In the CORS policy, you configure rules that identify origins and the HTTP methods that can be executed on your container. The policy can contain up to 398,000 characters. You can add up to 100 rules to a CORS policy. If more than one rule applies, the service uses the first applicable rule listed.

Examples:

Request syntax with placeholder values


resp = client.put_cors_policy({
  container_name: "ContainerName", # required
  cors_policy: [ # required
    {
      allowed_origins: ["Origin"],
      allowed_methods: ["PUT"], # accepts PUT, GET, DELETE, HEAD
      allowed_headers: ["Header"],
      max_age_seconds: 1,
      expose_headers: ["Header"],
    },
  ],
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :container_name (required, String)

    The name of the container that you want to assign the CORS policy to.

  • :cors_policy (required, Array<Types::CorsRule>)

    The CORS policy to apply to the container.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



530
531
532
533
# File 'gems/aws-sdk-mediastore/lib/aws-sdk-mediastore/client.rb', line 530

def put_cors_policy(params = {}, options = {})
  req = build_request(:put_cors_policy, params)
  req.send_request(options)
end