All Products
Search
Document Center

Simple Application Server:InvokeCommand

Last Updated:Oct 30, 2024

Runs a Command Assistant command for one or more simple application servers.

Operation description

  • The simple application servers for which you want to call the operation must meet the following conditions. If a simple application server cannot meet the conditions, you must call this operation again.

    • The simple application servers are in the Running state. You can call the ListInstances operation to query the status of simple application servers.
    • Cloud Assistant Agent is installed on the simple application servers. For more information, see InstallCloudAssistant .
    • If you run a PowerShell command, make sure that the PowerShell module is configured for the simple application servers.
  • The command may fail to be run due to the abnormal states of simple application servers, network exceptions, or exceptions in Cloud Assistant Agent. If the command fails to be run, no execution information is generated.

  • If you enable the custom parameter feature when you create a command, you must set the Parameters parameter to specify custom parameters when you run the command.

  • When you call this operation, you can select only one common command or a custom command that you have created.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
swas-open:InvokeCommand
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID. You can call the ListRegions operation to query the most recent region list.

cn-hangzhou
CommandIdstringYes

The command ID. You can call the DescribeCommands operation to query all available command IDs.

c-sh02yh0932w****
ParametersobjectNo

The key-value pairs of custom parameters to specify when the custom parameter feature is enabled.

  • You can specify up to 10 custom parameters. Each key in a Map collection cannot be an empty string and can be up to 64 characters in length.
  • Values in a Map collection can be empty strings. The total length of the custom parameters and the original command cannot exceed 18 KB after they are encoded in Base64.
  • The custom parameter names that you specify for the Parameters parameter must be included in the custom parameter names that you specified when you created the command.
  • You can use empty strings to represent the custom parameters that are not specified. If you want to disable the custom parameter feature, you can leave this parameter empty.
{"delayed_insert_timeout":"600","max_length_for_sort_data":"2048"}
UsernamestringNo

The name of the user who runs the command in a simple application server. The username cannot exceed 255 characters in length.

  • For Linux servers, the default value is the root username.
  • For Windows servers, the default value is the system username.

You can change the user to run the command only for Linux simple application servers.

test
InstanceIdsstringYes

The IDs of the simple application servers. The value can be a JSON array that consists of up to 50 IDs of simple application servers. Separate multiple IDs with commas (,).

["2ad1ae67295445f598017499dc****", "2ad1ae67295445f598017123dc****"]

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

20758A-585D-4A41-A9B2-28DA8F4F****
InvokeIdstring

The execution ID of the command.

t-bj02prjhw1n****

Examples

Sample success responses

JSONformat

{
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4F****",
  "InvokeId": "t-bj02prjhw1n****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history