All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.sdk.service.ecs20140526.models.CreateCommandRequest Maven / Gradle / Ivy

// 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 CreateCommandRequest} extends {@link RequestModel}
 *
 * 

CreateCommandRequest

*/ public class CreateCommandRequest extends Request { @Host @NameInMap("SourceRegionId") private String sourceRegionId; @Query @NameInMap("CommandContent") @Validation(required = true) private String commandContent; @Query @NameInMap("ContentEncoding") private String contentEncoding; @Query @NameInMap("Description") private String description; @Query @NameInMap("EnableParameter") private Boolean enableParameter; @Query @NameInMap("Name") @Validation(required = true) private String name; @Query @NameInMap("OwnerAccount") private String ownerAccount; @Query @NameInMap("OwnerId") private Long ownerId; @Query @NameInMap("RegionId") @Validation(required = true) private String regionId; @Query @NameInMap("ResourceOwnerAccount") private String resourceOwnerAccount; @Query @NameInMap("ResourceOwnerId") private Long resourceOwnerId; @Query @NameInMap("Tag") private java.util.List < Tag> tag; @Query @NameInMap("Timeout") private Long timeout; @Query @NameInMap("Type") @Validation(required = true) private String type; @Query @NameInMap("WorkingDir") private String workingDir; private CreateCommandRequest(Builder builder) { super(builder); this.sourceRegionId = builder.sourceRegionId; this.commandContent = builder.commandContent; this.contentEncoding = builder.contentEncoding; this.description = builder.description; this.enableParameter = builder.enableParameter; this.name = builder.name; this.ownerAccount = builder.ownerAccount; this.ownerId = builder.ownerId; this.regionId = builder.regionId; this.resourceOwnerAccount = builder.resourceOwnerAccount; this.resourceOwnerId = builder.resourceOwnerId; this.tag = builder.tag; this.timeout = builder.timeout; this.type = builder.type; this.workingDir = builder.workingDir; } public static Builder builder() { return new Builder(); } public static CreateCommandRequest create() { return builder().build(); } @Override public Builder toBuilder() { return new Builder(this); } /** * @return sourceRegionId */ public String getSourceRegionId() { return this.sourceRegionId; } /** * @return commandContent */ public String getCommandContent() { return this.commandContent; } /** * @return contentEncoding */ public String getContentEncoding() { return this.contentEncoding; } /** * @return description */ public String getDescription() { return this.description; } /** * @return enableParameter */ public Boolean getEnableParameter() { return this.enableParameter; } /** * @return name */ public String getName() { return this.name; } /** * @return ownerAccount */ public String getOwnerAccount() { return this.ownerAccount; } /** * @return ownerId */ public Long getOwnerId() { return this.ownerId; } /** * @return regionId */ public String getRegionId() { return this.regionId; } /** * @return resourceOwnerAccount */ public String getResourceOwnerAccount() { return this.resourceOwnerAccount; } /** * @return resourceOwnerId */ public Long getResourceOwnerId() { return this.resourceOwnerId; } /** * @return tag */ public java.util.List < Tag> getTag() { return this.tag; } /** * @return timeout */ public Long getTimeout() { return this.timeout; } /** * @return type */ public String getType() { return this.type; } /** * @return workingDir */ public String getWorkingDir() { return this.workingDir; } public static final class Builder extends Request.Builder { private String sourceRegionId; private String commandContent; private String contentEncoding; private String description; private Boolean enableParameter; private String name; private String ownerAccount; private Long ownerId; private String regionId; private String resourceOwnerAccount; private Long resourceOwnerId; private java.util.List < Tag> tag; private Long timeout; private String type; private String workingDir; private Builder() { super(); } private Builder(CreateCommandRequest request) { super(request); this.sourceRegionId = request.sourceRegionId; this.commandContent = request.commandContent; this.contentEncoding = request.contentEncoding; this.description = request.description; this.enableParameter = request.enableParameter; this.name = request.name; this.ownerAccount = request.ownerAccount; this.ownerId = request.ownerId; this.regionId = request.regionId; this.resourceOwnerAccount = request.resourceOwnerAccount; this.resourceOwnerId = request.resourceOwnerId; this.tag = request.tag; this.timeout = request.timeout; this.type = request.type; this.workingDir = request.workingDir; } /** * SourceRegionId. */ public Builder sourceRegionId(String sourceRegionId) { this.putHostParameter("SourceRegionId", sourceRegionId); this.sourceRegionId = sourceRegionId; return this; } /** * The working directory of the command on the instance. *

* * Default value: * * * For Linux instances, the default value is the home directory of the root user, which is the `/root` directory. * * For Windows instances, the default value is the directory where the Cloud Assistant client process resides. Example: `C:\Windows\System32\`. */ public Builder commandContent(String commandContent) { this.putQueryParameter("CommandContent", commandContent); this.commandContent = commandContent; return this; } /** * The tags to add to the command. */ public Builder contentEncoding(String contentEncoding) { this.putQueryParameter("ContentEncoding", contentEncoding); this.contentEncoding = contentEncoding; return this; } /** * The command type. Valid values: *

* * * RunBatScript: batch commands. These commands are applicable to Windows instances. * * RunPowerShellScript: PowerShell commands. These commands are applicable to Windows instances. * * RunShellScript: shell commands. These commands are applicable to Linux instances. */ public Builder description(String description) { this.putQueryParameter("Description", description); this.description = description; return this; } /** * The encoding mode of the command content (CommandContent). Valid values: *

* * * PlainText: The command content is not encoded. * * Base64: The command content is Base64-encoded. * * Default value: Base64. * * > If the specified value of this parameter is invalid, Base64 is used by default. */ public Builder enableParameter(Boolean enableParameter) { this.putQueryParameter("EnableParameter", enableParameter); this.enableParameter = enableParameter; return this; } /** * The description of the command. The description supports all character sets and can be up to 512 characters in length. */ public Builder name(String name) { this.putQueryParameter("Name", name); this.name = name; return this; } /** * OwnerAccount. */ public Builder ownerAccount(String ownerAccount) { this.putQueryParameter("OwnerAccount", ownerAccount); this.ownerAccount = ownerAccount; return this; } /** * OwnerId. */ public Builder ownerId(Long ownerId) { this.putQueryParameter("OwnerId", ownerId); this.ownerId = ownerId; return this; } /** * The name of the command. The name supports all character sets and can be up to 128 characters in length. */ public Builder regionId(String regionId) { this.putQueryParameter("RegionId", regionId); this.regionId = regionId; return this; } /** * ResourceOwnerAccount. */ public Builder resourceOwnerAccount(String resourceOwnerAccount) { this.putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount); this.resourceOwnerAccount = resourceOwnerAccount; return this; } /** * ResourceOwnerId. */ public Builder resourceOwnerId(Long resourceOwnerId) { this.putQueryParameter("ResourceOwnerId", resourceOwnerId); this.resourceOwnerId = resourceOwnerId; return this; } /** * Tag N to add to the command. */ public Builder tag(java.util.List < Tag> tag) { this.putQueryParameter("Tag", tag); this.tag = tag; return this; } /** * Specifies whether to use custom parameters in the command. *

* * Default value: false. */ public Builder timeout(Long timeout) { this.putQueryParameter("Timeout", timeout); this.timeout = timeout; return this; } /** * The Base64-encoded content of the command. *

* * * The parameter value must be Base64-encoded and cannot exceed 18 KB in size. * * * Custom parameters can be added to the command. To enable the custom parameter feature, you must set `EnableParameter` to true. * * * Custom parameters are defined in the `{{}}` format. Within `{{}}`, the spaces and line feeds before and after the parameter names are ignored. * * The number of custom parameters cannot exceed 20. * * A custom parameter name can contain only letters, digits, underscores (\_), and hyphens (-). The name is case-insensitive. * * Each custom parameter name cannot exceed 64 bytes in length. * * * You can specify built-in environment parameters as custom parameters. Then, when you run the command, these parameters are automatically specified by Cloud Assistant. You can specify the following built-in environment parameters: * * * `{{ACS::RegionId}}`: the ID of the region. * * * `{{ACS::AccountId}}`: the UID of the Alibaba Cloud account. * * * `{{ACS::InstanceId}}`: the ID of the instance. When the command is run on multiple instances, if you want to specify `{{ACS::InstanceId}}` as a built-in environment variable, make sure that the version of the Cloud Assistant client is not earlier than the following ones: * * * Linux: 2.2.3.309 * * Windows: 2.1.3.309 * * * `{{ACS::InstanceName}}`: the name of the instance. If you want to run the command on multiple instances and specify `{{ACS::InstanceName}}` as a built-in environment parameter, make sure that the version of the Cloud Assistant client is not earlier than the following ones: * * * Linux: 2.2.3.344 * * Windows: 2.1.3.344 * * * `{{ACS::InvokeId}}`: the ID of the command task. If you want to specify `{{ACS::InvokeId}}` as a built-in environment variable, make sure that the version of the Cloud Assistant client is not earlier than the following one: * * * Linux: 2.2.3.309 * * Windows: 2.1.3.309 * * * `{{ACS::CommandId}}`: the ID of the command. When you call the [RunCommand](~~141751~~) operation, if you want to specify `{{ACS::CommandId}}` as a built-in environment parameter, make sure that the version of the Cloud Assistant client is not earlier than the following ones: * * * Linux: 2.2.3.309 * * Windows: 2.1.3.309 */ public Builder type(String type) { this.putQueryParameter("Type", type); this.type = type; return this; } /** * /root/ */ public Builder workingDir(String workingDir) { this.putQueryParameter("WorkingDir", workingDir); this.workingDir = workingDir; return this; } @Override public CreateCommandRequest build() { return new CreateCommandRequest(this); } } public static class Tag extends TeaModel { @NameInMap("Key") private String key; @NameInMap("Value") private String value; private Tag(Builder builder) { this.key = builder.key; this.value = builder.value; } public static Builder builder() { return new Builder(); } public static Tag create() { return builder().build(); } /** * @return key */ public String getKey() { return this.key; } /** * @return value */ public String getValue() { return this.value; } public static final class Builder { private String key; private String value; /** * The value of tag N. Valid values of N: 1 to 20. The tag value can be an empty string. *

* * It can be up to 128 characters in length and cannot contain `http://` or `https://`. */ public Builder key(String key) { this.key = key; return this; } /** * The ID of the command. */ public Builder value(String value) { this.value = value; return this; } public Tag build() { return new Tag(this); } } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy