Skip to content

get_operation async

get_operation(
    operation_id: OperationId,
    *,
    config_overrides: Optional[AsyncServiceDiscoveryClientConfig] = None,
    owner_account: Optional[AWSAccountId] = None,
) -> GetOperationResponse

Gets information about any operation that returns an operation ID in the response, such as a CreateHttpNamespace request.

To get a list of operations that match specified criteria, see ListOperations.

Parameters:

  • operation_id (OperationId) –

    The ID of the operation that you want to get more information about.

  • owner_account (Optional[AWSAccountId], default: None ) –

    The ID of the Amazon Web Services account that owns the namespace associated with the operation, as specified in the namespace ResourceOwner field. For operations associated with namespaces that are shared with your account, you must specify an OwnerAccount.

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.

  • OperationNotFound –

    No operation exists with the specified ID.

  • UnknownServiceError –

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

Examples:

Example: Get operation result Example: Get operation result

>>> await client.get_operation(operation_id='gv4g5meo7ndmeh4fqskygvk23d2fijwa-k9302yzd')
Source code in docs_src/capo_servicediscovery/_services/async_service_discovery.py
async def get_operation(
    self,
    operation_id: "capo_servicediscovery.types.operation_id.OperationId",
    *,
    config_overrides: Optional[AsyncServiceDiscoveryClientConfig] = None,
    owner_account: Optional[
        "capo_servicediscovery.types.aws_account_id.AWSAccountId"
    ] = None,
) -> "capo_servicediscovery.types.get_operation_response.GetOperationResponse":
    """<p>Gets information about any operation that returns an operation ID in the response, such as a <code>CreateHttpNamespace</code> request.</p> <note> <p>To get a list of operations that match specified criteria, see <a href="https://docs.aws.amazon.com/cloud-map/latest/api/API_ListOperations.html">ListOperations</a>.</p> </note>

    Args:
        operation_id: <p>The ID of the operation that you want to get more information about.</p>
        owner_account: <p>The ID of the Amazon Web Services account that owns the namespace associated with the operation, as specified in the namespace <code>ResourceOwner</code> field. For operations associated with namespaces that are shared with your account, you must specify an <code>OwnerAccount</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.operation_not_found.OperationNotFound: <p>No operation exists with the specified ID.</p>
        capo_servicediscovery.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Example: Get operation result
        Example: Get operation result

        >>> await client.get_operation(operation_id='gv4g5meo7ndmeh4fqskygvk23d2fijwa-k9302yzd')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_servicediscovery.types.get_operation_request.GetOperationRequest]",
    ) -> AsyncOperationResponse[
        "capo_servicediscovery.types.get_operation_response.GetOperationResponse"
    ]:
        import capo_servicediscovery._operations.route53_auto_naming_v20170314.get_operation

        (
            output,
            http_response,
        ) = await capo_servicediscovery._operations.route53_auto_naming_v20170314.get_operation.async_get_operation(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetOperation")
    )
    input_: capo_servicediscovery.types.get_operation_request.GetOperationRequest = {
        "operation_id": operation_id
    }
    if owner_account is not None:
        input_["owner_account"] = owner_account

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