CloudWatchOmni / Client / create_view

create_view

CloudWatchOmni.Client.create_view(**kwargs)

Creates a new SQL view.

A view is a named, reusable SQL query that can be referenced from telemetry queries. View names must be unique within the account and region. Only USER views can be created — MANAGED views are provisioned by AWS.

See also: AWS API Documentation

Request Syntax

response = client.create_view(
    name='string',
    definition='string',
    description='string',
    tags={
        'string': 'string'
    },
    clientToken='string'
)
Parameters:
  • name (string) –

    [REQUIRED]

    The name of the view. Must begin with the “view.” prefix. View names must be unique within the account and region.

  • definition (string) –

    [REQUIRED]

    The SQL query that defines the view.

  • description (string) – A description of the view.

  • tags (dict) –

    Resource tags.

    • (string) –

      Tag key. Must be non-empty; AWS-standard maximum length. Constraining the key (rather than a bare String) rejects empty-key payloads at the edge with a 400 ValidationException instead of faulting downstream as a 500.

      • (string) –

        Tag value. AWS-standard maximum length; may be empty.

  • clientToken (string) –

    Idempotency token for safe retries. Retrying with the same token returns the original view instead of creating a duplicate.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'name': 'string',
    'type': 'USER'|'MANAGED',
    'description': 'string',
    'definition': 'string',
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1),
    'arn': 'string'
}

Response Structure

  • (dict) –

    • name (string) –

      The name of the view.

    • type (string) –

      The ownership category of the view.

    • description (string) –

      The description of the view.

    • definition (string) –

      The SQL query that defines the view.

    • createdAt (datetime) –

      The timestamp when the view was created.

    • updatedAt (datetime) –

      The timestamp when the view was last updated.

    • arn (string) –

      The ARN of the view.

Exceptions