get_metric_policy

get_metric_policy(**kwargs)

Returns the metric policy for the specified container.

See also: AWS API Documentation

Request Syntax

response = client.get_metric_policy(
    ContainerName='string'
)
Parameters
ContainerName (string) --

[REQUIRED]

The name of the container that is associated with the metric policy.

Return type
dict
Returns
Response Syntax
{
    'MetricPolicy': {
        'ContainerLevelMetrics': 'ENABLED'|'DISABLED',
        'MetricPolicyRules': [
            {
                'ObjectGroup': 'string',
                'ObjectGroupName': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --
    • MetricPolicy (dict) --

      The metric policy that is associated with the specific container.

      • ContainerLevelMetrics (string) --

        A setting to enable or disable metrics at the container level.

      • MetricPolicyRules (list) --

        A parameter that holds an array of rules that enable metrics at the object level. This parameter is optional, but if you choose to include it, you must also include at least one rule. By default, you can include up to five rules. You can also request a quota increase to allow up to 300 rules per policy.

        • (dict) --

          A setting that enables metrics at the object level. Each rule contains an object group and an object group name. If the policy includes the MetricPolicyRules parameter, you must include at least one rule. Each metric policy can include up to five rules by default. You can also request a quota increase to allow up to 300 rules per policy.

          • ObjectGroup (string) --

            A path or file name that defines which objects to include in the group. Wildcards (*) are acceptable.

          • ObjectGroupName (string) --

            A name that allows you to refer to the object group.

Exceptions

  • MediaStore.Client.exceptions.ContainerNotFoundException
  • MediaStore.Client.exceptions.PolicyNotFoundException
  • MediaStore.Client.exceptions.ContainerInUseException
  • MediaStore.Client.exceptions.InternalServerError