GetMaintenanceWindowExecutionTask - AWS Systems Manager

GetMaintenanceWindowExecutionTask

Retrieves the details about a specific task run as part of a maintenance window execution.

Request Syntax

{ "TaskId": "string", "WindowExecutionId": "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.

TaskId

The ID of the specific task execution in the maintenance window task that should be retrieved.

Type: String

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

Required: Yes

WindowExecutionId

The ID of the maintenance window execution that includes the task.

Type: String

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

Required: Yes

Response Syntax

{ "AlarmConfiguration": { "Alarms": [ { "Name": "string" } ], "IgnorePollAlarmFailure": boolean }, "EndTime": number, "MaxConcurrency": "string", "MaxErrors": "string", "Priority": number, "ServiceRole": "string", "StartTime": number, "Status": "string", "StatusDetails": "string", "TaskArn": "string", "TaskExecutionId": "string", "TaskParameters": [ { "string" : { "Values": [ "string" ] } } ], "TriggeredAlarms": [ { "Name": "string", "State": "string" } ], "Type": "string", "WindowExecutionId": "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.

AlarmConfiguration

The details for the CloudWatch alarm you applied to your maintenance window task.

Type: AlarmConfiguration object

EndTime

The time the task execution completed.

Type: Timestamp

MaxConcurrency

The defined maximum number of task executions that could be run in parallel.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 7.

Pattern: ^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$

MaxErrors

The defined maximum number of task execution errors allowed before scheduling of the task execution would have been stopped.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 7.

Pattern: ^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$

Priority

The priority of the task.

Type: Integer

Valid Range: Minimum value of 0.

ServiceRole

The role that was assumed when running the task.

Type: String

StartTime

The time the task execution started.

Type: Timestamp

Status

The status of the task.

Type: String

Valid Values: PENDING | IN_PROGRESS | SUCCESS | FAILED | TIMED_OUT | CANCELLING | CANCELLED | SKIPPED_OVERLAPPING

StatusDetails

The details explaining the status. Not available for all status values.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 250.

TaskArn

The Amazon Resource Name (ARN) of the task that ran.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

TaskExecutionId

The ID of the specific task execution in the maintenance window task that was retrieved.

Type: String

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

TaskParameters

The parameters passed to the task when it was run.

Note

TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.

The map has the following format:

  • Key: string, between 1 and 255 characters

  • Value: an array of strings, each between 1 and 255 characters

Type: Array of string to MaintenanceWindowTaskParameterValueExpression object maps

Key Length Constraints: Minimum length of 1. Maximum length of 255.

TriggeredAlarms

The CloudWatch alarms that were invoked by the maintenance window task.

Type: Array of AlarmStateInformation objects

Array Members: Fixed number of 1 item.

Type

The type of task that was run.

Type: String

Valid Values: RUN_COMMAND | AUTOMATION | STEP_FUNCTIONS | LAMBDA

WindowExecutionId

The ID of the maintenance window execution that includes the task.

Type: String

Length Constraints: Fixed length of 36.

Pattern: ^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$

Errors

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

DoesNotExistException

Error returned when the ID specified for a resource, such as a maintenance window or patch baseline, doesn't exist.

For information about resource quotas in AWS Systems Manager, see Systems Manager service quotas in the Amazon Web Services General Reference.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

Examples

Example

This example illustrates one usage of GetMaintenanceWindowExecutionTask.

Sample Request

POST / HTTP/1.1 Host: ssm.us-east-2.amazonaws.com Accept-Encoding: identity X-Amz-Target: AmazonSSM.GetMaintenanceWindowExecutionTask Content-Type: application/x-amz-json-1.1 User-Agent: aws-cli/2.0.0 Python/3.7.5 Windows/10 botocore/2.0.0dev4 X-Amz-Date: 20240225T001515Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20240225/us-east-2/ssm/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE Content-Length: 111 { "WindowExecutionId": "b40a588d-32a7-4ea7-9a6b-b4ef436EXAMPLE", "TaskId": "0c9ac961-dafd-4a94-b6c7-1bef3EXAMPLE" }

Sample Response

{ "WindowExecutionId": "b40a588d-32a7-4ea7-9a6b-b4ef436EXAMPLE", "TaskExecutionId": "0c9ac961-dafd-4a94-b6c7-1bef3EXAMPLE", "TaskArn": "AWS-RunPatchBaseline", "ServiceRole": "arn:aws:iam::111122223333:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM", "Type": "RUN_COMMAND", "TaskParameters": [ { "BaselineOverride": { "Values": [ "" ] }, "InstallOverrideList": { "Values": [ "" ] }, "Operation": { "Values": [ "Scan" ] }, "RebootOption": { "Values": [ "RebootIfNeeded" ] }, "SnapshotId": { "Values": [ "{{ aws:ORCHESTRATION_ID }}" ] }, "aws:InstanceId": { "Values": [ "i-02573cafcfEXAMPLE", "i-0471e04240EXAMPLE", "i-07782c72faEXAMPLE" ] } } ], "Priority": 1, "MaxConcurrency": "1", "MaxErrors": "3", "Status": "SUCCESS", "StartTime": "2024-08-04T11:45:35.088000-07:00", "EndTime": "2024-08-04T11:48:09.079000-07:00" }

See Also

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