Skip to content

list_virtual_services

list_virtual_services(
    mesh_name: ResourceName,
    *,
    config_overrides: Optional[AppMeshClientConfig] = None,
    next_token: Optional[str] = None,
    limit: Optional[ListVirtualServicesLimit] = None,
    mesh_owner: Optional[AccountId] = None,
) -> ListVirtualServicesOutput

Returns a list of existing virtual services in a service mesh.

Parameters:

  • mesh_name (ResourceName) –

    The name of the service mesh to list virtual services in.

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

    The nextToken value returned from a previous paginated ListVirtualServices request where limit was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value.

  • limit (Optional[ListVirtualServicesLimit], default: None ) –

    The maximum number of results returned by ListVirtualServices in paginated output. When you use this parameter, ListVirtualServices returns only limit results in a single page along with a nextToken response element. You can see the remaining results of the initial request by sending another ListVirtualServices request with the returned nextToken value. This value can be between 1 and 100. If you don't use this parameter, ListVirtualServices returns up to 100 results and a nextToken value if applicable.

  • mesh_owner (Optional[AccountId], default: None ) –

    The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with shared meshes.

Raises:

  • BadRequestException –

    The request syntax was malformed. Check your request syntax and try again.

  • ForbiddenException –

    You don't have permissions to perform this action.

  • InternalServerErrorException –

    The request processing has failed because of an unknown error, exception, or failure.

  • NotFoundException –

    The specified resource doesn't exist. Check your request syntax and try again.

  • ServiceUnavailableException –

    The request has failed due to a temporary failure of the service.

  • TooManyRequestsException –

    The maximum request rate permitted by the App Mesh APIs has been exceeded for your account. For best results, use an increasing or variable sleep interval between requests.

  • UnknownServiceError –

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

Source code in docs_src/capo_app_mesh/_services/app_mesh.py
def list_virtual_services(
    self,
    mesh_name: "capo_app_mesh.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AppMeshClientConfig] = None,
    next_token: Optional[str] = None,
    limit: Optional[
        "capo_app_mesh.types.list_virtual_services_limit.ListVirtualServicesLimit"
    ] = None,
    mesh_owner: Optional["capo_app_mesh.types.account_id.AccountId"] = None,
) -> "capo_app_mesh.types.list_virtual_services_output.ListVirtualServicesOutput":
    """<p>Returns a list of existing virtual services in a service mesh.</p>

    Args:
        mesh_name: <p>The name of the service mesh to list virtual services in.</p>
        next_token: <p>The <code>nextToken</code> value returned from a previous paginated <code>ListVirtualServices</code> request where <code>limit</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value.</p>
        limit: <p>The maximum number of results returned by <code>ListVirtualServices</code> in paginated output. When you use this parameter, <code>ListVirtualServices</code> returns only <code>limit</code> results in a single page along with a <code>nextToken</code> response element. You can see the remaining results of the initial request by sending another <code>ListVirtualServices</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If you don't use this parameter, <code>ListVirtualServices</code> returns up to 100 results and a <code>nextToken</code> value if applicable.</p>
        mesh_owner: <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>

    Raises:
        capo_app_mesh.errors.bad_request_exception.BadRequestException: <p>The request syntax was malformed. Check your request syntax and try again.</p>
        capo_app_mesh.errors.forbidden_exception.ForbiddenException: <p>You don't have permissions to perform this action.</p>
        capo_app_mesh.errors.internal_server_error_exception.InternalServerErrorException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_app_mesh.errors.not_found_exception.NotFoundException: <p>The specified resource doesn't exist. Check your request syntax and try again.</p>
        capo_app_mesh.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed due to a temporary failure of the service.</p>
        capo_app_mesh.errors.too_many_requests_exception.TooManyRequestsException: <p>The maximum request rate permitted by the App Mesh APIs has been exceeded for your account. For best results, use an increasing or variable sleep interval between requests.</p>
        capo_app_mesh.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_app_mesh.types.list_virtual_services_input.ListVirtualServicesInput]",
    ) -> OperationResponse[
        "capo_app_mesh.types.list_virtual_services_output.ListVirtualServicesOutput"
    ]:
        import capo_app_mesh._operations.app_mesh.list_virtual_services

        output, http_response = (
            capo_app_mesh._operations.app_mesh.list_virtual_services.list_virtual_services(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListVirtualServices")
    )
    input_: capo_app_mesh.types.list_virtual_services_input.ListVirtualServicesInput = {
        "mesh_name": mesh_name
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit
    if mesh_owner is not None:
        input_["mesh_owner"] = mesh_owner

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