Skip to content

list_operations

list_operations(
    *,
    config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    filters: Optional[OperationFilters] = None,
) -> ListOperationsResponse

Lists operations that match the criteria that you specify.

Parameters:

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

    For the first ListOperations request, omit this value.

    If the response contains NextToken, submit another ListOperations request to get the next group of results. Specify the value of NextToken from the previous response in the next request.

    Cloud Map gets MaxResults operations and then filters them based on the specified criteria. It's possible that no operations in the first MaxResults operations matched the specified criteria but that subsequent groups of MaxResults operations do contain operations that match the criteria.

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

    The maximum number of items that you want Cloud Map to return in the response to a ListOperations request. If you don't specify a value for MaxResults, Cloud Map returns up to 100 operations.

  • filters (Optional[OperationFilters], default: None ) –

    A complex type that contains specifications for the operations that you want to list, for example, operations that you started between a specified start date and end date.

    If you specify more than one filter, an operation must match all filters to be returned by ListOperations.

Raises:

  • InvalidInput –

    One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.

  • UnknownServiceError –

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

Examples:

ListOperations Example This example gets the operations that have a STATUS of either PENDING or SUCCESS.

>>> client.list_operations(filters=[{'Name': 'STATUS', 'Condition': 'IN', 'Values': ['PENDING', 'SUCCESS']}])
Source code in docs_src/capo_servicediscovery/_services/service_discovery.py
def list_operations(
    self,
    *,
    config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
    next_token: Optional["capo_servicediscovery.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_servicediscovery.types.max_results.MaxResults"
    ] = None,
    filters: Optional[
        "capo_servicediscovery.types.operation_filters.OperationFilters"
    ] = None,
) -> "capo_servicediscovery.types.list_operations_response.ListOperationsResponse":
    """<p>Lists operations that match the criteria that you specify.</p>

    Args:
        next_token: <p>For the first <code>ListOperations</code> request, omit this value.</p> <p>If the response contains <code>NextToken</code>, submit another <code>ListOperations</code> request to get the next group of results. Specify the value of <code>NextToken</code> from the previous response in the next request.</p> <note> <p>Cloud Map gets <code>MaxResults</code> operations and then filters them based on the specified criteria. It's possible that no operations in the first <code>MaxResults</code> operations matched the specified criteria but that subsequent groups of <code>MaxResults</code> operations do contain operations that match the criteria.</p> </note>
        max_results: <p>The maximum number of items that you want Cloud Map to return in the response to a <code>ListOperations</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 operations.</p>
        filters: <p>A complex type that contains specifications for the operations that you want to list, for example, operations that you started between a specified start date and end date.</p> <p>If you specify more than one filter, an operation must match all filters to be returned by <code>ListOperations</code>.</p>

    Raises:
        capo_servicediscovery.errors.invalid_input.InvalidInput: <p>One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.</p>
        capo_servicediscovery.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        ListOperations Example
        This example gets the operations that have a STATUS of either PENDING or SUCCESS.

        >>> client.list_operations(filters=[{'Name': 'STATUS', 'Condition': 'IN', 'Values': ['PENDING', 'SUCCESS']}])
    """

    def _handler(
        req: "OperationRequest[capo_servicediscovery.types.list_operations_request.ListOperationsRequest]",
    ) -> OperationResponse[
        "capo_servicediscovery.types.list_operations_response.ListOperationsResponse"
    ]:
        import capo_servicediscovery._operations.route53_auto_naming_v20170314.list_operations

        output, http_response = (
            capo_servicediscovery._operations.route53_auto_naming_v20170314.list_operations.list_operations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListOperations")
    )
    input_: capo_servicediscovery.types.list_operations_request.ListOperationsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if filters is not None:
        input_["filters"] = filters

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