"workspaces": [ {
"alias": "myWorkspace",
"arn": "arn:aws:aps:us-west-2:123456789012:workspace/ws-b226cc2a-a446-46a9-933a-ac50479a5568",
"createdAt": 1.606851445922E9, "status": {
"statusCode": "ACTIVE"
},
"workspaceId": "ws-12345678-a446-46a9-933a-ac50479a5568"
} ] }
PutAlertManagerDefinition
The PutAlertManagerDefinition operation updates an existing alert manager definition in a workspace. If a workspace does not already have an alert manager definition, don't use this operation to create it. Instead, use CreateAlertManagerDefinition (p. 96).
Request parameters
• workspaceId—The ID of the workspace to update the alert manager definition in.
• data— The new alert manager definition to use. This is an AlertManagerDefinitionData structure (p. 112).
• clientToken—(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
Response elements
• status—A structure that displays the current status of the alert manager definition. For more information, see AlertManagerDefinitionStatus structure (p. 113).
Sample request
PUT /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/alertmanager/definition HTTP/1.1 Content-Length: 409,
Authorization: AUTHPARAMS X-Amz-Date: 20201201T193725Z
User-Agent: aws-cli/1.18.147 Python/2.7.18 Linux/5.4.58-37.125.amzn2int.x86_64 botocore/1.18.6
{ "data": "EXAMPLE2NvbmZpZzogfAogIGdsb2Jhb...",
"clientToken": "6495e935-b4ec-4c39-a8ac-37fb99973589"
}
Sample response
HTTP/1.1 202 OK
x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 185
Access-Control-Allow-Methods: OPTION,GET,POST,DELETE
Access-Control-Expose-Headers: x-amzn-errortype,x-amzn-requestid,x-amzn-trace-id,x-amzn-errormessage,x-amz-apigw-id,date
Strict-Transport-Security: strict-transport-security: max-age=31536000; includeSubDomains x-amz-apigw-id: 1234EXAMPLE=
X-Amzn-Trace-Id: Root=1-12345678-39c98b574fd600282a1a0f21
PutRuleGroupsNamespace
Connection: keep-alive
Cache-Control: no-store,no-cache,must-revalidate Date: Tue, 01 Dec 2020 19:37:25 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: *,Authorization,Date,X-Amz-Date,content-type,x-amz-content- sha256,x-amz-user-agent,x-amzn-platform-id,x-amzn-trace-id,X-Amz-Security-Token,X-Amz-Target
Content-Type: application/x-amz-json-1.1 { "alertManagerDefinition": {
"createdAt": 1.634848225614E9,
"data": "EXAMPLE2NvbmZpZzogfAogIGdsb2Jhb...", "modifiedAt": 1.63484828633E9,
"status": {
"statusCode": "ACTIVE", "statusReason": ""
} } }
PutRuleGroupsNamespace
The PutRuleGroupsNamespace operation updates an existing rule groups namespace within a workspace. A rule groups namespace is associated with exactly one rules file. A workspace can have multiple rule groups namespaces.
Use this operation only to update existing rule groups namespaces. To create a new rule groups namespace, use CreateRuleGroupsNamespace (p. 97).
You can't use this operation to add tags to an existing rule groups namespace. Instead, use TagResource (p. 110).
Request parameters
• workspaceId—The ID of the workspace where you are updating the rule groups namespace.
• name—The name of the rule groups namespace that you are updating.
• data— The new rules file to use in the namespace. This is a RuleGroupsNamespaceData structure (p. 113).
• clientToken—(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
Response elements
• name—The name of the new rule groups namespace.
• status—A structure that displays the current status of the rule groups namespace. For more information, see RuleGroupsNamespaceStatus structure (p. 113).
• arn—The ARN of the rule groups namespace.
• tags— The list of tag keys and values that are associated with the namespace.
Sample request
PUT /workspaces/ws-b226cc2a-a446-46a9-933a-ac50479a5568/rulegroupsnamespaces/test-rules HTTP/1.1
Content-Length: 225, Authorization: AUTHPARAMS
TagResource
X-Amz-Date: 20201201T193725Z
User-Agent: aws-cli/1.18.147 Python/2.7.18 Linux/5.4.58-37.125.amzn2int.x86_64 botocore/1.18.6
{ "data": "EXAMPLE2NvbmZpZzogfAogIGdsb2Jhb...",
"clientToken": "1b1ef402-b1bc-4f86-8560-7ce0a45c32d6"
}
Sample response
"tags": {}
}
TagResource
The TagResource operation associates tags with an Amazon Managed Service for Prometheus resource.
Currently, the only resources that can be tagged are workspaces and rule groups namespaces.
If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag.
Request parameters
• resourceArn—The ARN of the workspace or rule groups namespace to apply tags to.
• tags—The list of tag keys and values to associate with the resource.
Response elements
If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.
Sample request
POST /tags/arn%3Aaws%3Aaps%3Aus-east-2%31234567893884%3Aworkspace%2Fws-effda945-fb72-4e8b-bbb7-1234567895b6 HTTP/1.1
Content-Type: application/json X-Amz-Date: 20210829T223002Z Authorization: AUTHPARAMS
User-Agent: aws-cli/1.18.147 Python/2.7.18 Linux/5.4.58-37.125.amzn2int.x86_64 botocore/1.18.6
{ "resourceArn": "arn:aws:aps:us-west-2:123456789012:workspace/ws-12345678-a446-46a9-933a-ac50479a5568",
"tags": {
"Status": "Secret", "Team": "My-Team"
} }
Sample response
HTTP/1.1 204 No Content
x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 0
UntagResource
Content-Type: application/x-amz-json-1.1
UntagResource
The UntagResource operation removes the specified tags from an Amazon Managed Service for Prometheus resource. Currently, the only resources that can be tagged are workspaces and rule groups namespaces.
Request parameters
• resourceArn—The ARN of the workspace or rule groups namespace.
• tagKeys—The keys of the tags to remove.
Response elements
If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.
Sample request
DELETE /tags/arn:aws:aps:us-west-2:123456789012:workspace/ws-12345678-a446-46a9-933a-ac50479a5568?tagKeys=myNewTag HTTP/1.1
Content-Type: application/json X-Amz-Date: 20210829T223002Z Authorization: AUTHPARAMS
User-Agent: aws-cli/1.18.147 Python/2.7.18 Linux/5.4.58-37.125.amzn2int.x86_64 botocore/1.18.6
Sample response
HTTP/1.1 204 No Content
x-amzn-RequestId: 12345678-abcd-4442-b8c5-262b45e9b535 Content-Length: 0
Content-Type: application/x-amz-json-1.1
UpdateWorkspaceAlias
The UpdateWorkspaceAlias operation updates the alias of an existing workspace.
Request parameters
• workspaceId—The ID of the workspace to update.
• alias—The new alias for the workspace. It does not need to be unique.
The alias can be up to 100 characters and can include any type of characters. Amazon Managed Service for Prometheus will automatically strip any blank spaces from the beginning and end of the alias that you specify.
• clientToken—(Optional) A unique, case-sensitive identifier that you can provide to ensure the idempotency of the request.
Response elements
• None
Sample request