public class CreateCommandRequest
extends com.aliyun.tea.TeaModel
限定符和类型 | 类和说明 |
---|---|
static class |
CreateCommandRequest.CreateCommandRequestTag |
限定符和类型 | 字段和说明 |
---|---|
String |
commandContent
The Base64-encoded content of the command.
|
String |
contentEncoding
The encoding mode of the command content (CommandContent).
|
String |
description
The description of the command.
|
Boolean |
enableParameter
Specifies whether to use custom parameters in the command.
|
String |
launcher |
String |
name
The name of the command.
|
String |
ownerAccount |
Long |
ownerId |
String |
regionId
The ID of the region in which to create the command.
|
String |
resourceGroupId
The ID of the resource group to which to assign the command.
|
String |
resourceOwnerAccount |
Long |
resourceOwnerId |
List<CreateCommandRequest.CreateCommandRequestTag> |
tag
The tags to add to the command.
|
Long |
timeout
he maximum timeout period for the command execution on the instance.
|
String |
type
The command type.
|
String |
workingDir
The execution path of the command on ECS instances.
|
构造器和说明 |
---|
CreateCommandRequest() |
@NameInMap(value="CommandContent") public String commandContent
The Base64-encoded content of the command. Take note of the following items:
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.
{{}}
format. Within {{}}
, the spaces and line feeds before and after the parameter names are ignored.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:
{{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:
{{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:
{{ACS::CommandId}}
: the command ID. If you want to call the RunCommand 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:
This parameter is required.
example:ZWNobyAxMjM=
@NameInMap(value="ContentEncoding") public String contentEncoding
The encoding mode of the command content (CommandContent). Valid values:
Default value: Base64.
example:If the specified value of this parameter is invalid, Base64 is used by default.
PlainText
@NameInMap(value="Description") public String description
The description of the command. The description supports all character sets and can be up to 512 characters in length.
example:testDescription
@NameInMap(value="EnableParameter") public Boolean enableParameter
Specifies whether to use custom parameters in the command.
Default value: false.
example:false
@NameInMap(value="Launcher") public String launcher
@NameInMap(value="Name") public String name
The name of the command. The name supports all character sets and can be up to 128 characters in length.
This parameter is required.
example:testName
@NameInMap(value="OwnerAccount") public String ownerAccount
@NameInMap(value="OwnerId") public Long ownerId
@NameInMap(value="RegionId") public String regionId
The ID of the region in which to create the command. You can call the DescribeRegions operation to query the most recent region list.
This parameter is required.
example:cn-hangzhou
@NameInMap(value="ResourceGroupId") public String resourceGroupId
The ID of the resource group to which to assign the command.
example:rg-123******
@NameInMap(value="ResourceOwnerAccount") public String resourceOwnerAccount
@NameInMap(value="ResourceOwnerId") public Long resourceOwnerId
@NameInMap(value="Tag") public List<CreateCommandRequest.CreateCommandRequestTag> tag
The tags to add to the command.
@NameInMap(value="Timeout") public Long timeout
he maximum timeout period for the command execution on the instance. Unit: seconds. When a command that you created cannot be run, the command times out. When a command execution times out, Cloud Assistant Agent forcefully terminates the command process by canceling the PID.
Default value: 60.
example:60
@NameInMap(value="Type") public String type
The command type. Valid values:
This parameter is required.
example:RunShellScript
@NameInMap(value="WorkingDir") public String workingDir
The execution path of the command on ECS instances. The value can be up to 200 characters in length.
Default values:
/root
directory.C:\\Windows\\System32\\
.example:If you set WorkingDir to a directory other than default ones, make sure that the directory exists on the instances.
/root/
public static CreateCommandRequest build(Map<String,?> map) throws Exception
Exception
public CreateCommandRequest setCommandContent(String commandContent)
public String getCommandContent()
public CreateCommandRequest setContentEncoding(String contentEncoding)
public String getContentEncoding()
public CreateCommandRequest setDescription(String description)
public String getDescription()
public CreateCommandRequest setEnableParameter(Boolean enableParameter)
public Boolean getEnableParameter()
public CreateCommandRequest setLauncher(String launcher)
public String getLauncher()
public CreateCommandRequest setName(String name)
public String getName()
public CreateCommandRequest setOwnerAccount(String ownerAccount)
public String getOwnerAccount()
public CreateCommandRequest setOwnerId(Long ownerId)
public Long getOwnerId()
public CreateCommandRequest setRegionId(String regionId)
public String getRegionId()
public CreateCommandRequest setResourceGroupId(String resourceGroupId)
public String getResourceGroupId()
public CreateCommandRequest setResourceOwnerAccount(String resourceOwnerAccount)
public String getResourceOwnerAccount()
public CreateCommandRequest setResourceOwnerId(Long resourceOwnerId)
public Long getResourceOwnerId()
public CreateCommandRequest setTag(List<CreateCommandRequest.CreateCommandRequestTag> tag)
public List<CreateCommandRequest.CreateCommandRequestTag> getTag()
public CreateCommandRequest setTimeout(Long timeout)
public Long getTimeout()
public CreateCommandRequest setType(String type)
public String getType()
public CreateCommandRequest setWorkingDir(String workingDir)
public String getWorkingDir()
Copyright © 2024. All rights reserved.