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 |
resourceGroupId(String resourceGroupId)
The ID of the resource group to which to assign 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)
he maximum timeout period for the command execution on the instance.
|
CreateCommandRequest.Builder |
type(String type)
The command type.
|
CreateCommandRequest.Builder |
workingDir(String workingDir)
The execution path of the command on ECS instances.
|
public CreateCommandRequest.Builder sourceRegionId(String sourceRegionId)
public CreateCommandRequest.Builder commandContent(String commandContent)
* The value must be Base64-encoded and cannot exceed 18 KB in size. * You can use custom parameters in the command content. 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. * You can specify up to 20 custom parameters. * A custom parameter name can contain only letters, digits, underscores (\_), and hyphens (-). The name is case-insensitive. The ACS:: prefix cannot be used to specify non-built-in environment parameters. * Each custom parameter name can be up to 64 bytes in length. * You can specify built-in environment parameters as custom parameters in a command. When you run the command, Cloud Assistant automatically uses the environment parameter values for the custom parameters. You can specify the following built-in environment variables: * `{{ACS::RegionId}}`: the region ID. * `{{ACS::AccountId}}`: the UID of the Alibaba Cloud account. * `{{ACS::InstanceId}}`: the instance ID. If you want to run the command on multiple instances and specify `{{ACS::InstanceId}}` as a built-in environment parameter, make sure that the Cloud Assistant Agent version is not earlier than the following versions: * Linux: 2.2.3.309 * Windows: 2.1.3.309 * `{{ACS::InstanceName}}`: the instance name. If you want to run the command on multiple instances and specify `{{ACS::InstanceName}}` as a built-in environment parameter, make sure that the Cloud Assistant Agent version is not earlier than the following versions: * Linux: 2.2.3.344 * Windows: 2.1.3.344 * `{{ACS::InvokeId}}`: the ID of the task. If you want to specify `{{ACS::InvokeId}}` as a built-in environment parameter, make sure that the Cloud Assistant Agent version is not earlier than the following versions: * Linux: 2.2.3.309 * Windows: 2.1.3.309 * `{{ACS::CommandId}}`: the command ID. If you want to call the [RunCommand](~~141751~~) operation to run the command and specify `{{ACS::CommandId}}` as a built-in environment parameter, make sure that the Cloud Assistant Agent version is not earlier than the following versions: * 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 resourceGroupId(String resourceGroupId)
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 values: * For Linux instance, 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 Agent process resides, such as `C:\Windows\System32\`. > If you set WorkingDir to a directory other than default ones, make sure that the directory exists on the instances.
public CreateCommandRequest build()
Copyright © 2024. All rights reserved.