Class MaintenanceWindowTask
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<MaintenanceWindowTask.Builder,MaintenanceWindowTask>
Information about a task defined for a maintenance window.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal AlarmConfigurationThe details for the CloudWatch alarm applied to your maintenance window task.builder()The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.final StringThe specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.final StringA description of the task.final booleanfinal booleanequalsBySdkFields(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) final inthashCode()final booleanFor responses, this returns true if the service returned a value for the Targets property.final booleanFor responses, this returns true if the service returned a value for the TaskParameters property.final LoggingInfoInformation about an S3 bucket to write task-level logs to.final StringThe maximum number of targets this task can be run for, in parallel.final StringThe maximum number of errors allowed before this task stops being scheduled.final Stringname()The task name.final Integerpriority()The priority of the task in the maintenance window.static Class<? extends MaintenanceWindowTask.Builder> final StringThe Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task.targets()The targets (either managed nodes or tags).final StringtaskArn()The resource that the task uses during execution.The parameters that should be passed to the task when it is run.Take this object and create a builder that contains all of the current property values of this object.final StringtoString()Returns a string representation of this object.type()The type of task.final StringThe type of task.final StringwindowId()The ID of the maintenance window where the task is registered.final StringThe task ID.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
windowId
The ID of the maintenance window where the task is registered.
- Returns:
- The ID of the maintenance window where the task is registered.
-
windowTaskId
-
taskArn
The resource that the task uses during execution. For
RUN_COMMANDandAUTOMATIONtask types,TaskArnis the Amazon Web Services Systems Manager (SSM document) name or ARN. ForLAMBDAtasks, it's the function name or ARN. ForSTEP_FUNCTIONStasks, it's the state machine ARN.- Returns:
- The resource that the task uses during execution. For
RUN_COMMANDandAUTOMATIONtask types,TaskArnis the Amazon Web Services Systems Manager (SSM document) name or ARN. ForLAMBDAtasks, it's the function name or ARN. ForSTEP_FUNCTIONStasks, it's the state machine ARN.
-
type
The type of task.
If the service returns an enum value that is not available in the current SDK version,
typewill returnMaintenanceWindowTaskType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromtypeAsString().- Returns:
- The type of task.
- See Also:
-
typeAsString
The type of task.
If the service returns an enum value that is not available in the current SDK version,
typewill returnMaintenanceWindowTaskType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromtypeAsString().- Returns:
- The type of task.
- See Also:
-
hasTargets
public final boolean hasTargets()For responses, this returns true if the service returned a value for the Targets property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
targets
The targets (either managed nodes or tags). Managed nodes are specified using
Key=instanceids,Values=<instanceid1>,<instanceid2>. Tags are specified usingKey=<tag name>,Values=<tag value>.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTargets()method.- Returns:
- The targets (either managed nodes or tags). Managed nodes are specified using
Key=instanceids,Values=<instanceid1>,<instanceid2>. Tags are specified usingKey=<tag name>,Values=<tag value>.
-
hasTaskParameters
public final boolean hasTaskParameters()For responses, this returns true if the service returned a value for the TaskParameters property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified. -
taskParameters
The parameters that should be passed to the task when it is run.
TaskParametershas been deprecated. To specify parameters to pass to a task when it runs, instead use theParametersoption in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTaskParameters()method.- Returns:
- The parameters that should be passed to the task when it is run.
TaskParametershas been deprecated. To specify parameters to pass to a task when it runs, instead use theParametersoption in theTaskInvocationParametersstructure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.
-
priority
The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
- Returns:
- The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.
-
loggingInfo
Information about an S3 bucket to write task-level logs to.
LoggingInfohas been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use theOutputS3BucketNameandOutputS3KeyPrefixoptions in theTaskInvocationParametersstructure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.- Returns:
- Information about an S3 bucket to write task-level logs to.
LoggingInfohas been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use theOutputS3BucketNameandOutputS3KeyPrefixoptions in theTaskInvocationParametersstructure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters.
-
serviceRoleArn
The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in your account, it is created when you run
RegisterTaskWithMaintenanceWindow.However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see Setting up Maintenance Windows in the in the Amazon Web Services Systems Manager User Guide.
- Returns:
- The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume
when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses a
service-linked role in your account. If no appropriate service-linked role for Systems Manager exists in
your account, it is created when you run
RegisterTaskWithMaintenanceWindow.However, for an improved security posture, we strongly recommend creating a custom policy and custom service role for running your maintenance window tasks. The policy can be crafted to provide only the permissions needed for your particular maintenance window tasks. For more information, see Setting up Maintenance Windows in the in the Amazon Web Services Systems Manager User Guide.
-
maxConcurrency
The maximum number of targets this task can be run for, in parallel.
Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.
For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of
1. This value doesn't affect the running of your task.- Returns:
- The maximum number of targets this task can be run for, in parallel.
Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.
For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of
1. This value doesn't affect the running of your task.
-
maxErrors
The maximum number of errors allowed before this task stops being scheduled.
Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.
For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of
1. This value doesn't affect the running of your task.- Returns:
- The maximum number of errors allowed before this task stops being scheduled.
Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.
For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of
1. This value doesn't affect the running of your task.
-
name
-
description
-
cutoffBehavior
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
If the service returns an enum value that is not available in the current SDK version,
cutoffBehaviorwill returnMaintenanceWindowTaskCutoffBehavior.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcutoffBehaviorAsString().- Returns:
- The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
- See Also:
-
cutoffBehaviorAsString
The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
If the service returns an enum value that is not available in the current SDK version,
cutoffBehaviorwill returnMaintenanceWindowTaskCutoffBehavior.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcutoffBehaviorAsString().- Returns:
- The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.
- See Also:
-
alarmConfiguration
The details for the CloudWatch alarm applied to your maintenance window task.
- Returns:
- The details for the CloudWatch alarm applied to your maintenance window task.
-
toBuilder
Description copied from interface:ToCopyableBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToCopyableBuilder<MaintenanceWindowTask.Builder,MaintenanceWindowTask> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojoIndicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojoclass, and is generated based on a service model.If an
SdkPojoclass does not have any inherited fields,equalsBySdkFieldsandequalsare essentially the same.- Specified by:
equalsBySdkFieldsin interfaceSdkPojo- Parameters:
obj- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-