public class InvokeCommandShrinkRequest
extends com.aliyun.tea.TeaModel
限定符和类型 | 类和说明 |
---|---|
static class |
InvokeCommandShrinkRequest.InvokeCommandShrinkRequestResourceTag |
static class |
InvokeCommandShrinkRequest.InvokeCommandShrinkRequestTag |
限定符和类型 | 字段和说明 |
---|---|
String |
clientToken
The client token that is used to ensure the idempotence of the request.
|
String |
commandId
The command ID.
|
String |
containerId
The ID of the container.
|
String |
containerName
The name of the container.
|
String |
frequency
The schedule on which to run the command.
|
List<String> |
instanceId
The IDs of instances on which you want to run the command.
|
String |
launcher
The launcher for script execution.
|
String |
ownerAccount |
Long |
ownerId |
String |
parametersShrink
The key-value pairs of custom parameters to be passed in when the custom parameter feature is enabled.
|
String |
regionId
The region ID of the command.
|
String |
repeatMode
The mode in which you want to run the command.
|
String |
resourceGroupId
The ID of the resource group to which to assign the command executions.
|
String |
resourceOwnerAccount |
Long |
resourceOwnerId |
List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestResourceTag> |
resourceTag
The tags of the instance.
|
List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestTag> |
tag
The tags of the command.
|
String |
terminationMode
Specifies how to stop the command task when a command execution is manually stopped or times out.
|
Boolean |
timed
This parameter is no longer used and does not take effect.
|
Long |
timeout
The timeout period for the command execution.
|
String |
username
The username to use to run the command on the ECS instances.
|
String |
windowsPasswordName
The name of the password to use to run the command on a Windows instance.
|
构造器和说明 |
---|
InvokeCommandShrinkRequest() |
@NameInMap(value="ClientToken") public String clientToken
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.
example:123e4567-e89b-12d3-a456-42665544****
@NameInMap(value="CommandId") public String commandId
The command ID. You can call the DescribeCommands 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.
This parameter is required.
example:c-e996287206324975b5fbe1d****
@NameInMap(value="ContainerId") public String containerId
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 this parameter is specified, Cloud Assistant runs the command in the specified container of the instance.
If this parameter is specified, the command can run only on Linux instances on which Cloud Assistant Agent 2.2.3.344 or later is installed.
If this parameter is specified, the Username
parameter that is specified in a request to call this operation and the WorkingDir
parameter that is specified in a request to call the CreateCommand 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.
If this parameter is specified, 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.
ab141ddfbacfe02d9dbc25966ed971536124527097398d419a6746873fea****
@NameInMap(value="ContainerName") public String containerName
The name of the container.
Take note of the following items:
If this parameter is specified, Cloud Assistant runs the command in the specified container of the instance.
If this parameter is specified, the command can run only on Linux instances on which Cloud Assistant Agent 2.2.3.344 or later is installed.
If this parameter is specified, the Username
parameter that is specified in a request to call this operation and the WorkingDir
parameter that is specified in a request to call the CreateCommand 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.
If this parameter is specified, 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.
test-container
@NameInMap(value="Frequency") public String frequency
The schedule on which to run the command. You can configure a command to run at a fixed interval based on a rate expression, run only once at a specific time, or run at specific times based on a cron expression.
To run a 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 tasks need to be executed at a fixed interval. Specify the interval in the following format: rate(<Execution interval value><Execution interval unit>)
. For example, specify rate(5m)
to run the command every 5 minutes. When you specify an interval, take note of the following limits:
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 <Time zone>)
format, which indicates at(Year-Month-Day Hour:Minute:Second <Time zone>)
. If you do not specify a time zone, the Coordinated Universal Time (UTC) time zone is used by default. You can specify a time zone in the following forms:
Asia/Shanghai
and America/Los_Angeles
.GMT+8:00
(UTC+8) and GMT-7:00
(UTC-7). If you use the GMT format, you cannot add leading zeros to the hour value.For example, to configure a command to run only once at 13:15:30 on June 6, 2022 (Shanghai time), set the time to at(2022-06-06 13:15:30 Asia/Shanghai)
. To configure a command to run only once at 13:15:30 on June 6, 2022 (UTC-7), set the time to at(2022-06-06 13:15:30 GMT-7:00)
.
To run a command at specific times, use a cron expression to define the schedule. Specify a schedule in the <Cron expression> <Time zone>
format. The cron expression is in the <seconds> <minutes> <hours> <day of the month> <month> <day of the week> <year (optional)>
format. The system calculates the execution times of the command based on the specified cron expression and time zone and runs the command as scheduled. If you do not specify a time zone, the system time zone of the instance on which you want to run the command is used by default. For more information about cron expressions, see Cron expressions. You can specify a time zone in the following forms:
Asia/Shanghai
and America/Los_Angeles
.GMT+8:00
(UTC+8) and GMT-7:00
(UTC-7). If you use the GMT format, you cannot add leading zeros to the hour value.0 15 10 ? * * 2022 Asia/Shanghai
. To configure a command to run every half an hour from 10:00:00 to 11:30:00 every day in 2022 (UTC+8), set the schedule to 0 0/30 10-11 * * ? 2022 GMT+8:00
. To configure a command to run every 5 minutes from 14:00:00 to 14:55:00 every October every two years from 2022 in UTC, set the schedule to 0 0/5 14 * 10 ? 2022/2 UTC
.**
Note The minimum interval must be 10 seconds or more and cannot be shorter than the timeout period of scheduled executions.
@NameInMap(value="InstanceId") public List<String> instanceId
The IDs of instances on which you want to run the command. You can specify up to 100 instance IDs in each request. Valid values of N: 1 to 100.
You can apply for a quota increase in the Quota Center console. The quota name is Maximum number of instances supported for command execution.
example:i-bp185dy2o3o6n****
@NameInMap(value="Launcher") public String launcher
The launcher for script execution. The value cannot exceed 1 KB in length.
example:python3 -u {{ACS::ScriptFileName|Ext(".py")}}
@NameInMap(value="OwnerAccount") public String ownerAccount
@NameInMap(value="OwnerId") public Long ownerId
@NameInMap(value="Parameters") public String parametersShrink
The key-value pairs of custom parameters to be passed in when the custom parameter feature is enabled. Number of custom parameters: 0 to 10.
If you want to disable the custom parameter feature, you can leave this parameter empty.
example:{"name":"Jack", "accessKey":"LTAIdyv******aRY"}
@NameInMap(value="RegionId") public String regionId
The region ID of the command. You can call the DescribeRegions operation to query the most recent region list.
This parameter is required.
example:cn-hangzhou
@NameInMap(value="RepeatMode") public String repeatMode
The mode in which you want to run the command. Valid values:
Period
, you must also configure the Frequency
parameter.Default values:
Frequency
, the default value is Once
.Frequency
, Period
is used as the value of RepeatMode regardless of whether RepeatMode is set to Period.Take note of the following items:
Period
or EveryReboot
, you can call the DescribeInvocationResults operation with IncludeHistory
set to true to query the results of historical scheduled executions.Once
@NameInMap(value="ResourceGroupId") public String resourceGroupId
The ID of the resource group to which to assign the command executions. When you set this parameter, take note of the following items:
rg-bp67acfmxazb4p****
@NameInMap(value="ResourceOwnerAccount") public String resourceOwnerAccount
@NameInMap(value="ResourceOwnerId") public Long resourceOwnerId
@NameInMap(value="ResourceTag") public List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestResourceTag> resourceTag
The tags of the instance. If you do not specify InstanceId.N, the command is run on the instances that have the specified tags.
@NameInMap(value="Tag") public List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestTag> tag
The tags of the command.
@NameInMap(value="TerminationMode") public String terminationMode
Specifies how to stop the command task when a command execution is manually stopped or times out. Valid values:
ProcessTree
@NameInMap(value="Timed") public Boolean timed
example:This parameter is no longer used and does not take effect.
true
@NameInMap(value="Timeout") public Long timeout
The timeout period for the command execution. Unit: seconds.
60
@NameInMap(value="Username") public String username
The username to use to run the command on the ECS instances. The username cannot exceed 255 characters in length.
You can also specify other usernames that already exist in the instances to run the command. For security purposes, we recommend that you run Cloud Assistant commands as a regular user. For more information, see Run Cloud Assistant commands as a regular user.
example:test
@NameInMap(value="WindowsPasswordName") public String windowsPasswordName
The name of the password to use to run the command on a Windows instance. The name cannot exceed 255 characters in length.
If you do not want to use the default System user to run the command on Windows instances, specify both WindowsPasswordName and Username
. To mitigate the risk of password leaks, the password is stored in plaintext in CloudOps Orchestration Service (OOS) Parameter Store, and only the name of the password is passed in by using WindowsPasswordName. For more information, see Manage encryption parameters and Run Cloud Assistant commands as a regular user.
example:If you use the root username for Linux instances or the System username for Windows instances to run the command, you do not need to specify WindowsPasswordName.
axtSecretPassword
public static InvokeCommandShrinkRequest build(Map<String,?> map) throws Exception
Exception
public InvokeCommandShrinkRequest setClientToken(String clientToken)
public String getClientToken()
public InvokeCommandShrinkRequest setCommandId(String commandId)
public String getCommandId()
public InvokeCommandShrinkRequest setContainerId(String containerId)
public String getContainerId()
public InvokeCommandShrinkRequest setContainerName(String containerName)
public String getContainerName()
public InvokeCommandShrinkRequest setFrequency(String frequency)
public String getFrequency()
public InvokeCommandShrinkRequest setInstanceId(List<String> instanceId)
public InvokeCommandShrinkRequest setLauncher(String launcher)
public String getLauncher()
public InvokeCommandShrinkRequest setOwnerAccount(String ownerAccount)
public String getOwnerAccount()
public InvokeCommandShrinkRequest setOwnerId(Long ownerId)
public Long getOwnerId()
public InvokeCommandShrinkRequest setParametersShrink(String parametersShrink)
public String getParametersShrink()
public InvokeCommandShrinkRequest setRegionId(String regionId)
public String getRegionId()
public InvokeCommandShrinkRequest setRepeatMode(String repeatMode)
public String getRepeatMode()
public InvokeCommandShrinkRequest setResourceGroupId(String resourceGroupId)
public String getResourceGroupId()
public InvokeCommandShrinkRequest setResourceOwnerAccount(String resourceOwnerAccount)
public String getResourceOwnerAccount()
public InvokeCommandShrinkRequest setResourceOwnerId(Long resourceOwnerId)
public Long getResourceOwnerId()
public InvokeCommandShrinkRequest setResourceTag(List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestResourceTag> resourceTag)
public List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestResourceTag> getResourceTag()
public InvokeCommandShrinkRequest setTag(List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestTag> tag)
public List<InvokeCommandShrinkRequest.InvokeCommandShrinkRequestTag> getTag()
public InvokeCommandShrinkRequest setTerminationMode(String terminationMode)
public String getTerminationMode()
public InvokeCommandShrinkRequest setTimed(Boolean timed)
public Boolean getTimed()
public InvokeCommandShrinkRequest setTimeout(Long timeout)
public Long getTimeout()
public InvokeCommandShrinkRequest setUsername(String username)
public String getUsername()
public InvokeCommandShrinkRequest setWindowsPasswordName(String windowsPasswordName)
public String getWindowsPasswordName()
Copyright © 2024. All rights reserved.