GetUserCommand

Updated at:

Retrieves user-defined commands.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

GET /api/v2/usercommands/{UserCommandId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

UserCommandId

string

No

The ID of the user-defined command. You can obtain it by calling operations such as GetInstance.

1900

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

The DSW instance ID. Specify this parameter to query the user-defined command attached to the instance. Specifying the options overwrites the Settings of UserCommandId.

dsw-dlsd0fskn193213xxx

Token

string

No

The token issued by calling the GetToken operation to access the user-defined command.

eyJhbGci......

Response elements

Element

Type

Description

Example

object

Schema of Response

UserCommandId

string

The ID of the user-defined command.

1900

OnStart

object

The custom startup command, which is executed each time the instance starts.

Content

string

The content of the custom startup command.

apt update

Message

string

The response message.

null

Code

string

The status code. Valid values:

  • null: The request is successful.

  • ValidationError: A parameter validation error occurred.

  • InternalError: An internal system error occurred.

ValidationError

RequestId

string

The request ID.

BEBDF2EE-642E-5992-8907-D2011A7ACEFE

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

accessDeniedDetail

object

The details of the access denial. This parameter is returned when access is denied due to lack of RAM permissions.

{"PolicyType":"AccountLevelIdentityBasedPolicy","AuthPrincipalOwnerId":"xxx","EncodedDiagnosticMessage":"AQIBIAAAA....bwhg==","AuthPrincipalType":"SubUser","AuthPrincipalDisplayName":"xxx","NoPermissionType":"ImplicitDeny","AuthAction":"ram:GetUserCommand"}

Examples

Success response

JSON format

{
  "UserCommandId": "1900",
  "OnStart": {
    "Content": "apt update"
  },
  "Message": "null",
  "Code": "ValidationError",
  "RequestId": "BEBDF2EE-642E-5992-8907-D2011A7ACEFE",
  "Success": true,
  "accessDeniedDetail": {
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "xxx",
    "EncodedDiagnosticMessage": "AQIBIAAAA....bwhg==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "xxx",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "ram:GetUserCommand"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.