Skip to content

update_lookup async

update_lookup(
    identifier: LookupIdentifier,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    description: Optional[LookupDescription] = None,
    body: Optional[LookupBody] = None,
    query_id: Optional[LookupQueryId] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
) -> UpdateLookupResponse

Replaces a lookup table's content, its description, or both. Only the fields you provide are changed. Replacing the content replaces every row: there is no partial row update.

Parameters:

  • identifier (LookupIdentifier) –

    The id of the lookup table to update.

  • description (Optional[LookupDescription], default: None ) –

    The new description of the lookup table. Omit to leave the description unchanged, or supply an empty string to remove it, leaving the table with no description.

  • body (Optional[LookupBody], default: None ) –

    The replacement CSV content of the lookup table. Omit to leave the content unchanged. At most one of body and queryId may be specified.

  • query_id (Optional[LookupQueryId], default: None ) –

    The identifier of a query whose results become the lookup table's content.

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The ARN of a customer managed KMS key used to encrypt the lookup table's content.

Raises:

Examples:

Replace a lookup table's content The following example replaces every row of a lookup table. The omitted description is left unchanged. Call GetLookup to read the table's metadata after the update. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.update_lookup(identifier='3k7f2m9qx4pd8w1n6v0b5j2tz', body='service,team\ncheckout,payments\nsearch,discovery\ncatalog,retail\n')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def update_lookup(
    self,
    identifier: "capo_cloudwatchomni.types.lookup_identifier.LookupIdentifier",
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
    description: Optional[
        "capo_cloudwatchomni.types.lookup_description.LookupDescription"
    ] = None,
    body: Optional["capo_cloudwatchomni.types.lookup_body.LookupBody"] = None,
    query_id: Optional[
        "capo_cloudwatchomni.types.lookup_query_id.LookupQueryId"
    ] = None,
    kms_key_arn: Optional["capo_cloudwatchomni.types.kms_key_arn.KmsKeyArn"] = None,
) -> "capo_cloudwatchomni.types.update_lookup_response.UpdateLookupResponse":
    r"""Replaces a lookup table's content, its description, or both. Only the fields you provide are changed. Replacing the content replaces every row: there is no partial row update.

    Args:
        identifier: The id of the lookup table to update.
        description: The new description of the lookup table. Omit to leave the description unchanged, or supply an empty string to remove it, leaving the table with no description.
        body: The replacement CSV content of the lookup table. Omit to leave the content unchanged. At most one of body and queryId may be specified.
        query_id: The identifier of a query whose results become the lookup table's content.
        kms_key_arn: The ARN of a customer managed KMS key used to encrypt the lookup table's content.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.conflict_exception.ConflictException: The operation could not be completed because of a conflict with the current state of the resource.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Replace a lookup table's content
        The following example replaces every row of a lookup table. The omitted description is left unchanged. Call GetLookup to read the table's metadata after the update. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.update_lookup(identifier='3k7f2m9qx4pd8w1n6v0b5j2tz', body='service,team\ncheckout,payments\nsearch,discovery\ncatalog,retail\n')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.update_lookup_request.UpdateLookupRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.update_lookup_response.UpdateLookupResponse"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_lookup

        (
            output,
            http_response,
        ) = await capo_cloudwatchomni._operations.cloud_watch_omni_frontend.update_lookup.async_update_lookup(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cloudwatchomni.types.update_lookup_request.UpdateLookupRequest",
    ) -> dict[str, Any]:
        import capo_cloudwatchomni.types.update_lookup_request

        return capo_cloudwatchomni.types.update_lookup_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateLookup", redact_input=_redact_input),
    )
    input_: capo_cloudwatchomni.types.update_lookup_request.UpdateLookupRequest = {
        "identifier": identifier
    }
    if description is not None:
        input_["description"] = description
    if body is not None:
        input_["body"] = body
    if query_id is not None:
        input_["query_id"] = query_id
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn

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