AssociateOpsItemRelatedItem - AWS Systems Manager

AssociateOpsItemRelatedItem

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 capabilities of AWS Systems Manager.

Request Syntax

{ "AssociationType": "string", "OpsItemId": "string", "ResourceType": "string", "ResourceUri": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

AssociationType

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

Type: String

Required: Yes

OpsItemId

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

Type: String

Pattern: ^(oi)-[0-9a-f]{12}$

Required: Yes

ResourceType

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.

Type: String

Required: Yes

ResourceUri

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

Type: String

Required: Yes

Response Syntax

{ "AssociationId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

AssociationId

The association ID.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

OpsItemConflictException

The specified OpsItem is in the process of being deleted.

HTTP Status Code: 400

OpsItemInvalidParameterException

A specified parameter argument isn't valid. Verify the available arguments and try again.

HTTP Status Code: 400

OpsItemLimitExceededException

The request caused OpsItems to exceed one or more quotas.

HTTP Status Code: 400

OpsItemNotFoundException

The specified OpsItem ID doesn't exist. Verify the ID and try again.

HTTP Status Code: 400

OpsItemRelatedItemAlreadyExistsException

The Amazon Resource Name (ARN) is already associated with the OpsItem.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of AssociateOpsItemRelatedItem.

Sample Request

POST / HTTP/1.1 Host: ssm.us-east-1.amazonaws.com Accept-Encoding: identity X-Amz-Target: AmazonSSM.AssociateOpsItemRelatedItem Content-Type: application/x-amz-json-1.1 User-Agent: aws-cli/2.2.4 Python/3.8.8 Linux/5.4.129-72.229.amzn2int.x86_64 exe/x86_64.amzn.2 prompt/off command/ssm.associate-ops-item-related-item X-Amz-Date: 20240804T181929Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20240804/us-east-1/ssm/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE Content-Length: 229 { "OpsItemId": "oi-649fExample", "AssociationType": "RelatesTo", "ResourceType": "AWS::SSMIncidents::IncidentRecord", "ResourceUri": "arn:aws:ssm-incidents::111122223333:incident-record/Test/c6bd8931-efae-a4ff-7f98-4490Example" }

Sample Response

{ "AssociationId": "61d7178d-a30d-4bc5-9b4e-a9e74EXAMPLE" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: