Tüm Ürünler
Search
Belge Merkezi

:CreateCommand

Son Güncelleme:Sep 30, 2026

Bir Cloud Assistant komutu oluşturur.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

swas-open:CreateCommand

create

*Command

acs:swas-open:{#regionId}:{#accountId}:command/*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

Bölge kimliği. Kullanılabilir bölgeleri sorgulamak için ListRegions API'sini çağırın.

cn-hangzhou

Name

string

Yes

Komutun adı. Tüm karakter kümeleri desteklenir. Ad en fazla 128 karakter uzunluğunda olabilir.

testName

Description

string

No

Komutun açıklaması. Tüm karakter kümeleri desteklenir. Açıklama en fazla 512 karakter uzunluğunda olabilir.

test

Type

string

Yes

Komutun dil türü. Geçerli değerler:

  • RunBatScript: Windows örnekleri için Bat komutları.

  • RunPowerShellScript: Windows örnekleri için PowerShell komutları.

  • RunShellScript: Linux örnekleri için Shell komutları.

RunShellScript

CommandContent

string

Yes

Komutun içeriği. Aşağıdaki noktalara dikkat edin:

  • Komut içeriğinde özel parametreleri etkinleştirmek için EnableParameter değerini true olarak ayarlayın.

  • Özel parametreleri {{}} biçiminde tanımlayın. {{}} içindeki parametre adlarından önceki ve sonraki boşluklar ve satır sonları yoksayılır.

  • En fazla 20 özel parametre tanımlayabilirsiniz.

  • Özel parametre adları harf, rakam, tire (-) ve alt çizgi (_) içerebilir. Adlar büyük/küçük harfe duyarlı değildir.

  • Tek bir özel parametre adı 64 baytı aşamaz.

ifconfig -s

WorkingDir

string

No

Komutun ECS örneğinde çalıştırıldığı dizin.

Varsayılan değerler:

  • Linux örnekleri için: root kullanıcısının ev dizini olan /root dizini.

  • Windows örnekleri için: Cloud Assistant istemci işleminin bulunduğu dizin, örneğin C:\Windows\System32.

/root/

Timeout

integer

No

Komutun sunucu örneğinde çalışması için saniye cinsinden zaman aşımı süresi.

Bir komut görevi zaman aşımına uğradığında, Cloud Assistant görev işlemini zorla durdurur. Zaman aşımı süresi 10 ile 86.400 saniye (24 saat) arasında olmalıdır.

Varsayılan değer: 60.

60

EnableParameter

boolean

No

Komutta özel parametrelerin kullanılıp kullanılmayacağını belirtir.

Varsayılan değer: false.

false

Tag

array<object>

No

Etiketler. En fazla 20 etiket ekleyebilirsiniz.

object

No

Etiket.

Key

string

No

Komuta eklenecek N etiketinin anahtarı. N için geçerli değerler: 1 ile 20 arası.

Etiket anahtarı boş bir dize olamaz. En fazla 64 karakter uzunluğunda olabilir ve aliyun veya acs: ile başlayamaz. http:// veya https:// içeremez.

TestKey

Value

string

No

Komuta eklenecek N etiketinin değeri. N için geçerli değerler: 1 ile 20 arası.

Etiket değeri boş bir dize olabilir. En fazla 64 karakter uzunluğunda olabilir ve http:// veya https:// içeremez.

TestValue

ResourceGroupId

string

No

Kaynak grubu kimliği.

rg-aek2bti7cf7****

Response elements

Element

Type

Description

Example

object

Yanıt şeması.

RequestId

string

İstek kimliği.

20758A-585D-4A41-A9B2-28DA8F4****

CommandId

string

Komut kimliği.

c-sh02yh0932w****

Examples

Success response

JSON format

{
  "RequestId": "20758A-585D-4A41-A9B2-28DA8F4****",
  "CommandId": "c-sh02yh0932w****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.