Skip to content

list_services

list_services(
    *,
    config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    filters: Optional[ServiceFilters] = None,
) -> ListServicesResponse

Lists summary information for all the services that are associated with one or more namespaces.

Parameters:

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

    For the first ListServices request, omit this value.

    If the response contains NextToken, submit another ListServices 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 services and then filters them based on the specified criteria. It's possible that no services in the first MaxResults services matched the specified criteria but that subsequent groups of MaxResults services do contain services that match the criteria.

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

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

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

    A complex type that contains specifications for the namespaces that you want to list services for.

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

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:

Example: List services Example: List services

>>> client.list_services()
Source code in docs_src/capo_servicediscovery/_services/service_discovery.py
def list_services(
    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.service_filters.ServiceFilters"
    ] = None,
) -> "capo_servicediscovery.types.list_services_response.ListServicesResponse":
    """<p>Lists summary information for all the services that are associated with one or more namespaces.</p>

    Args:
        next_token: <p>For the first <code>ListServices</code> request, omit this value.</p> <p>If the response contains <code>NextToken</code>, submit another <code>ListServices</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> services and then filters them based on the specified criteria. It's possible that no services in the first <code>MaxResults</code> services matched the specified criteria but that subsequent groups of <code>MaxResults</code> services do contain services that match the criteria.</p> </note>
        max_results: <p>The maximum number of services that you want Cloud Map to return in the response to a <code>ListServices</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 services.</p>
        filters: <p>A complex type that contains specifications for the namespaces that you want to list services for. </p> <p>If you specify more than one filter, an operation must match all filters to be returned by <code>ListServices</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:
        Example: List services
        Example: List services

        >>> client.list_services()
    """

    def _handler(
        req: "OperationRequest[capo_servicediscovery.types.list_services_request.ListServicesRequest]",
    ) -> OperationResponse[
        "capo_servicediscovery.types.list_services_response.ListServicesResponse"
    ]:
        import capo_servicediscovery._operations.route53_auto_naming_v20170314.list_services

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListServices")
    )
    input_: capo_servicediscovery.types.list_services_request.ListServicesRequest = {}
    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