/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.simplesystemsmanagement.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RegisterTaskWithMaintenanceWindowRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The ID of the maintenance window the task should be added to. *

*/ private String windowId; /** *

* The targets (either managed nodes or maintenance window targets). *

* *

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, * targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more * information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User * Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> *

*/ private com.amazonaws.internal.SdkInternalList targets; /** *

* The ARN of the task to run. *

*/ private String taskArn; /** *

* 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 your account's * service-linked role. If no service-linked role for Systems Manager exists in your account, it is created when you * run RegisterTaskWithMaintenanceWindow. *

*

* For more information, see the following topics in the in the Amazon Web Services Systems Manager User * Guide: *

* */ private String serviceRoleArn; /** *

* The type of task being registered. *

*/ private String taskType; /** *

* The parameters that should be passed to the task when it is run. *

* *

* 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. *

*
*/ private java.util.Map taskParameters; /** *

* The parameters that the task should use during execution. Populate only the fields that match the task type. All * other fields should be empty. *

*/ private MaintenanceWindowTaskInvocationParameters taskInvocationParameters; /** *

* The priority of the task in the maintenance window, the lower the number the higher the priority. Tasks in a * maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel. *

*/ private Integer priority; /** *

* 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. *

*
*/ private String maxConcurrency; /** *

* 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. *

*
*/ private String maxErrors; /** *

* A structure containing information about an Amazon Simple Storage Service (Amazon S3) bucket to write managed * node-level logs to. *

* *

* LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to * contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the * TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager * handles these options for the supported maintenance window task types, see * MaintenanceWindowTaskInvocationParameters. *

*
*/ private LoggingInfo loggingInfo; /** *

* An optional name for the task. *

*/ private String name; /** *

* An optional description for the task. *

*/ private String description; /** *

* User-provided idempotency token. *

*/ private String clientToken; /** *

* Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is * reached. *

* */ private String cutoffBehavior; /** *

* The CloudWatch alarm you want to apply to your maintenance window task. *

*/ private AlarmConfiguration alarmConfiguration; /** *

* The ID of the maintenance window the task should be added to. *

* * @param windowId * The ID of the maintenance window the task should be added to. */ public void setWindowId(String windowId) { this.windowId = windowId; } /** *

* The ID of the maintenance window the task should be added to. *

* * @return The ID of the maintenance window the task should be added to. */ public String getWindowId() { return this.windowId; } /** *

* The ID of the maintenance window the task should be added to. *

* * @param windowId * The ID of the maintenance window the task should be added to. * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterTaskWithMaintenanceWindowRequest withWindowId(String windowId) { setWindowId(windowId); return this; } /** *

* The targets (either managed nodes or maintenance window targets). *

* *

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, * targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more * information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User * Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> *

* * @return The targets (either managed nodes or maintenance window targets).

*

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the * task, targets are optional for other maintenance window task types (Automation, Lambda, and Step * Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager * User Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> */ public java.util.List getTargets() { if (targets == null) { targets = new com.amazonaws.internal.SdkInternalList(); } return targets; } /** *

* The targets (either managed nodes or maintenance window targets). *

* *

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, * targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more * information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User * Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> *

* * @param targets * The targets (either managed nodes or maintenance window targets).

*

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the * task, targets are optional for other maintenance window task types (Automation, Lambda, and Step * Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager * User Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> */ public void setTargets(java.util.Collection targets) { if (targets == null) { this.targets = null; return; } this.targets = new com.amazonaws.internal.SdkInternalList(targets); } /** *

* The targets (either managed nodes or maintenance window targets). *

* *

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, * targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more * information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User * Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setTargets(java.util.Collection)} or {@link #withTargets(java.util.Collection)} if you want to override * the existing values. *

* * @param targets * The targets (either managed nodes or maintenance window targets).

*

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the * task, targets are optional for other maintenance window task types (Automation, Lambda, and Step * Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager * User Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterTaskWithMaintenanceWindowRequest withTargets(Target... targets) { if (this.targets == null) { setTargets(new com.amazonaws.internal.SdkInternalList(targets.length)); } for (Target ele : targets) { this.targets.add(ele); } return this; } /** *

* The targets (either managed nodes or maintenance window targets). *

* *

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, * targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more * information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User * Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> *

* * @param targets * The targets (either managed nodes or maintenance window targets).

*

* One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the * task, targets are optional for other maintenance window task types (Automation, Lambda, and Step * Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager * User Guide. *

*
*

* Specify managed nodes using the following format: *

*

* Key=InstanceIds,Values=<instance-id-1>,<instance-id-2> *

*

* Specify maintenance window targets using the following format: *

*

* Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2> * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterTaskWithMaintenanceWindowRequest withTargets(java.util.Collection targets) { setTargets(targets); return this; } /** *

* The ARN of the task to run. *

* * @param taskArn * The ARN of the task to run. */ public void setTaskArn(String taskArn) { this.taskArn = taskArn; } /** *

* The ARN of the task to run. *

* * @return The ARN of the task to run. */ public String getTaskArn() { return this.taskArn; } /** *

* The ARN of the task to run. *

* * @param taskArn * The ARN of the task to run. * @return Returns a reference to this object so that method calls can be chained together. */ public RegisterTaskWithMaintenanceWindowRequest withTaskArn(String taskArn) { setTaskArn(taskArn); return this; } /** *

* 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 your account's * service-linked role. If no service-linked role for Systems Manager exists in your account, it is created when you * run RegisterTaskWithMaintenanceWindow. *

*

* For more information, see the following topics in the in the Amazon Web Services Systems Manager User * Guide: *

* * * @param 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 * your account's service-linked role. If no service-linked role for Systems Manager exists in your account, * it is created when you run RegisterTaskWithMaintenanceWindow.

*

* For more information, see the following topics in the in the Amazon Web Services Systems Manager User * Guide: *

*