PrometheusService

Client

class PrometheusService.Client

A low-level client representing Amazon Prometheus Service

Amazon Managed Service for Prometheus

client = session.create_client('amp')

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.
create_alert_manager_definition(**kwargs)

Create an alert manager definition.

See also: AWS API Documentation

Request Syntax

response = client.create_alert_manager_definition(
    clientToken='string',
    data=b'bytes',
    workspaceId='string'
)
Parameters
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • data (bytes) --

    [REQUIRED]

    The alert manager definition data.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace in which to create the alert manager definition.

Return type

dict

Returns

Response Syntax

{
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
        'statusReason': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a CreateAlertManagerDefinition operation.

    • status (dict) --

      The status of alert manager definition.

      • statusCode (string) --

        Status code of this definition.

      • statusReason (string) --

        The reason for failure if any.

Exceptions

create_rule_groups_namespace(**kwargs)

Create a rule group namespace.

See also: AWS API Documentation

Request Syntax

response = client.create_rule_groups_namespace(
    clientToken='string',
    data=b'bytes',
    name='string',
    tags={
        'string': 'string'
    },
    workspaceId='string'
)
Parameters
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • data (bytes) --

    [REQUIRED]

    The namespace data that define the rule groups.

  • name (string) --

    [REQUIRED]

    The rule groups namespace name.

  • tags (dict) --

    Optional, user-provided tags for this rule groups namespace.

    • (string) --

      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

      • (string) --

        The value of the tag.

        Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace in which to create the rule group namespace.

Return type

dict

Returns

Response Syntax

{
    'arn': 'string',
    'name': 'string',
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
        'statusReason': 'string'
    },
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a CreateRuleGroupsNamespace operation.

    • arn (string) --

      The Amazon Resource Name (ARN) of this rule groups namespace.

    • name (string) --

      The rule groups namespace name.

    • status (dict) --

      The status of rule groups namespace.

      • statusCode (string) --

        Status code of this namespace.

      • statusReason (string) --

        The reason for failure if any.

    • tags (dict) --

      The tags of this rule groups namespace.

      • (string) --

        The key of the tag.

        Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

        • (string) --

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Exceptions

create_workspace(**kwargs)

Creates a new AMP workspace.

See also: AWS API Documentation

Request Syntax

response = client.create_workspace(
    alias='string',
    clientToken='string',
    tags={
        'string': 'string'
    }
)
Parameters
  • alias (string) -- An optional user-assigned alias for this workspace. This alias is for user reference and does not need to be unique.
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • tags (dict) --

    Optional, user-provided tags for this workspace.

    • (string) --

      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

      • (string) --

        The value of the tag.

        Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Return type

dict

Returns

Response Syntax

{
    'arn': 'string',
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'
    },
    'tags': {
        'string': 'string'
    },
    'workspaceId': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a CreateWorkspace operation.

    • arn (string) --

      The ARN of the workspace that was just created.

    • status (dict) --

      The status of the workspace that was just created (usually CREATING).

      • statusCode (string) --

        Status code of this workspace.

    • tags (dict) --

      The tags of this workspace.

      • (string) --

        The key of the tag.

        Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

        • (string) --

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

    • workspaceId (string) --

      The generated ID of the workspace that was just created.

Exceptions

delete_alert_manager_definition(**kwargs)

Deletes an alert manager definition.

See also: AWS API Documentation

Request Syntax

response = client.delete_alert_manager_definition(
    clientToken='string',
    workspaceId='string'
)
Parameters
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace in which to delete the alert manager definition.

Returns

None

Exceptions

delete_rule_groups_namespace(**kwargs)

Delete a rule groups namespace.

See also: AWS API Documentation

Request Syntax

response = client.delete_rule_groups_namespace(
    clientToken='string',
    name='string',
    workspaceId='string'
)
Parameters
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • name (string) --

    [REQUIRED]

    The rule groups namespace name.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace to delete rule group definition.

Returns

None

Exceptions

delete_workspace(**kwargs)

Deletes an AMP workspace.

See also: AWS API Documentation

Request Syntax

response = client.delete_workspace(
    clientToken='string',
    workspaceId='string'
)
Parameters
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace to delete.

Returns

None

Exceptions

describe_alert_manager_definition(**kwargs)

Describes an alert manager definition.

See also: AWS API Documentation

Request Syntax

response = client.describe_alert_manager_definition(
    workspaceId='string'
)
Parameters
workspaceId (string) --

[REQUIRED]

The ID of the workspace to describe.

Return type
dict
Returns
Response Syntax
{
    'alertManagerDefinition': {
        'createdAt': datetime(2015, 1, 1),
        'data': b'bytes',
        'modifiedAt': datetime(2015, 1, 1),
        'status': {
            'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
            'statusReason': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Represents the output of a DescribeAlertManagerDefinition operation.

    • alertManagerDefinition (dict) --

      The properties of the selected workspace's alert manager definition.

      • createdAt (datetime) --

        The time when the alert manager definition was created.

      • data (bytes) --

        The alert manager definition.

      • modifiedAt (datetime) --

        The time when the alert manager definition was modified.

      • status (dict) --

        The status of alert manager definition.

        • statusCode (string) --

          Status code of this definition.

        • statusReason (string) --

          The reason for failure if any.

Exceptions

describe_rule_groups_namespace(**kwargs)

Describe a rule groups namespace.

See also: AWS API Documentation

Request Syntax

response = client.describe_rule_groups_namespace(
    name='string',
    workspaceId='string'
)
Parameters
  • name (string) --

    [REQUIRED]

    The rule groups namespace.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace to describe.

Return type

dict

Returns

Response Syntax

{
    'ruleGroupsNamespace': {
        'arn': 'string',
        'createdAt': datetime(2015, 1, 1),
        'data': b'bytes',
        'modifiedAt': datetime(2015, 1, 1),
        'name': 'string',
        'status': {
            'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
            'statusReason': 'string'
        },
        'tags': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Represents the output of a DescribeRuleGroupsNamespace operation.

    • ruleGroupsNamespace (dict) --

      The selected rule groups namespace.

      • arn (string) --

        The Amazon Resource Name (ARN) of this rule groups namespace.

      • createdAt (datetime) --

        The time when the rule groups namespace was created.

      • data (bytes) --

        The rule groups namespace data.

      • modifiedAt (datetime) --

        The time when the rule groups namespace was modified.

      • name (string) --

        The rule groups namespace name.

      • status (dict) --

        The status of rule groups namespace.

        • statusCode (string) --

          Status code of this namespace.

        • statusReason (string) --

          The reason for failure if any.

      • tags (dict) --

        The tags of this rule groups namespace.

        • (string) --

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

          • (string) --

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Exceptions

describe_workspace(**kwargs)

Describes an existing AMP workspace.

See also: AWS API Documentation

Request Syntax

response = client.describe_workspace(
    workspaceId='string'
)
Parameters
workspaceId (string) --

[REQUIRED]

The ID of the workspace to describe.

Return type
dict
Returns
Response Syntax
{
    'workspace': {
        'alias': 'string',
        'arn': 'string',
        'createdAt': datetime(2015, 1, 1),
        'prometheusEndpoint': 'string',
        'status': {
            'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'
        },
        'tags': {
            'string': 'string'
        },
        'workspaceId': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a DescribeWorkspace operation.

    • workspace (dict) --

      The properties of the selected workspace.

      • alias (string) --

        Alias of this workspace.

      • arn (string) --

        The Amazon Resource Name (ARN) of this workspace.

      • createdAt (datetime) --

        The time when the workspace was created.

      • prometheusEndpoint (string) --

        Prometheus endpoint URI.

      • status (dict) --

        The status of this workspace.

        • statusCode (string) --

          Status code of this workspace.

      • tags (dict) --

        The tags of this workspace.

        • (string) --

          The key of the tag.

          Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

          • (string) --

            The value of the tag.

            Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

      • workspaceId (string) --

        Unique string identifying this workspace.

Exceptions

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_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_rule_groups_namespaces(**kwargs)

Lists rule groups namespaces.

See also: AWS API Documentation

Request Syntax

response = client.list_rule_groups_namespaces(
    maxResults=123,
    name='string',
    nextToken='string',
    workspaceId='string'
)
Parameters
  • maxResults (integer) -- Maximum results to return in response (default=100, maximum=1000).
  • name (string) -- Optional filter for rule groups namespace name. Only the rule groups namespace that begin with this value will be returned.
  • nextToken (string) -- Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListRuleGroupsNamespaces request.
  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace.

Return type

dict

Returns

Response Syntax

{
    'nextToken': 'string',
    'ruleGroupsNamespaces': [
        {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'modifiedAt': datetime(2015, 1, 1),
            'name': 'string',
            'status': {
                'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
                'statusReason': 'string'
            },
            'tags': {
                'string': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    Represents the output of a ListRuleGroupsNamespaces operation.

    • nextToken (string) --

      Pagination token to use when requesting the next page in this list.

    • ruleGroupsNamespaces (list) --

      The list of the selected rule groups namespaces.

      • (dict) --

        Represents a summary of the rule groups namespace.

        • arn (string) --

          The Amazon Resource Name (ARN) of this rule groups namespace.

        • createdAt (datetime) --

          The time when the rule groups namespace was created.

        • modifiedAt (datetime) --

          The time when the rule groups namespace was modified.

        • name (string) --

          The rule groups namespace name.

        • status (dict) --

          The status of rule groups namespace.

          • statusCode (string) --

            Status code of this namespace.

          • statusReason (string) --

            The reason for failure if any.

        • tags (dict) --

          The tags of this rule groups namespace.

          • (string) --

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

            • (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Exceptions

list_tags_for_resource(**kwargs)

Lists the tags you have assigned to the resource.

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    resourceArn='string'
)
Parameters
resourceArn (string) --

[REQUIRED]

The ARN of the resource.

Return type
dict
Returns
Response Syntax
{
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --
    • tags (dict) --

      The list of tags assigned to the resource.

      • (string) --

        The key of the tag.

        Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

        • (string) --

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Exceptions

list_workspaces(**kwargs)

Lists all AMP workspaces, including workspaces being created or deleted.

See also: AWS API Documentation

Request Syntax

response = client.list_workspaces(
    alias='string',
    maxResults=123,
    nextToken='string'
)
Parameters
  • alias (string) -- Optional filter for workspace alias. Only the workspaces with aliases that begin with this value will be returned.
  • maxResults (integer) -- Maximum results to return in response (default=100, maximum=1000).
  • nextToken (string) -- Pagination token to request the next page in a paginated list. This token is obtained from the output of the previous ListWorkspaces request.
Return type

dict

Returns

Response Syntax

{
    'nextToken': 'string',
    'workspaces': [
        {
            'alias': 'string',
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'status': {
                'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'
            },
            'tags': {
                'string': 'string'
            },
            'workspaceId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the output of a ListWorkspaces operation.

    • nextToken (string) --

      Pagination token to use when requesting the next page in this list.

    • workspaces (list) --

      The list of existing workspaces, including those undergoing creation or deletion.

      • (dict) --

        Represents a summary of the properties of a workspace.

        • alias (string) --

          Alias of this workspace.

        • arn (string) --

          The AmazonResourceName of this workspace.

        • createdAt (datetime) --

          The time when the workspace was created.

        • status (dict) --

          The status of this workspace.

          • statusCode (string) --

            Status code of this workspace.

        • tags (dict) --

          The tags of this workspace.

          • (string) --

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

            • (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

        • workspaceId (string) --

          Unique string identifying this workspace.

Exceptions

put_alert_manager_definition(**kwargs)

Update an alert manager definition.

See also: AWS API Documentation

Request Syntax

response = client.put_alert_manager_definition(
    clientToken='string',
    data=b'bytes',
    workspaceId='string'
)
Parameters
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • data (bytes) --

    [REQUIRED]

    The alert manager definition data.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace in which to update the alert manager definition.

Return type

dict

Returns

Response Syntax

{
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
        'statusReason': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a PutAlertManagerDefinition operation.

    • status (dict) --

      The status of alert manager definition.

      • statusCode (string) --

        Status code of this definition.

      • statusReason (string) --

        The reason for failure if any.

Exceptions

put_rule_groups_namespace(**kwargs)

Update a rule groups namespace.

See also: AWS API Documentation

Request Syntax

response = client.put_rule_groups_namespace(
    clientToken='string',
    data=b'bytes',
    name='string',
    workspaceId='string'
)
Parameters
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • data (bytes) --

    [REQUIRED]

    The namespace data that define the rule groups.

  • name (string) --

    [REQUIRED]

    The rule groups namespace name.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace in which to update the rule group namespace.

Return type

dict

Returns

Response Syntax

{
    'arn': 'string',
    'name': 'string',
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
        'statusReason': 'string'
    },
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a PutRuleGroupsNamespace operation.

    • arn (string) --

      The Amazon Resource Name (ARN) of this rule groups namespace.

    • name (string) --

      The rule groups namespace name.

    • status (dict) --

      The status of rule groups namespace.

      • statusCode (string) --

        Status code of this namespace.

      • statusReason (string) --

        The reason for failure if any.

    • tags (dict) --

      The tags of this rule groups namespace.

      • (string) --

        The key of the tag.

        Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

        • (string) --

          The value of the tag.

          Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Exceptions

tag_resource(**kwargs)

Creates tags for the specified resource.

See also: AWS API Documentation

Request Syntax

response = client.tag_resource(
    resourceArn='string',
    tags={
        'string': 'string'
    }
)
Parameters
  • resourceArn (string) --

    [REQUIRED]

    The ARN of the resource.

  • tags (dict) --

    [REQUIRED]

    The list of tags assigned to the resource.

    • (string) --

      The key of the tag.

      Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

      • (string) --

        The value of the tag.

        Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

untag_resource(**kwargs)

Deletes tags from the specified resource.

See also: AWS API Documentation

Request Syntax

response = client.untag_resource(
    resourceArn='string',
    tagKeys=[
        'string',
    ]
)
Parameters
  • resourceArn (string) --

    [REQUIRED]

    The ARN of the resource.

  • tagKeys (list) --

    [REQUIRED]

    One or more tag keys

    • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

update_workspace_alias(**kwargs)

Updates an AMP workspace alias.

See also: AWS API Documentation

Request Syntax

response = client.update_workspace_alias(
    alias='string',
    clientToken='string',
    workspaceId='string'
)
Parameters
  • alias (string) -- The new alias of the workspace.
  • clientToken (string) --

    Optional, unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace being updated.

Returns

None

Exceptions

Client Exceptions

Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.

The available client exceptions are:

class PrometheusService.Client.exceptions.AccessDeniedException

User does not have sufficient access to perform this action.

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    User does not have sufficient access to perform this action.

    • message (string) --

      Description of the error.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class PrometheusService.Client.exceptions.ConflictException

Updating or deleting a resource can cause an inconsistent state.

Example

try:
  ...
except client.exceptions.ConflictException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'resourceId': 'string',
    'resourceType': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Updating or deleting a resource can cause an inconsistent state.

    • message (string) --

      Description of the error.

    • resourceId (string) --

      Identifier of the resource affected.

    • resourceType (string) --

      Type of the resource affected.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class PrometheusService.Client.exceptions.InternalServerException

Unexpected error during processing of request.

Example

try:
  ...
except client.exceptions.InternalServerException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'retryAfterSeconds': 123,
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Unexpected error during processing of request.

    • message (string) --

      Description of the error.

    • retryAfterSeconds (integer) --

      Advice to clients on when the call can be safely retried.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class PrometheusService.Client.exceptions.ResourceNotFoundException

Request references a resource which does not exist.

Example

try:
  ...
except client.exceptions.ResourceNotFoundException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'resourceId': 'string',
    'resourceType': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Request references a resource which does not exist.

    • message (string) --

      Description of the error.

    • resourceId (string) --

      Identifier of the resource affected.

    • resourceType (string) --

      Type of the resource affected.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class PrometheusService.Client.exceptions.ServiceQuotaExceededException

Request would cause a service quota to be exceeded.

Example

try:
  ...
except client.exceptions.ServiceQuotaExceededException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'quotaCode': 'string',
    'resourceId': 'string',
    'resourceType': 'string',
    'serviceCode': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Request would cause a service quota to be exceeded.

    • message (string) --

      Description of the error.

    • quotaCode (string) --

      Service Quotas requirement to identify originating quota.

    • resourceId (string) --

      Identifier of the resource affected.

    • resourceType (string) --

      Type of the resource affected.

    • serviceCode (string) --

      Service Quotas requirement to identify originating service.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class PrometheusService.Client.exceptions.ThrottlingException

Request was denied due to request throttling.

Example

try:
  ...
except client.exceptions.ThrottlingException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'quotaCode': 'string',
    'retryAfterSeconds': 123,
    'serviceCode': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Request was denied due to request throttling.

    • message (string) --

      Description of the error.

    • quotaCode (string) --

      Service Quotas requirement to identify originating quota.

    • retryAfterSeconds (integer) --

      Advice to clients on when the call can be safely retried.

    • serviceCode (string) --

      Service Quotas requirement to identify originating service.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class PrometheusService.Client.exceptions.ValidationException

The input fails to satisfy the constraints specified by an AWS service.

Example

try:
  ...
except client.exceptions.ValidationException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'fieldList': [
        {
            'message': 'string',
            'name': 'string'
        },
    ],
    'message': 'string',
    'reason': 'UNKNOWN_OPERATION'|'CANNOT_PARSE'|'FIELD_VALIDATION_FAILED'|'OTHER',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The input fails to satisfy the constraints specified by an AWS service.

    • fieldList (list) --

      The field that caused the error, if applicable. If more than one field caused the error, pick one and elaborate in the message.

      • (dict) --

        Stores information about a field passed inside a request that resulted in an exception.

        • message (string) --

          Message describing why the field failed validation.

        • name (string) --

          The field name.

    • message (string) --

      Description of the error.

    • reason (string) --

      Reason the request failed validation.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.

Paginators

The available paginators are:

class PrometheusService.Paginator.ListRuleGroupsNamespaces
paginator = client.get_paginator('list_rule_groups_namespaces')
paginate(**kwargs)

Creates an iterator that will paginate through responses from PrometheusService.Client.list_rule_groups_namespaces().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    name='string',
    workspaceId='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • name (string) -- Optional filter for rule groups namespace name. Only the rule groups namespace that begin with this value will be returned.
  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace.

  • 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

{
    'ruleGroupsNamespaces': [
        {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'modifiedAt': datetime(2015, 1, 1),
            'name': 'string',
            'status': {
                'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'|'UPDATE_FAILED',
                'statusReason': 'string'
            },
            'tags': {
                'string': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a ListRuleGroupsNamespaces operation.

    • ruleGroupsNamespaces (list) --

      The list of the selected rule groups namespaces.

      • (dict) --

        Represents a summary of the rule groups namespace.

        • arn (string) --

          The Amazon Resource Name (ARN) of this rule groups namespace.

        • createdAt (datetime) --

          The time when the rule groups namespace was created.

        • modifiedAt (datetime) --

          The time when the rule groups namespace was modified.

        • name (string) --

          The rule groups namespace name.

        • status (dict) --

          The status of rule groups namespace.

          • statusCode (string) --

            Status code of this namespace.

          • statusReason (string) --

            The reason for failure if any.

        • tags (dict) --

          The tags of this rule groups namespace.

          • (string) --

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

            • (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

    • NextToken (string) --

      A token to resume pagination.

class PrometheusService.Paginator.ListWorkspaces
paginator = client.get_paginator('list_workspaces')
paginate(**kwargs)

Creates an iterator that will paginate through responses from PrometheusService.Client.list_workspaces().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    alias='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • alias (string) -- Optional filter for workspace alias. Only the workspaces with aliases that begin with this value will be returned.
  • 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

{
    'workspaces': [
        {
            'alias': 'string',
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'status': {
                'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'
            },
            'tags': {
                'string': 'string'
            },
            'workspaceId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the output of a ListWorkspaces operation.

    • workspaces (list) --

      The list of existing workspaces, including those undergoing creation or deletion.

      • (dict) --

        Represents a summary of the properties of a workspace.

        • alias (string) --

          Alias of this workspace.

        • arn (string) --

          The AmazonResourceName of this workspace.

        • createdAt (datetime) --

          The time when the workspace was created.

        • status (dict) --

          The status of this workspace.

          • statusCode (string) --

            Status code of this workspace.

        • tags (dict) --

          The tags of this workspace.

          • (string) --

            The key of the tag.

            Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with aws: .

            • (string) --

              The value of the tag.

              Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

        • workspaceId (string) --

          Unique string identifying this workspace.

    • NextToken (string) --

      A token to resume pagination.

Waiters

The available waiters are:

class PrometheusService.Waiter.WorkspaceActive
waiter = client.get_waiter('workspace_active')
wait(**kwargs)

Polls PrometheusService.Client.describe_workspace() every 2 seconds until a successful state is reached. An error is returned after 60 failed checks.

See also: AWS API Documentation

Request Syntax

waiter.wait(
    workspaceId='string',
    WaiterConfig={
        'Delay': 123,
        'MaxAttempts': 123
    }
)
Parameters
  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace to describe.

  • WaiterConfig (dict) --

    A dictionary that provides parameters to control waiting behavior.

    • Delay (integer) --

      The amount of time in seconds to wait between attempts. Default: 2

    • MaxAttempts (integer) --

      The maximum number of attempts to be made. Default: 60

Returns

None

class PrometheusService.Waiter.WorkspaceDeleted
waiter = client.get_waiter('workspace_deleted')
wait(**kwargs)

Polls PrometheusService.Client.describe_workspace() every 2 seconds until a successful state is reached. An error is returned after 60 failed checks.

See also: AWS API Documentation

Request Syntax

waiter.wait(
    workspaceId='string',
    WaiterConfig={
        'Delay': 123,
        'MaxAttempts': 123
    }
)
Parameters
  • workspaceId (string) --

    [REQUIRED]

    The ID of the workspace to describe.

  • WaiterConfig (dict) --

    A dictionary that provides parameters to control waiting behavior.

    • Delay (integer) --

      The amount of time in seconds to wait between attempts. Default: 2

    • MaxAttempts (integer) --

      The maximum number of attempts to be made. Default: 60

Returns

None