public static final class CreateCommandRequest.Builder extends Object
限定符和类型 | 方法和说明 |
---|---|
CreateCommandRequest |
build() |
CreateCommandRequest.Builder |
commandContent(String commandContent)
The Base64-encoded content of the command.
|
CreateCommandRequest.Builder |
contentEncoding(String contentEncoding)
The encoding mode of the command content (CommandContent).
|
CreateCommandRequest.Builder |
description(String description)
The description of the command.
|
CreateCommandRequest.Builder |
enableParameter(Boolean enableParameter)
Specifies whether to use custom parameters in the command.
|
CreateCommandRequest.Builder |
name(String name)
The name of the command.
|
CreateCommandRequest.Builder |
ownerAccount(String ownerAccount)
OwnerAccount.
|
CreateCommandRequest.Builder |
ownerId(Long ownerId)
OwnerId.
|
CreateCommandRequest.Builder |
regionId(String regionId)
The ID of the region in which to create the command.
|
CreateCommandRequest.Builder |
resourceOwnerAccount(String resourceOwnerAccount)
ResourceOwnerAccount.
|
CreateCommandRequest.Builder |
resourceOwnerId(Long resourceOwnerId)
ResourceOwnerId.
|
CreateCommandRequest.Builder |
sourceRegionId(String sourceRegionId)
SourceRegionId.
|
CreateCommandRequest.Builder |
tag(List<CreateCommandRequest.Tag> tag)
The tags to add to the command.
|
CreateCommandRequest.Builder |
timeout(Long timeout)
The maximum timeout period for the command execution on the instance.
|
CreateCommandRequest.Builder |
type(String type)
The command type.
|
CreateCommandRequest.Builder |
workingDir(String workingDir)
The working directory of the command on the instance.
|
public CreateCommandRequest.Builder sourceRegionId(String sourceRegionId)
public CreateCommandRequest.Builder commandContent(String commandContent)
* 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 CreateCommandRequest.Builder contentEncoding(String contentEncoding)
* 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 CreateCommandRequest.Builder description(String description)
public CreateCommandRequest.Builder enableParameter(Boolean enableParameter)
Default value: false.
public CreateCommandRequest.Builder name(String name)
public CreateCommandRequest.Builder ownerAccount(String ownerAccount)
public CreateCommandRequest.Builder ownerId(Long ownerId)
public CreateCommandRequest.Builder regionId(String regionId)
public CreateCommandRequest.Builder resourceOwnerAccount(String resourceOwnerAccount)
public CreateCommandRequest.Builder resourceOwnerId(Long resourceOwnerId)
public CreateCommandRequest.Builder tag(List<CreateCommandRequest.Tag> tag)
public CreateCommandRequest.Builder timeout(Long timeout)
Default value: 60.
public CreateCommandRequest.Builder type(String type)
* 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 CreateCommandRequest.Builder workingDir(String workingDir)
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 CreateCommandRequest build()
Copyright © 2023. All rights reserved.