Skip to content

update_link async

update_link(
    identifier: ResourceIdentifier,
    resource_types: ResourceTypesInput,
    *,
    config_overrides: Optional[AsyncOAMClientConfig] = None,
    link_configuration: Optional[LinkConfiguration] = None,
    include_tags: Optional[IncludeTags] = None,
) -> UpdateLinkOutput

Use this operation to change what types of data are shared from a source account to its linked monitoring account sink. You can't change the sink or change the monitoring account with this operation.

When you update a link, you can optionally specify filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.

To update the list of tags associated with the sink, use TagResource.

Parameters:

  • identifier (ResourceIdentifier) –

    The ARN of the link that you want to update.

  • resource_types (ResourceTypesInput) –

    An array of strings that define which types of data that the source account will send to the monitoring account.

    Your input here replaces the current set of data types that are shared.

  • link_configuration (Optional[LinkConfiguration], default: None ) –

    Use this structure to filter which metric namespaces and which log groups are to be shared from the source account to the monitoring account.

  • include_tags (Optional[IncludeTags], default: None ) –

    Specifies whether to include the tags associated with the link in the response after the update operation. When IncludeTags is set to true and the caller has the required permission, oam:ListTagsForResource, the API will return the tags for the specified resource. If the caller doesn't have the required permission, oam:ListTagsForResource, the API will raise an exception.

    The default value is false.

Raises:

Source code in docs_src/capo_oam/_services/async_oam.py
async def update_link(
    self,
    identifier: "capo_oam.types.resource_identifier.ResourceIdentifier",
    resource_types: "capo_oam.types.resource_types_input.ResourceTypesInput",
    *,
    config_overrides: Optional[AsyncOAMClientConfig] = None,
    link_configuration: Optional[
        "capo_oam.types.link_configuration.LinkConfiguration"
    ] = None,
    include_tags: Optional["capo_oam.types.include_tags.IncludeTags"] = None,
) -> "capo_oam.types.update_link_output.UpdateLinkOutput":
    """<p>Use this operation to change what types of data are shared from a source account to its linked monitoring account sink. You can't change the sink or change the monitoring account with this operation.</p> <p>When you update a link, you can optionally specify filters that specify which metric namespaces and which log groups are shared from the source account to the monitoring account.</p> <p>To update the list of tags associated with the sink, use <a href="https://docs.aws.amazon.com/OAM/latest/APIReference/API_TagResource.html">TagResource</a>.</p>

    Args:
        identifier: <p>The ARN of the link that you want to update.</p>
        resource_types: <p>An array of strings that define which types of data that the source account will send to the monitoring account.</p> <p>Your input here replaces the current set of data types that are shared.</p>
        link_configuration: <p>Use this structure to filter which metric namespaces and which log groups are to be shared from the source account to the monitoring account.</p>
        include_tags: <p>Specifies whether to include the tags associated with the link in the response after the update operation. When <code>IncludeTags</code> is set to <code>true</code> and the caller has the required permission, <code>oam:ListTagsForResource</code>, the API will return the tags for the specified resource. If the caller doesn't have the required permission, <code>oam:ListTagsForResource</code>, the API will raise an exception. </p> <p>The default value is <code>false</code>.</p>

    Raises:
        capo_oam.errors.internal_service_fault.InternalServiceFault: <p>Unexpected error while processing the request. Retry the request.</p>
        capo_oam.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_oam.errors.missing_required_parameter_exception.MissingRequiredParameterException: <p>A required parameter is missing from the request.</p>
        capo_oam.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist.</p>
        capo_oam.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_oam.types.update_link_input.UpdateLinkInput]",
    ) -> AsyncOperationResponse[
        "capo_oam.types.update_link_output.UpdateLinkOutput"
    ]:
        import capo_oam._operations.oamservice.update_link

        (
            output,
            http_response,
        ) = await capo_oam._operations.oamservice.update_link.async_update_link(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateLink")
    )
    input_: capo_oam.types.update_link_input.UpdateLinkInput = {
        "identifier": identifier,
        "resource_types": resource_types,
    }
    if link_configuration is not None:
        input_["link_configuration"] = link_configuration
    if include_tags is not None:
        input_["include_tags"] = include_tags

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