com.aliyun.sdk.service.ecs20140526.models.InvokeCommandRequest Maven / Gradle / Ivy
Show all versions of alibabacloud-ecs20140526 Show documentation
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.ecs20140526.models;
import com.aliyun.core.annotation.*;
import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
* {@link InvokeCommandRequest} extends {@link RequestModel}
*
* InvokeCommandRequest
*/
public class InvokeCommandRequest extends Request {
@Host
@NameInMap("SourceRegionId")
private String sourceRegionId;
@Query
@NameInMap("ClientToken")
private String clientToken;
@Query
@NameInMap("CommandId")
@Validation(required = true)
private String commandId;
@Query
@NameInMap("ContainerId")
private String containerId;
@Query
@NameInMap("ContainerName")
private String containerName;
@Query
@NameInMap("Frequency")
private String frequency;
@Query
@NameInMap("InstanceId")
private java.util.List < String > instanceId;
@Query
@NameInMap("OwnerAccount")
private String ownerAccount;
@Query
@NameInMap("OwnerId")
private Long ownerId;
@Query
@NameInMap("Parameters")
private java.util.Map < String, ? > parameters;
@Query
@NameInMap("RegionId")
@Validation(required = true)
private String regionId;
@Query
@NameInMap("RepeatMode")
private String repeatMode;
@Query
@NameInMap("ResourceGroupId")
private String resourceGroupId;
@Query
@NameInMap("ResourceOwnerAccount")
private String resourceOwnerAccount;
@Query
@NameInMap("ResourceOwnerId")
private Long resourceOwnerId;
@Query
@NameInMap("ResourceTag")
private java.util.List < ResourceTag> resourceTag;
@Query
@NameInMap("Tag")
private java.util.List < Tag> tag;
@Query
@NameInMap("Timed")
private Boolean timed;
@Query
@NameInMap("Timeout")
private Long timeout;
@Query
@NameInMap("Username")
private String username;
@Query
@NameInMap("WindowsPasswordName")
private String windowsPasswordName;
private InvokeCommandRequest(Builder builder) {
super(builder);
this.sourceRegionId = builder.sourceRegionId;
this.clientToken = builder.clientToken;
this.commandId = builder.commandId;
this.containerId = builder.containerId;
this.containerName = builder.containerName;
this.frequency = builder.frequency;
this.instanceId = builder.instanceId;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.parameters = builder.parameters;
this.regionId = builder.regionId;
this.repeatMode = builder.repeatMode;
this.resourceGroupId = builder.resourceGroupId;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.resourceTag = builder.resourceTag;
this.tag = builder.tag;
this.timed = builder.timed;
this.timeout = builder.timeout;
this.username = builder.username;
this.windowsPasswordName = builder.windowsPasswordName;
}
public static Builder builder() {
return new Builder();
}
public static InvokeCommandRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return sourceRegionId
*/
public String getSourceRegionId() {
return this.sourceRegionId;
}
/**
* @return clientToken
*/
public String getClientToken() {
return this.clientToken;
}
/**
* @return commandId
*/
public String getCommandId() {
return this.commandId;
}
/**
* @return containerId
*/
public String getContainerId() {
return this.containerId;
}
/**
* @return containerName
*/
public String getContainerName() {
return this.containerName;
}
/**
* @return frequency
*/
public String getFrequency() {
return this.frequency;
}
/**
* @return instanceId
*/
public java.util.List < String > getInstanceId() {
return this.instanceId;
}
/**
* @return ownerAccount
*/
public String getOwnerAccount() {
return this.ownerAccount;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @return parameters
*/
public java.util.Map < String, ? > getParameters() {
return this.parameters;
}
/**
* @return regionId
*/
public String getRegionId() {
return this.regionId;
}
/**
* @return repeatMode
*/
public String getRepeatMode() {
return this.repeatMode;
}
/**
* @return resourceGroupId
*/
public String getResourceGroupId() {
return this.resourceGroupId;
}
/**
* @return resourceOwnerAccount
*/
public String getResourceOwnerAccount() {
return this.resourceOwnerAccount;
}
/**
* @return resourceOwnerId
*/
public Long getResourceOwnerId() {
return this.resourceOwnerId;
}
/**
* @return resourceTag
*/
public java.util.List < ResourceTag> getResourceTag() {
return this.resourceTag;
}
/**
* @return tag
*/
public java.util.List < Tag> getTag() {
return this.tag;
}
/**
* @return timed
*/
public Boolean getTimed() {
return this.timed;
}
/**
* @return timeout
*/
public Long getTimeout() {
return this.timeout;
}
/**
* @return username
*/
public String getUsername() {
return this.username;
}
/**
* @return windowsPasswordName
*/
public String getWindowsPasswordName() {
return this.windowsPasswordName;
}
public static final class Builder extends Request.Builder {
private String sourceRegionId;
private String clientToken;
private String commandId;
private String containerId;
private String containerName;
private String frequency;
private java.util.List < String > instanceId;
private String ownerAccount;
private Long ownerId;
private java.util.Map < String, ? > parameters;
private String regionId;
private String repeatMode;
private String resourceGroupId;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private java.util.List < ResourceTag> resourceTag;
private java.util.List < Tag> tag;
private Boolean timed;
private Long timeout;
private String username;
private String windowsPasswordName;
private Builder() {
super();
}
private Builder(InvokeCommandRequest request) {
super(request);
this.sourceRegionId = request.sourceRegionId;
this.clientToken = request.clientToken;
this.commandId = request.commandId;
this.containerId = request.containerId;
this.containerName = request.containerName;
this.frequency = request.frequency;
this.instanceId = request.instanceId;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.parameters = request.parameters;
this.regionId = request.regionId;
this.repeatMode = request.repeatMode;
this.resourceGroupId = request.resourceGroupId;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.resourceTag = request.resourceTag;
this.tag = request.tag;
this.timed = request.timed;
this.timeout = request.timeout;
this.username = request.username;
this.windowsPasswordName = request.windowsPasswordName;
}
/**
* SourceRegionId.
*/
public Builder sourceRegionId(String sourceRegionId) {
this.putHostParameter("SourceRegionId", sourceRegionId);
this.sourceRegionId = sourceRegionId;
return this;
}
/**
* The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see [How to ensure idempotence](~~25693~~).
*/
public Builder clientToken(String clientToken) {
this.putQueryParameter("ClientToken", clientToken);
this.clientToken = clientToken;
return this;
}
/**
* The command ID. You can call the [DescribeCommands](~~64843~~) operation to query all available command IDs.
*
*
* > Common Cloud Assistant commands can be run based on their names. For more information, see [View and run common Cloud Assistant commands](~~429635~~).
*/
public Builder commandId(String commandId) {
this.putQueryParameter("CommandId", commandId);
this.commandId = commandId;
return this;
}
/**
* The ID of the container. Only 64-bit hexadecimal strings are supported. You can use container IDs that are prefixed with `docker://`, `containerd://`, or `cri-o://` to specify container runtimes.
*
*
* Take note of the following items:
*
* * If you specify this parameter, Cloud Assistant runs scripts in the specified container of the instance.
*
* * If you specify this parameter, make sure that the version of Cloud Assistant Agent installed on Linux instances is 2.2.3.344 or later.
*
* * For information about how to query the version of Cloud Assistant Agent, see [Install Cloud Assistant Agent](~~64921~~).
* * For information about how to upgrade Cloud Assistant Agent, see [Upgrade or disable upgrades for Cloud Assistant Agent](~~134383~~).
*
* * If you specify this parameter, `Username` that is specified in a request to call this operation and `WorkingDir` that is specified in a request to call the [CreateCommand](~~64844~~) operation do not take effect. You can run the command only in the default working directory of the container by using the default user of the container. For more information, see [Use Cloud Assistant to run commands in containers](~~456641~~).
*
* * If you specify this parameter, only shell scripts can be run in Linux containers. You cannot add a command in the format similar to `#!/usr/bin/python` at the beginning of a script to specify a script interpreter. For more information, see [Use Cloud Assistant to run commands in containers](~~456641~~).
*/
public Builder containerId(String containerId) {
this.putQueryParameter("ContainerId", containerId);
this.containerId = containerId;
return this;
}
/**
* The name of the container.
*
*
* Take note of the following items:
*
* * If you specify this parameter, Cloud Assistant runs scripts in the specified container of the instance.
*
* * If you specify this parameter, make sure that the version of Cloud Assistant Agent installed on Linux instances is 2.2.3.344 or later.
*
* * For information about how to query the version of Cloud Assistant Agent, see [Install Cloud Assistant Agent](~~64921~~).
* * For information about how to upgrade Cloud Assistant Agent, see [Upgrade or disable upgrades for Cloud Assistant Agent](~~134383~~).
*
* * If this parameter is specified, the `Username` parameters specified in this interface and the `WorkingDir` parameters specified in [CreateCommand](~~64844~~) do not take effect. You can run the command only in the default working directory of the container by using the default user of the container. For more information, see [Use Cloud Assistant to run commands in containers](~~456641~~).
*
* * If you specify this parameter, only shell scripts can be run in Linux containers. You cannot add a command in the format similar to `#!/usr/bin/python` at the beginning of a script to specify a script interpreter. For more information, see [Use Cloud Assistant to run commands in containers](~~456641~~).
*/
public Builder containerName(String containerName) {
this.putQueryParameter("ContainerName", containerName);
this.containerName = containerName;
return this;
}
/**
* The schedule on which the command is run. You can configure a command to run at a fixed interval based on a rate expression, run only once at a specified time, or run at designated times based on a cron expression.
*
*
* * To run the command at a fixed interval, use a rate expression to specify the interval. You can specify the interval in seconds, minutes, hours, or days. This option is suitable for scenarios in which the command needs to be run at a fixed interval. Specify the interval in the following format: `rate()`. For example, specify `rate(5m)` to run the command every 5 minutes. When you specify an interval, take note of the following limits:
*
* * The interval can be anywhere from 60 seconds to 7 days, and must be longer than the timeout period for executions of the command.
* * The interval is the amount of time that elapses between two consecutive executions. The interval is irrelevant to the amount of time that is required to run the command once. For example, you set the interval to 5 minutes and the command requires 2 minutes to run once. Each time the command is run, the system waits 3 minutes before it runs the command again.
* * A task is not run immediately after it is created. For example, you configure the command to run at an interval of 5 minutes. The command begins to run 5 minutes after it is created.
*
* * To run a command only once at a specific time, specify a point in time and a time zone. Specify the point in time in the `at(yyyy-MM-dd HH:mm:ss