Skip to content

list_gateway_instances async

list_gateway_instances(
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    filter_arn: Optional[str] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[str] = None,
) -> ListGatewayInstancesResponse

Displays a list of instances associated with the Amazon Web Services account. This request returns a paginated result. You can use the filterArn property to display only the instances associated with the selected Gateway Amazon Resource Name (ARN).

Parameters:

  • filter_arn (Optional[str], default: None ) –

    Filter the list results to display only the instances associated with the selected Gateway ARN.

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

    The maximum number of results to return per API request.

    For example, you submit a ListInstances request with MaxResults set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a NextToken value that you can use to fetch the next batch of results.)

    The service might return fewer results than the MaxResults value. If MaxResults is not included in the request, the service defaults to pagination with a maximum of 10 results per page.

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

    The token that identifies the batch of results that you want to see.

    For example, you submit a ListInstances request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a NextToken value. To see the next batch of results, you can submit the ListInstances request a second time and specify the NextToken value.

Raises:

  • BadRequestException –

    This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

  • InternalServerErrorException –

    The server encountered an internal error and is unable to complete the request.

  • ServiceUnavailableException –

    The service is currently unavailable or busy.

  • TooManyRequestsException –

    The request was denied due to request throttling.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mediaconnect/_services/async_media_connect.py
async def list_gateway_instances(
    self,
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    filter_arn: Optional[str] = None,
    max_results: Optional["capo_mediaconnect.types.max_results.MaxResults"] = None,
    next_token: Optional[str] = None,
) -> "capo_mediaconnect.types.list_gateway_instances_response.ListGatewayInstancesResponse":
    """<p> Displays a list of instances associated with the Amazon Web Services account. This request returns a paginated result. You can use the filterArn property to display only the instances associated with the selected Gateway Amazon Resource Name (ARN).</p>

    Args:
        filter_arn: <p> Filter the list results to display only the instances associated with the selected Gateway ARN.</p>
        max_results: <p> The maximum number of results to return per API request. </p> <p>For example, you submit a ListInstances request with <code>MaxResults</code> set at 5. Although 20 items match your request, the service returns no more than the first 5 items. (The service also returns a <code>NextToken</code> value that you can use to fetch the next batch of results.) </p> <p>The service might return fewer results than the <code>MaxResults</code> value. If <code>MaxResults</code> is not included in the request, the service defaults to pagination with a maximum of 10 results per page.</p>
        next_token: <p> The token that identifies the batch of results that you want to see. </p> <p>For example, you submit a <code>ListInstances</code> request with <code>MaxResults</code> set at 5. The service returns the first batch of results (up to 5) and a <code>NextToken</code> value. To see the next batch of results, you can submit the <code>ListInstances</code> request a second time and specify the <code>NextToken</code> value.</p>

    Raises:
        capo_mediaconnect.errors.bad_request_exception.BadRequestException: <p>This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message. </p>
        capo_mediaconnect.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
        capo_mediaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>The server encountered an internal error and is unable to complete the request. </p>
        capo_mediaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable or busy. </p>
        capo_mediaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was denied due to request throttling. </p>
        capo_mediaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediaconnect.types.list_gateway_instances_request.ListGatewayInstancesRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediaconnect.types.list_gateway_instances_response.ListGatewayInstancesResponse"
    ]:
        import capo_mediaconnect._operations.media_connect.list_gateway_instances

        (
            output,
            http_response,
        ) = await capo_mediaconnect._operations.media_connect.list_gateway_instances.async_list_gateway_instances(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListGatewayInstances")
    )
    input_: capo_mediaconnect.types.list_gateway_instances_request.ListGatewayInstancesRequest = {}
    if filter_arn is not None:
        input_["filter_arn"] = filter_arn
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output