Virtual Machine Run Commands - Get

ある場所のサブスクリプションに対する特定の実行コマンドを取得します。

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}?api-version=2024-03-01

URI パラメーター

名前 / 必須 説明
commandId
path True

string

コマンド ID。

location
path True

string

実行コマンドのクエリを実行する場所。

Regex pattern: ^[-\w\._]+$

subscriptionId
path True

string

Microsoft Azure サブスクリプションを一意に識別するサブスクリプション資格情報。 サブスクリプション ID は、全ての修理依頼についてURI の一部を生じさせます。

api-version
query True

string

クライアント API のバージョン。

応答

名前 説明
200 OK

RunCommandDocument

OK

Media Types: "application/json", "text/json"

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名前 説明
user_impersonation ユーザー アカウントの借用

VirtualMachineRunCommandGet

Sample Request

GET https://management.azure.com/subscriptions/24fb23e3-6ba3-41f0-9b6e-e41131d5d61e/providers/Microsoft.Compute/locations/SoutheastAsia/runCommands/RunPowerShellScript?api-version=2024-03-01

Sample Response

{
  "script": [
    "param(",
    "    [string]$arg1,",
    "    [string]$arg2",
    ")",
    "Write-Host This is a sample script with parameters $arg1 $arg2"
  ],
  "parameters": [
    {
      "name": "arg1",
      "type": "string",
      "defaultValue": "value1"
    },
    {
      "name": "arg2",
      "type": "string",
      "defaultValue": "value2"
    }
  ],
  "$schema": "http://schema.management.azure.com/schemas/2016-11-17/runcommands.json",
  "id": "RunPowerShellScript",
  "osType": "Windows",
  "label": "Executes a PowerShell script",
  "description": "Custom multiline PowerShell script should be defined in script property. Optional parameters can be set in parameters property."
}

定義

名前 説明
OperatingSystemTypes

オペレーティング システムの種類。

RunCommandDocument

実行コマンドのプロパティについて説明します。

RunCommandParameterDefinition

実行コマンド パラメーターのプロパティについて説明します。

OperatingSystemTypes

オペレーティング システムの種類。

名前 説明
Linux

string

Windows

string

RunCommandDocument

実行コマンドのプロパティについて説明します。

名前 説明
$schema

string

VM 実行コマンド スキーマ。

description

string

VM 実行コマンドの説明。

id

string

VM の実行コマンド ID。

label

string

VM run コマンド ラベル。

osType

OperatingSystemTypes

オペレーティング システムの種類。

parameters

RunCommandParameterDefinition[]

スクリプトで使用されるパラメーター。

script

string[]

実行するスクリプト。

RunCommandParameterDefinition

実行コマンド パラメーターのプロパティについて説明します。

名前 既定値 説明
defaultValue

string

run コマンド パラメーターの既定値。

name

string

run コマンド パラメーター名。

required

boolean

False

run コマンド パラメーターが必要です。

type

string

run コマンド パラメーターの型。