public class ModifyInvocationAttributeRequest
extends com.aliyun.tea.TeaModel
限定符和类型 | 字段和说明 |
---|---|
String |
commandContent
The content of the command after modification.
|
String |
contentEncoding
The encoding mode of the command content that is specified by
CommandContent . |
Boolean |
enableParameter
Specifies whether to include custom parameters in the command.
|
String |
frequency
The frequency at which to run the command.
|
List<String> |
instanceId
The IDs of the ECS instances or managed instances that you want to add to the scheduled command task.
|
String |
invokeId
The execution ID of the command.
|
String |
ownerAccount |
Long |
ownerId |
Map<String,?> |
parameters
The key-value pairs of the custom parameters that are passed in if custom parameters are included in the command.
|
String |
regionId
The region ID.
|
String |
resourceOwnerAccount |
Long |
resourceOwnerId |
构造器和说明 |
---|
ModifyInvocationAttributeRequest() |
@NameInMap(value="CommandContent") public String commandContent
The content of the command after modification. The command content can be plaintext or Base64-encoded. Take note of the following items:
You can specify whether to retain the command after the command is run when you created the command. If you specified to retain the command, the Base64-encoded command content cannot exceed 18 KB in size. If you specified not to retain the command, the Base64-encoded command content cannot exceed 24 KB in size.
If the command content is Base64-encoded, set ContentEncoding
to Base64.
If you set EnableParameter
to true, the custom parameter feature is enabled and you can configure custom parameters based on the following rules:
{{}}
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. 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 region ID.
{{ACS::AccountId}}
: the UID of the Alibaba Cloud account.
{{ACS::InstanceId}}
: the instance ID. If you want to specify {{ACS::InstanceId}}
as a built-in environment variable, make sure that the Cloud Assistant Agent version is not earlier than the following ones:
{{ACS::InstanceName}}
: the instance name. When the command is run on multiple instances, if you want to specify {{ACS::InstanceName}}
as a built-in environment variable, make sure that the Cloud Assistant Agent version is not earlier than the following ones:
{{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 ones:
{{ACS::CommandId}}
: the command ID. If you want to specify {{ACS::CommandId}}
as a built-in environment parameter, make sure that the Cloud Assistant Agent version is not earlier than the following ones:
ZWNobyAxMjM=
@NameInMap(value="ContentEncoding") public String contentEncoding
The encoding mode of the command content that is specified by CommandContent
. Valid values (case-insensitive):
Default value: PlainText. If the value is invalid, the PlainText mode is used.
example:PlainText
@NameInMap(value="EnableParameter") public Boolean enableParameter
Specifies whether to include custom parameters in the command.
Parameters
to modify the custom parameters in the command, set EnableParameter to true
.Parameters
to modify the custom parameters in the command, leave EnableParameter empty or set it to false
.false
@NameInMap(value="Frequency") public String frequency
The frequency at which to run the command. This parameter takes effect only when RepeatMode
is set to Period
. You can configure a command to run at a fixed interval based on a rate expression, run only once at a specific point in time, or run at designated points in time based on a cron expression.
To run the 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. Take note of the following limits when you specify an interval:
DescribeInvocations
operation) and the modified execution interval.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 Hours:Minutes:Seconds <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 designated points in time, 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 zones of the instances on which you want to run the command are used by default. For information about cron expressions, see Cron expressions. You can specify the 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 longer and cannot be shorter than the timeout period of scheduled executions.
@NameInMap(value="InstanceId") public List<String> instanceId
The IDs of the ECS instances or managed instances that you want to add to the scheduled command task.
@NameInMap(value="InvokeId") public String invokeId
The execution ID of the command.
This parameter is required.
example:t-hz0jdfwd9f****
@NameInMap(value="OwnerAccount") public String ownerAccount
@NameInMap(value="OwnerId") public Long ownerId
@NameInMap(value="Parameters") public Map<String,?> parameters
The key-value pairs of the custom parameters that are passed in if custom parameters are included in the command.
You can specify 0 to 10 custom parameters. Take note of the following items:
This parameter is empty by default, which indicates not to modify the key-value pairs of the custom parameters.
example:{"name":"Jack", "accessKey":"LTAIdyvdIqaRY****"}
@NameInMap(value="RegionId") public String regionId
The region ID.
This parameter is required.
example:cn-hangzhou
@NameInMap(value="ResourceOwnerAccount") public String resourceOwnerAccount
@NameInMap(value="ResourceOwnerId") public Long resourceOwnerId
public static ModifyInvocationAttributeRequest build(Map<String,?> map) throws Exception
Exception
public ModifyInvocationAttributeRequest setCommandContent(String commandContent)
public String getCommandContent()
public ModifyInvocationAttributeRequest setContentEncoding(String contentEncoding)
public String getContentEncoding()
public ModifyInvocationAttributeRequest setEnableParameter(Boolean enableParameter)
public Boolean getEnableParameter()
public ModifyInvocationAttributeRequest setFrequency(String frequency)
public String getFrequency()
public ModifyInvocationAttributeRequest setInstanceId(List<String> instanceId)
public ModifyInvocationAttributeRequest setInvokeId(String invokeId)
public String getInvokeId()
public ModifyInvocationAttributeRequest setOwnerAccount(String ownerAccount)
public String getOwnerAccount()
public ModifyInvocationAttributeRequest setOwnerId(Long ownerId)
public Long getOwnerId()
public ModifyInvocationAttributeRequest setParameters(Map<String,?> parameters)
public ModifyInvocationAttributeRequest setRegionId(String regionId)
public String getRegionId()
public ModifyInvocationAttributeRequest setResourceOwnerAccount(String resourceOwnerAccount)
public String getResourceOwnerAccount()
public ModifyInvocationAttributeRequest setResourceOwnerId(Long resourceOwnerId)
public Long getResourceOwnerId()
Copyright © 2024. All rights reserved.