com.amazonaws.services.simplesystemsmanagement.model.MaintenanceWindowRunCommandParameters Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The parameters for a RUN_COMMAND
task type.
*
*
* For information about specifying and updating task parameters, see RegisterTaskWithMaintenanceWindow and
* UpdateMaintenanceWindowTask.
*
*
*
* 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.
*
*
* 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.
*
*
* For RUN_COMMAND
tasks, Systems Manager uses specified values for TaskParameters
and
* LoggingInfo
only if no values are specified for TaskInvocationParameters
.
*
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MaintenanceWindowRunCommandParameters implements Serializable, Cloneable, StructuredPojo {
/**
*
* Information about the commands to run.
*
*/
private String comment;
private CloudWatchOutputConfig cloudWatchOutputConfig;
/**
*
* The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.
*
*/
private String documentHash;
/**
*
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
*
*/
private String documentHashType;
/**
*
* The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify
* $DEFAULT
, $LATEST
, or a specific version number. If you run commands by using the
* Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a
* version number, then you don't need to use the backslash. For example:
*
*
* --document-version "\$DEFAULT"
*
*
* --document-version "\$LATEST"
*
*
* --document-version "3"
*
*/
private String documentVersion;
/**
*
* Configurations for sending notifications about command status changes on a per-managed node basis.
*
*/
private NotificationConfig notificationConfig;
/**
*
* The name of the Amazon Simple Storage Service (Amazon S3) bucket.
*
*/
private String outputS3BucketName;
/**
*
* The S3 bucket subfolder.
*
*/
private String outputS3KeyPrefix;
/**
*
* The parameters for the RUN_COMMAND
task execution.
*
*/
private java.util.Map> parameters;
/**
*
* The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon
* Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
*
*/
private String serviceRoleArn;
/**
*
* If this time is reached and the command hasn't already started running, it doesn't run.
*
*/
private Integer timeoutSeconds;
/**
*
* Information about the commands to run.
*
*
* @param comment
* Information about the commands to run.
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
*
* Information about the commands to run.
*
*
* @return Information about the commands to run.
*/
public String getComment() {
return this.comment;
}
/**
*
* Information about the commands to run.
*
*
* @param comment
* Information about the commands to run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withComment(String comment) {
setComment(comment);
return this;
}
/**
* @param cloudWatchOutputConfig
*/
public void setCloudWatchOutputConfig(CloudWatchOutputConfig cloudWatchOutputConfig) {
this.cloudWatchOutputConfig = cloudWatchOutputConfig;
}
/**
* @return
*/
public CloudWatchOutputConfig getCloudWatchOutputConfig() {
return this.cloudWatchOutputConfig;
}
/**
* @param cloudWatchOutputConfig
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withCloudWatchOutputConfig(CloudWatchOutputConfig cloudWatchOutputConfig) {
setCloudWatchOutputConfig(cloudWatchOutputConfig);
return this;
}
/**
*
* The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.
*
*
* @param documentHash
* The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been
* deprecated.
*/
public void setDocumentHash(String documentHash) {
this.documentHash = documentHash;
}
/**
*
* The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.
*
*
* @return The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been
* deprecated.
*/
public String getDocumentHash() {
return this.documentHash;
}
/**
*
* The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.
*
*
* @param documentHash
* The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been
* deprecated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withDocumentHash(String documentHash) {
setDocumentHash(documentHash);
return this;
}
/**
*
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
*
*
* @param documentHashType
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
* @see DocumentHashType
*/
public void setDocumentHashType(String documentHashType) {
this.documentHashType = documentHashType;
}
/**
*
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
*
*
* @return SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
* @see DocumentHashType
*/
public String getDocumentHashType() {
return this.documentHashType;
}
/**
*
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
*
*
* @param documentHashType
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DocumentHashType
*/
public MaintenanceWindowRunCommandParameters withDocumentHashType(String documentHashType) {
setDocumentHashType(documentHashType);
return this;
}
/**
*
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
*
*
* @param documentHashType
* SHA-256 or SHA-1. SHA-1 hashes have been deprecated.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DocumentHashType
*/
public MaintenanceWindowRunCommandParameters withDocumentHashType(DocumentHashType documentHashType) {
this.documentHashType = documentHashType.toString();
return this;
}
/**
*
* The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify
* $DEFAULT
, $LATEST
, or a specific version number. If you run commands by using the
* Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a
* version number, then you don't need to use the backslash. For example:
*
*
* --document-version "\$DEFAULT"
*
*
* --document-version "\$LATEST"
*
*
* --document-version "3"
*
*
* @param documentVersion
* The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can
* specify $DEFAULT
, $LATEST
, or a specific version number. If you run commands by
* using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you
* specify a version number, then you don't need to use the backslash. For example:
*
* --document-version "\$DEFAULT"
*
*
* --document-version "\$LATEST"
*
*
* --document-version "3"
*/
public void setDocumentVersion(String documentVersion) {
this.documentVersion = documentVersion;
}
/**
*
* The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify
* $DEFAULT
, $LATEST
, or a specific version number. If you run commands by using the
* Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a
* version number, then you don't need to use the backslash. For example:
*
*
* --document-version "\$DEFAULT"
*
*
* --document-version "\$LATEST"
*
*
* --document-version "3"
*
*
* @return The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can
* specify $DEFAULT
, $LATEST
, or a specific version number. If you run commands by
* using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If
* you specify a version number, then you don't need to use the backslash. For example:
*
* --document-version "\$DEFAULT"
*
*
* --document-version "\$LATEST"
*
*
* --document-version "3"
*/
public String getDocumentVersion() {
return this.documentVersion;
}
/**
*
* The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify
* $DEFAULT
, $LATEST
, or a specific version number. If you run commands by using the
* Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a
* version number, then you don't need to use the backslash. For example:
*
*
* --document-version "\$DEFAULT"
*
*
* --document-version "\$LATEST"
*
*
* --document-version "3"
*
*
* @param documentVersion
* The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can
* specify $DEFAULT
, $LATEST
, or a specific version number. If you run commands by
* using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you
* specify a version number, then you don't need to use the backslash. For example:
*
* --document-version "\$DEFAULT"
*
*
* --document-version "\$LATEST"
*
*
* --document-version "3"
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withDocumentVersion(String documentVersion) {
setDocumentVersion(documentVersion);
return this;
}
/**
*
* Configurations for sending notifications about command status changes on a per-managed node basis.
*
*
* @param notificationConfig
* Configurations for sending notifications about command status changes on a per-managed node basis.
*/
public void setNotificationConfig(NotificationConfig notificationConfig) {
this.notificationConfig = notificationConfig;
}
/**
*
* Configurations for sending notifications about command status changes on a per-managed node basis.
*
*
* @return Configurations for sending notifications about command status changes on a per-managed node basis.
*/
public NotificationConfig getNotificationConfig() {
return this.notificationConfig;
}
/**
*
* Configurations for sending notifications about command status changes on a per-managed node basis.
*
*
* @param notificationConfig
* Configurations for sending notifications about command status changes on a per-managed node basis.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withNotificationConfig(NotificationConfig notificationConfig) {
setNotificationConfig(notificationConfig);
return this;
}
/**
*
* The name of the Amazon Simple Storage Service (Amazon S3) bucket.
*
*
* @param outputS3BucketName
* The name of the Amazon Simple Storage Service (Amazon S3) bucket.
*/
public void setOutputS3BucketName(String outputS3BucketName) {
this.outputS3BucketName = outputS3BucketName;
}
/**
*
* The name of the Amazon Simple Storage Service (Amazon S3) bucket.
*
*
* @return The name of the Amazon Simple Storage Service (Amazon S3) bucket.
*/
public String getOutputS3BucketName() {
return this.outputS3BucketName;
}
/**
*
* The name of the Amazon Simple Storage Service (Amazon S3) bucket.
*
*
* @param outputS3BucketName
* The name of the Amazon Simple Storage Service (Amazon S3) bucket.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withOutputS3BucketName(String outputS3BucketName) {
setOutputS3BucketName(outputS3BucketName);
return this;
}
/**
*
* The S3 bucket subfolder.
*
*
* @param outputS3KeyPrefix
* The S3 bucket subfolder.
*/
public void setOutputS3KeyPrefix(String outputS3KeyPrefix) {
this.outputS3KeyPrefix = outputS3KeyPrefix;
}
/**
*
* The S3 bucket subfolder.
*
*
* @return The S3 bucket subfolder.
*/
public String getOutputS3KeyPrefix() {
return this.outputS3KeyPrefix;
}
/**
*
* The S3 bucket subfolder.
*
*
* @param outputS3KeyPrefix
* The S3 bucket subfolder.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withOutputS3KeyPrefix(String outputS3KeyPrefix) {
setOutputS3KeyPrefix(outputS3KeyPrefix);
return this;
}
/**
*
* The parameters for the RUN_COMMAND
task execution.
*
*
* @return The parameters for the RUN_COMMAND
task execution.
*/
public java.util.Map> getParameters() {
return parameters;
}
/**
*
* The parameters for the RUN_COMMAND
task execution.
*
*
* @param parameters
* The parameters for the RUN_COMMAND
task execution.
*/
public void setParameters(java.util.Map> parameters) {
this.parameters = parameters;
}
/**
*
* The parameters for the RUN_COMMAND
task execution.
*
*
* @param parameters
* The parameters for the RUN_COMMAND
task execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withParameters(java.util.Map> parameters) {
setParameters(parameters);
return this;
}
/**
* Add a single Parameters entry
*
* @see MaintenanceWindowRunCommandParameters#withParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters addParametersEntry(String key, java.util.List value) {
if (null == this.parameters) {
this.parameters = new java.util.HashMap>();
}
if (this.parameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.parameters.put(key, value);
return this;
}
/**
* Removes all the entries added into Parameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters clearParametersEntries() {
this.parameters = null;
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon
* Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
*
*
* @param serviceRoleArn
* The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish
* Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
*/
public void setServiceRoleArn(String serviceRoleArn) {
this.serviceRoleArn = serviceRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon
* Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
*
*
* @return The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish
* Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
*/
public String getServiceRoleArn() {
return this.serviceRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon
* Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
*
*
* @param serviceRoleArn
* The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish
* Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withServiceRoleArn(String serviceRoleArn) {
setServiceRoleArn(serviceRoleArn);
return this;
}
/**
*
* If this time is reached and the command hasn't already started running, it doesn't run.
*
*
* @param timeoutSeconds
* If this time is reached and the command hasn't already started running, it doesn't run.
*/
public void setTimeoutSeconds(Integer timeoutSeconds) {
this.timeoutSeconds = timeoutSeconds;
}
/**
*
* If this time is reached and the command hasn't already started running, it doesn't run.
*
*
* @return If this time is reached and the command hasn't already started running, it doesn't run.
*/
public Integer getTimeoutSeconds() {
return this.timeoutSeconds;
}
/**
*
* If this time is reached and the command hasn't already started running, it doesn't run.
*
*
* @param timeoutSeconds
* If this time is reached and the command hasn't already started running, it doesn't run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MaintenanceWindowRunCommandParameters withTimeoutSeconds(Integer timeoutSeconds) {
setTimeoutSeconds(timeoutSeconds);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getComment() != null)
sb.append("Comment: ").append(getComment()).append(",");
if (getCloudWatchOutputConfig() != null)
sb.append("CloudWatchOutputConfig: ").append(getCloudWatchOutputConfig()).append(",");
if (getDocumentHash() != null)
sb.append("DocumentHash: ").append(getDocumentHash()).append(",");
if (getDocumentHashType() != null)
sb.append("DocumentHashType: ").append(getDocumentHashType()).append(",");
if (getDocumentVersion() != null)
sb.append("DocumentVersion: ").append(getDocumentVersion()).append(",");
if (getNotificationConfig() != null)
sb.append("NotificationConfig: ").append(getNotificationConfig()).append(",");
if (getOutputS3BucketName() != null)
sb.append("OutputS3BucketName: ").append(getOutputS3BucketName()).append(",");
if (getOutputS3KeyPrefix() != null)
sb.append("OutputS3KeyPrefix: ").append(getOutputS3KeyPrefix()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append("***Sensitive Data Redacted***").append(",");
if (getServiceRoleArn() != null)
sb.append("ServiceRoleArn: ").append(getServiceRoleArn()).append(",");
if (getTimeoutSeconds() != null)
sb.append("TimeoutSeconds: ").append(getTimeoutSeconds());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof MaintenanceWindowRunCommandParameters == false)
return false;
MaintenanceWindowRunCommandParameters other = (MaintenanceWindowRunCommandParameters) obj;
if (other.getComment() == null ^ this.getComment() == null)
return false;
if (other.getComment() != null && other.getComment().equals(this.getComment()) == false)
return false;
if (other.getCloudWatchOutputConfig() == null ^ this.getCloudWatchOutputConfig() == null)
return false;
if (other.getCloudWatchOutputConfig() != null && other.getCloudWatchOutputConfig().equals(this.getCloudWatchOutputConfig()) == false)
return false;
if (other.getDocumentHash() == null ^ this.getDocumentHash() == null)
return false;
if (other.getDocumentHash() != null && other.getDocumentHash().equals(this.getDocumentHash()) == false)
return false;
if (other.getDocumentHashType() == null ^ this.getDocumentHashType() == null)
return false;
if (other.getDocumentHashType() != null && other.getDocumentHashType().equals(this.getDocumentHashType()) == false)
return false;
if (other.getDocumentVersion() == null ^ this.getDocumentVersion() == null)
return false;
if (other.getDocumentVersion() != null && other.getDocumentVersion().equals(this.getDocumentVersion()) == false)
return false;
if (other.getNotificationConfig() == null ^ this.getNotificationConfig() == null)
return false;
if (other.getNotificationConfig() != null && other.getNotificationConfig().equals(this.getNotificationConfig()) == false)
return false;
if (other.getOutputS3BucketName() == null ^ this.getOutputS3BucketName() == null)
return false;
if (other.getOutputS3BucketName() != null && other.getOutputS3BucketName().equals(this.getOutputS3BucketName()) == false)
return false;
if (other.getOutputS3KeyPrefix() == null ^ this.getOutputS3KeyPrefix() == null)
return false;
if (other.getOutputS3KeyPrefix() != null && other.getOutputS3KeyPrefix().equals(this.getOutputS3KeyPrefix()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
if (other.getServiceRoleArn() == null ^ this.getServiceRoleArn() == null)
return false;
if (other.getServiceRoleArn() != null && other.getServiceRoleArn().equals(this.getServiceRoleArn()) == false)
return false;
if (other.getTimeoutSeconds() == null ^ this.getTimeoutSeconds() == null)
return false;
if (other.getTimeoutSeconds() != null && other.getTimeoutSeconds().equals(this.getTimeoutSeconds()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode());
hashCode = prime * hashCode + ((getCloudWatchOutputConfig() == null) ? 0 : getCloudWatchOutputConfig().hashCode());
hashCode = prime * hashCode + ((getDocumentHash() == null) ? 0 : getDocumentHash().hashCode());
hashCode = prime * hashCode + ((getDocumentHashType() == null) ? 0 : getDocumentHashType().hashCode());
hashCode = prime * hashCode + ((getDocumentVersion() == null) ? 0 : getDocumentVersion().hashCode());
hashCode = prime * hashCode + ((getNotificationConfig() == null) ? 0 : getNotificationConfig().hashCode());
hashCode = prime * hashCode + ((getOutputS3BucketName() == null) ? 0 : getOutputS3BucketName().hashCode());
hashCode = prime * hashCode + ((getOutputS3KeyPrefix() == null) ? 0 : getOutputS3KeyPrefix().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
hashCode = prime * hashCode + ((getServiceRoleArn() == null) ? 0 : getServiceRoleArn().hashCode());
hashCode = prime * hashCode + ((getTimeoutSeconds() == null) ? 0 : getTimeoutSeconds().hashCode());
return hashCode;
}
@Override
public MaintenanceWindowRunCommandParameters clone() {
try {
return (MaintenanceWindowRunCommandParameters) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.simplesystemsmanagement.model.transform.MaintenanceWindowRunCommandParametersMarshaller.getInstance().marshall(this,
protocolMarshaller);
}
}