PrometheusService

Table of Contents

Client

class PrometheusService.Client

A low-level client representing Amazon Prometheus Service

Amazon Managed Service for Prometheus

import boto3

client = boto3.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_workspace(**kwargs)

Creates a new AMP workspace.

See also: AWS API Documentation

Request Syntax

response = client.create_workspace(
    alias='string',
    clientToken='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.

Return type

dict

Returns

Response Syntax

{
    'arn': 'string',
    'status': {
        'statusCode': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATION_FAILED'
    },
    '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.

    • workspaceId (string) --

      The generated ID of the workspace that was just created.

Exceptions

  • PrometheusService.Client.exceptions.ThrottlingException
  • PrometheusService.Client.exceptions.ConflictException
  • PrometheusService.Client.exceptions.ValidationException
  • PrometheusService.Client.exceptions.AccessDeniedException
  • PrometheusService.Client.exceptions.InternalServerException
  • PrometheusService.Client.exceptions.ServiceQuotaExceededException
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

  • PrometheusService.Client.exceptions.ThrottlingException
  • PrometheusService.Client.exceptions.ValidationException
  • PrometheusService.Client.exceptions.ResourceNotFoundException
  • PrometheusService.Client.exceptions.AccessDeniedException
  • PrometheusService.Client.exceptions.InternalServerException
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'
        },
        '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.

      • workspaceId (string) --

        Unique string identifying this workspace.

Exceptions

  • PrometheusService.Client.exceptions.ThrottlingException
  • PrometheusService.Client.exceptions.ValidationException
  • PrometheusService.Client.exceptions.ResourceNotFoundException
  • PrometheusService.Client.exceptions.AccessDeniedException
  • PrometheusService.Client.exceptions.InternalServerException
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_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'
            },
            '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.

        • workspaceId (string) --

          Unique string identifying this workspace.

Exceptions

  • PrometheusService.Client.exceptions.ThrottlingException
  • PrometheusService.Client.exceptions.ValidationException
  • PrometheusService.Client.exceptions.AccessDeniedException
  • PrometheusService.Client.exceptions.InternalServerException
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

  • PrometheusService.Client.exceptions.ThrottlingException
  • PrometheusService.Client.exceptions.ConflictException
  • PrometheusService.Client.exceptions.ValidationException
  • PrometheusService.Client.exceptions.ResourceNotFoundException
  • PrometheusService.Client.exceptions.AccessDeniedException
  • PrometheusService.Client.exceptions.InternalServerException
  • PrometheusService.Client.exceptions.ServiceQuotaExceededException

Paginators

The available paginators are:

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'
            },
            '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.

        • workspaceId (string) --

          Unique string identifying this workspace.

    • NextToken (string) --

      A token to resume pagination.