Skip to content

associate_ops_item_related_item async

associate_ops_item_related_item(
    ops_item_id: OpsItemId,
    association_type: OpsItemRelatedItemAssociationType,
    resource_type: OpsItemRelatedItemAssociationResourceType,
    resource_uri: OpsItemRelatedItemAssociationResourceUri,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
) -> AssociateOpsItemRelatedItemResponse

Associates a related item to a Systems Manager OpsCenter OpsItem. For example, you can associate an Incident Manager incident or analysis with an OpsItem. Incident Manager and OpsCenter are tools in Amazon Web Services Systems Manager.

Parameters:

  • ops_item_id (OpsItemId) –

    The ID of the OpsItem to which you want to associate a resource as a related item.

  • association_type (OpsItemRelatedItemAssociationType) –

    The type of association that you want to create between an OpsItem and a resource. OpsCenter supports IsParentOf and RelatesTo association types.

  • resource_type (OpsItemRelatedItemAssociationResourceType) –

    The type of resource that you want to associate with an OpsItem. OpsCenter supports the following types:

    AWS::SSMIncidents::IncidentRecord: an Incident Manager incident.

    AWS::SSM::Document: a Systems Manager (SSM) document.

  • resource_uri (OpsItemRelatedItemAssociationResourceUri) –

    The Amazon Resource Name (ARN) of the Amazon Web Services resource that you want to associate with the OpsItem.

Raises:

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def associate_ops_item_related_item(
    self,
    ops_item_id: "capo_ssm.types.ops_item_id.OpsItemId",
    association_type: "capo_ssm.types.ops_item_related_item_association_type.OpsItemRelatedItemAssociationType",
    resource_type: "capo_ssm.types.ops_item_related_item_association_resource_type.OpsItemRelatedItemAssociationResourceType",
    resource_uri: "capo_ssm.types.ops_item_related_item_association_resource_uri.OpsItemRelatedItemAssociationResourceUri",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
) -> "capo_ssm.types.associate_ops_item_related_item_response.AssociateOpsItemRelatedItemResponse":
    """<p>Associates a related item to a Systems Manager OpsCenter OpsItem. For example, you can associate an Incident Manager incident or analysis with an OpsItem. Incident Manager and OpsCenter are tools in Amazon Web Services Systems Manager.</p>

    Args:
        ops_item_id: <p>The ID of the OpsItem to which you want to associate a resource as a related item.</p>
        association_type: <p>The type of association that you want to create between an OpsItem and a resource. OpsCenter supports <code>IsParentOf</code> and <code>RelatesTo</code> association types.</p>
        resource_type: <p>The type of resource that you want to associate with an OpsItem. OpsCenter supports the following types:</p> <p> <code>AWS::SSMIncidents::IncidentRecord</code>: an Incident Manager incident. </p> <p> <code>AWS::SSM::Document</code>: a Systems Manager (SSM) document.</p>
        resource_uri: <p>The Amazon Resource Name (ARN) of the Amazon Web Services resource that you want to associate with the OpsItem.</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.ops_item_conflict_exception.OpsItemConflictException: <p>The specified OpsItem is in the process of being deleted.</p>
        capo_ssm.errors.ops_item_invalid_parameter_exception.OpsItemInvalidParameterException: <p>A specified parameter argument isn't valid. Verify the available arguments and try again.</p>
        capo_ssm.errors.ops_item_limit_exceeded_exception.OpsItemLimitExceededException: <p>The request caused OpsItems to exceed one or more quotas.</p>
        capo_ssm.errors.ops_item_not_found_exception.OpsItemNotFoundException: <p>The specified OpsItem ID doesn't exist. Verify the ID and try again.</p>
        capo_ssm.errors.ops_item_related_item_already_exists_exception.OpsItemRelatedItemAlreadyExistsException: <p>The Amazon Resource Name (ARN) is already associated with the OpsItem.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.associate_ops_item_related_item_request.AssociateOpsItemRelatedItemRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.associate_ops_item_related_item_response.AssociateOpsItemRelatedItemResponse"
    ]:
        import capo_ssm._operations.amazon_ssm.associate_ops_item_related_item

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.associate_ops_item_related_item.async_associate_ops_item_related_item(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateOpsItemRelatedItem")
    )
    input_: capo_ssm.types.associate_ops_item_related_item_request.AssociateOpsItemRelatedItemRequest = {
        "ops_item_id": ops_item_id,
        "association_type": association_type,
        "resource_type": resource_type,
        "resource_uri": resource_uri,
    }

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