Skip to content

list_instances

list_instances(
    *,
    config_overrides: Optional[SupplyChainClientConfig] = None,
    next_token: Optional[InstanceNextToken] = None,
    max_results: Optional[InstanceMaxResults] = None,
    instance_name_filter: Optional[InstanceNameList] = None,
    instance_state_filter: Optional[InstanceStateList] = None,
) -> ListInstancesResponse

List all Amazon Web Services Supply Chain instances for a specific account. Enables you to programmatically list all Amazon Web Services Supply Chain instances based on their account ID, instance name, and state of the instance (active or delete).

Parameters:

  • next_token (Optional[InstanceNextToken], default: None ) –

    The pagination token to fetch the next page of instances.

  • max_results (Optional[InstanceMaxResults], default: None ) –

    Specify the maximum number of instances to fetch in this paginated request.

  • instance_name_filter (Optional[InstanceNameList], default: None ) –

    The filter to ListInstances based on their names.

  • instance_state_filter (Optional[InstanceStateList], default: None ) –

    The filter to ListInstances based on their state.

Raises:

Examples:

Successful ListInstance request with no input data

>>> client.list_instances()
Successful ListInstance request with filters
>>> client.list_instances(instance_name_filter=['example instance name'], instance_state_filter=['Active'])
Successful ListInstance request with maxResult override
>>> client.list_instances(max_results=1)
Successful ListInstance request with nextToken
>>> client.list_instances(next_token='AAQA-EFRSURBSGhtcng0c0dxbENwUHdnckVIbkFYNU1QVjRTZWN2ak5iMFVicC8zemlHOVF3SEpjSC9WTWJVVXBMV2Z1N3ZvZlQ0WEFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTTJibW9LemgrSWZTY0RaZEdBZ0VRZ0R2dDhsQnVGbGJ0dnFTZityWmNSWEVPbG93emJoSjhxOGNMbGQ1UGMvY0VRbWlTR3pQUFd4N2RraXY5Y0ovcS9vSmFYZVBGdWVHaU0zWmd0dz09n-rC1ejA5--7ltJxpDT2xP_i8xGqDPMOZfjpp8q6l5NuP9_bnBURvwwYhdqDriMK5_f96LuPEnPbuML-ItfgEiCcUy0p2tApvpZkZqOG5fbqP-4C5aDYPTffHLyq-MMqvfrGVJzL1nvkpZcnTkVR9VJsu5b8I0qqDW0H8EMKGgTo78U9lr4sj3Usi9VMwZxgKCBmr03HhFLYXOW--XMbIx0CTZF0fYIcRxmA_sVS6J7gpaB9yMcnzs5VUKokoA5JTcAPY5d1Y1VyE8KKxv51cfPgXw8OYCDbFQncw8mZPmE-VqxjFbksmk_FmghpPn9j2Ppoe-zr0LQ%3D', max_results=1)
Source code in docs_src/capo_supplychain/_services/supply_chain.py
def list_instances(
    self,
    *,
    config_overrides: Optional[SupplyChainClientConfig] = None,
    next_token: Optional[
        "capo_supplychain.types.instance_next_token.InstanceNextToken"
    ] = None,
    max_results: Optional[
        "capo_supplychain.types.instance_max_results.InstanceMaxResults"
    ] = None,
    instance_name_filter: Optional[
        "capo_supplychain.types.instance_name_list.InstanceNameList"
    ] = None,
    instance_state_filter: Optional[
        "capo_supplychain.types.instance_state_list.InstanceStateList"
    ] = None,
) -> "capo_supplychain.types.list_instances_response.ListInstancesResponse":
    """<p>List all Amazon Web Services Supply Chain instances for a specific account. Enables you to programmatically list all Amazon Web Services Supply Chain instances based on their account ID, instance name, and state of the instance (active or delete).</p>

    Args:
        next_token: <p>The pagination token to fetch the next page of instances.</p>
        max_results: <p>Specify the maximum number of instances to fetch in this paginated request.</p>
        instance_name_filter: <p>The filter to ListInstances based on their names.</p>
        instance_state_filter: <p>The filter to ListInstances based on their state.</p>

    Raises:
        capo_supplychain.errors.access_denied_exception.AccessDeniedException: <p>You do not have the required privileges to perform this action.</p>
        capo_supplychain.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_supplychain.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_supplychain.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_supplychain.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_supplychain.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_supplychain.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an AWS service.</p>
        capo_supplychain.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Successful ListInstance request with no input data

        >>> client.list_instances()
        Successful ListInstance request with filters

        >>> client.list_instances(instance_name_filter=['example instance name'], instance_state_filter=['Active'])
        Successful ListInstance request with maxResult override

        >>> client.list_instances(max_results=1)
        Successful ListInstance request with nextToken

        >>> client.list_instances(next_token='AAQA-EFRSURBSGhtcng0c0dxbENwUHdnckVIbkFYNU1QVjRTZWN2ak5iMFVicC8zemlHOVF3SEpjSC9WTWJVVXBMV2Z1N3ZvZlQ0WEFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTTJibW9LemgrSWZTY0RaZEdBZ0VRZ0R2dDhsQnVGbGJ0dnFTZityWmNSWEVPbG93emJoSjhxOGNMbGQ1UGMvY0VRbWlTR3pQUFd4N2RraXY5Y0ovcS9vSmFYZVBGdWVHaU0zWmd0dz09n-rC1ejA5--7ltJxpDT2xP_i8xGqDPMOZfjpp8q6l5NuP9_bnBURvwwYhdqDriMK5_f96LuPEnPbuML-ItfgEiCcUy0p2tApvpZkZqOG5fbqP-4C5aDYPTffHLyq-MMqvfrGVJzL1nvkpZcnTkVR9VJsu5b8I0qqDW0H8EMKGgTo78U9lr4sj3Usi9VMwZxgKCBmr03HhFLYXOW--XMbIx0CTZF0fYIcRxmA_sVS6J7gpaB9yMcnzs5VUKokoA5JTcAPY5d1Y1VyE8KKxv51cfPgXw8OYCDbFQncw8mZPmE-VqxjFbksmk_FmghpPn9j2Ppoe-zr0LQ%3D', max_results=1)
    """

    def _handler(
        req: "OperationRequest[capo_supplychain.types.list_instances_request.ListInstancesRequest]",
    ) -> OperationResponse[
        "capo_supplychain.types.list_instances_response.ListInstancesResponse"
    ]:
        import capo_supplychain._operations.galaxy_public_api_gateway.list_instances

        output, http_response = (
            capo_supplychain._operations.galaxy_public_api_gateway.list_instances.list_instances(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListInstances")
    )
    input_: capo_supplychain.types.list_instances_request.ListInstancesRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if instance_name_filter is not None:
        input_["instance_name_filter"] = instance_name_filter
    if instance_state_filter is not None:
        input_["instance_state_filter"] = instance_state_filter

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output