NetworkFlowMonitor / Client / create_scope

create_scope#

NetworkFlowMonitor.Client.create_scope(**kwargs)#

Create a scope of resources that you want to be available for Network Flow Monitor to generate metrics for, when you have active agents on those resources sending metrics reports to the Network Flow Monitor backend. This call returns a scope ID to identify the scope.

When you create a scope, you enable permissions for Network Flow Monitor. The scope is set to the resources for the Amazon Web Services that enables the feature.

See also: AWS API Documentation

Request Syntax

response = client.create_scope(
    targets=[
        {
            'targetIdentifier': {
                'targetId': {
                    'accountId': 'string'
                },
                'targetType': 'ACCOUNT'
            },
            'region': 'string'
        },
    ],
    clientToken='string',
    tags={
        'string': 'string'
    }
)
Parameters:
  • targets (list) –

    [REQUIRED]

    The targets to define the scope to be monitored. Currently, a target is an Amazon Web Services account.

    • (dict) –

      A target resource in a scope. The resource is identified by a Region and a target identifier, which includes a target ID and a target type.

      • targetIdentifier (dict) – [REQUIRED]

        A target identifier is a pair of identifying information for a resource that is included in a target. A target identifier includes the target ID and the target type.

        • targetId (dict) – [REQUIRED]

          The identifier for a target.

          Note

          This is a Tagged Union structure. Only one of the following top level keys can be set: accountId.

          • accountId (string) –

            The identifier for the account for a target.

        • targetType (string) – [REQUIRED]

          The type of a target. A target type is currently always ACCOUNT because a target is currently a single Amazon Web Services account.

      • region (string) – [REQUIRED]

        The Amazon Web Services Region where the target resource is located.

  • clientToken (string) –

    A unique, case-sensitive string of up to 64 ASCII characters that you specify to make an idempotent API request. Don’t reuse the same client token for other API requests.

    This field is autopopulated if not provided.

  • tags (dict) –

    The tags for a scope. You can add a maximum of 200 tags.

    • (string) –

      • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'scopeId': 'string',
    'status': 'SUCCEEDED'|'IN_PROGRESS'|'FAILED',
    'scopeArn': 'string',
    'tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • scopeId (string) –

      The identifier for the scope that includes the resources you want to get metrics for. A scope ID is an internally-generated identifier that includes all the resources for a specific root account.

    • status (string) –

      The status for a call to create a scope. The status can be one of the following: SUCCEEDED, IN_PROGRESS, or FAILED.

    • scopeArn (string) –

      The Amazon Resource Name (ARN) of the scope.

    • tags (dict) –

      The tags for a scope.

      • (string) –

        • (string) –

Exceptions