CloudWatchObservabilityAdminService / Client / list_resources_by_connector

list_resources_by_connector

CloudWatchObservabilityAdminService.Client.list_resources_by_connector(**kwargs)

Lists resources in your cloud provider that the connector can access, such as management groups, subscriptions, resource types, Regions, resources, and Event Hubs. Use the results to build a telemetry manifest. This operation returns results in pages. To get the next page, pass the returned NextToken in the next call. We recommend that you use pagination to ensure that the operation returns quickly and successfully.

See also: AWS API Documentation

Request Syntax

response = client.list_resources_by_connector(
    ConnectorIdentifier='string',
    Selector={
        'Azure': {
            'ManagementGroups': {
                'ParentManagementGroupId': 'string'
            },
            'Subscriptions': {
                'ManagementGroupId': 'string'
            },
            'ResourceTypes': {
                'Scope': {
                    'ManagementGroupId': 'string',
                    'SubscriptionIds': [
                        'string',
                    ]
                }
            },
            'Regions': {
                'Scope': {
                    'ManagementGroupId': 'string',
                    'SubscriptionIds': [
                        'string',
                    ]
                }
            },
            'ResourceIds': {
                'Scope': {
                    'ManagementGroupId': 'string',
                    'SubscriptionIds': [
                        'string',
                    ]
                },
                'ResourceType': 'string',
                'Region': 'string',
                'TagFilters': [
                    {
                        'Key': 'string',
                        'Values': [
                            'string',
                        ]
                    },
                ]
            },
            'EventHubs': {
                'Scope': {
                    'ManagementGroupId': 'string',
                    'SubscriptionIds': [
                        'string',
                    ]
                },
                'NamespaceName': 'string',
                'Region': 'string'
            }
        }
    },
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • ConnectorIdentifier (string) –

    [REQUIRED]

    The connector to use for the query. Specify one of the following:

    • The Amazon Resource Name (ARN) of the connector

    • The ID of the connector

  • Selector (dict) –

    [REQUIRED]

    What to list: one cloud provider, and one type of resource in that provider.

    Note

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

    • Azure (dict) –

      The type of Azure resource to list.

      Note

      This is a Tagged Union structure. Only one of the following top level keys can be set: ManagementGroups, Subscriptions, ResourceTypes, Regions, ResourceIds, EventHubs.

      • ManagementGroups (dict) –

        Lists Azure management groups.

        • ParentManagementGroupId (string) –

          Lists the management groups under this management group. If you omit this value, the query starts at the tenant root group.

      • Subscriptions (dict) –

        Lists Azure subscriptions.

        • ManagementGroupId (string) –

          Limits the results to subscriptions under this management group.

      • ResourceTypes (dict) –

        Lists the Azure resource types that have resources in scope.

        • Scope (dict) –

          Limits the query to a management group or to specific subscriptions.

          • ManagementGroupId (string) –

            Limits the query to resources under this management group.

          • SubscriptionIds (list) –

            Limits the query to these subscriptions. You can specify 1–1000 subscriptions.

            • (string) –

      • Regions (dict) –

        Lists the Azure Regions that have resources in scope.

        • Scope (dict) –

          Limits the query to a management group or to specific subscriptions.

          • ManagementGroupId (string) –

            Limits the query to resources under this management group.

          • SubscriptionIds (list) –

            Limits the query to these subscriptions. You can specify 1–1000 subscriptions.

            • (string) –

      • ResourceIds (dict) –

        Lists Azure resources.

        • Scope (dict) –

          Limits the query to a management group or to specific subscriptions.

          • ManagementGroupId (string) –

            Limits the query to resources under this management group.

          • SubscriptionIds (list) –

            Limits the query to these subscriptions. You can specify 1–1000 subscriptions.

            • (string) –

        • ResourceType (string) –

          Limits the results to one Azure resource type, for example Microsoft.Compute/virtualMachines.

        • Region (string) –

          Limits the results to one Azure Region, for example eastus.

        • TagFilters (list) –

          Limits the results to resources that have these tags. A resource must match the filters for all tag keys, and any of the values for each key. The service matches tag keys and values case-insensitively, as Azure does.

          • (dict) –

            A tag filter. A resource matches only if it has the tag. Filters for different tag keys must all match; for one tag key, any of the values can match.

            • Key (string) – [REQUIRED]

              The tag key. Up to 512 characters. The characters < > % & ? / $ { } ‘ “ ` and control characters aren’t allowed.

            • Values (list) – [REQUIRED]

              The tag values to match. A resource matches if it has any of these values for the tag key.

              • (string) –

      • EventHubs (dict) –

        Lists Azure Event Hubs.

        • Scope (dict) –

          Limits the query to a management group or to specific subscriptions.

          • ManagementGroupId (string) –

            Limits the query to resources under this management group.

          • SubscriptionIds (list) –

            Limits the query to these subscriptions. You can specify 1–1000 subscriptions.

            • (string) –

        • NamespaceName (string) –

          Limits the results to Event Hubs in this namespace.

        • Region (string) –

          Limits the results to one Azure Region, for example eastus.

  • MaxResults (integer) – The maximum number of results to return in one call. For an EventHubs query, a page can contain more results than this value.

  • NextToken (string) – The token for the next page of results, returned by a previous call.

Return type:

dict

Returns:

Response Syntax

{
    'Results': {
        'Azure': {
            'ManagementGroups': [
                {
                    'Id': 'string',
                    'Name': 'string',
                    'DisplayName': 'string'
                },
            ],
            'Subscriptions': [
                {
                    'SubscriptionId': 'string',
                    'DisplayName': 'string',
                    'State': 'string',
                    'ManagementGroupId': 'string'
                },
            ],
            'ResourceTypes': [
                'string',
            ],
            'Regions': [
                'string',
            ],
            'ResourceIds': [
                {
                    'ResourceId': 'string',
                    'ResourceType': 'string',
                    'Region': 'string',
                    'SubscriptionId': 'string',
                    'Tags': {
                        'string': 'string'
                    }
                },
            ],
            'EventHubs': [
                {
                    'ResourceId': 'string',
                    'EventHubName': 'string',
                    'NamespaceName': 'string',
                    'FullyQualifiedNamespace': 'string',
                    'Region': 'string',
                    'SubscriptionId': 'string'
                },
            ]
        }
    },
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Results (dict) –

      The results, in the same shape as the Selector that you specified.

      Note

      This is a Tagged Union structure. Only one of the following top level keys will be set: Azure. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

      'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
      
      • Azure (dict) –

        The results of an Azure discovery query.

        Note

        This is a Tagged Union structure. Only one of the following top level keys will be set: ManagementGroups, Subscriptions, ResourceTypes, Regions, ResourceIds, EventHubs. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
        
        • ManagementGroups (list) –

          The Azure management groups.

          • (dict) –

            Information about an Azure management group.

            • Id (string) –

              The ID of the management group.

            • Name (string) –

              The name of the management group.

            • DisplayName (string) –

              The display name of the management group.

        • Subscriptions (list) –

          The Azure subscriptions.

          • (dict) –

            Information about an Azure subscription.

            • SubscriptionId (string) –

              The ID of the subscription.

            • DisplayName (string) –

              The display name of the subscription.

            • State (string) –

              The state of the subscription in Azure, for example Enabled.

            • ManagementGroupId (string) –

              The ID of the management group that contains the subscription.

        • ResourceTypes (list) –

          The Azure resource types.

          • (string) –

        • Regions (list) –

          The Azure Regions.

          • (string) –

        • ResourceIds (list) –

          The Azure resources.

          • (dict) –

            Information about an Azure resource.

            • ResourceId (string) –

              The Azure Resource Manager ID of the resource.

            • ResourceType (string) –

              The Azure resource type, for example Microsoft.Compute/virtualMachines.

            • Region (string) –

              The Azure Region of the resource, for example eastus.

            • SubscriptionId (string) –

              The Azure subscription that contains the resource.

            • Tags (dict) –

              The tags on the resource. Absent if the resource has no tags.

              • (string) –

                • (string) –

        • EventHubs (list) –

          The Azure Event Hubs.

          • (dict) –

            Information about an Azure Event Hub.

            • ResourceId (string) –

              The Azure Resource Manager ID of the Event Hub.

            • EventHubName (string) –

              The name of the Event Hub.

            • NamespaceName (string) –

              The name of the Event Hubs namespace that contains the Event Hub.

            • FullyQualifiedNamespace (string) –

              The fully qualified host name of the Event Hubs namespace, for example <namespace>.servicebus.windows.net. The suffix differs in sovereign clouds.

            • Region (string) –

              The Azure Region of the Event Hub, for example eastus.

            • SubscriptionId (string) –

              The Azure subscription that contains the Event Hub.

    • NextToken (string) –

      The token to use in the next call to get the next page of results. Absent when there are no more results.

Exceptions

  • CloudWatchObservabilityAdminService.Client.exceptions.ResourceNotFoundException

  • CloudWatchObservabilityAdminService.Client.exceptions.AccessDeniedException

  • CloudWatchObservabilityAdminService.Client.exceptions.InternalServerException

  • CloudWatchObservabilityAdminService.Client.exceptions.ValidationException

  • CloudWatchObservabilityAdminService.Client.exceptions.TooManyRequestsException