Virtual Machine Run Commands - Get
Obtient une commande d’exécution spécifique pour un abonnement dans un emplacement.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}?api-version=2024-07-01
Paramètres URI
Nom | Dans | Obligatoire | Type | Description |
---|---|---|---|---|
command
|
path | True |
string |
ID de commande. |
location
|
path | True |
string |
Emplacement sur lequel les commandes d’exécution sont interrogées. Modèle d’expression régulière: |
subscription
|
path | True |
string |
Informations d’identification d’abonnement qui identifient de manière unique l’abonnement Microsoft Azure. L’ID d’abonnement fait partie de l’URI de chaque appel de service. |
api-version
|
query | True |
string |
Version de l’API cliente. |
Réponses
Nom | Type | Description |
---|---|---|
200 OK |
D’ACCORD Media Types: "application/json", "text/json" |
Sécurité
azure_auth
Flux OAuth2 Azure Active Directory
Type:
oauth2
Flux:
implicit
URL d’autorisation:
https://login.microsoftonline.com/common/oauth2/authorize
Étendues
Nom | Description |
---|---|
user_impersonation | emprunter l’identité de votre compte d’utilisateur |
Exemples
VirtualMachineRunCommandGet
Exemple de requête
Exemple de réponse
{
"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."
}
Définitions
Nom | Description |
---|---|
Operating |
Type de système d’exploitation. |
Run |
Décrit les propriétés d’une commande d’exécution. |
Run |
Décrit les propriétés d’un paramètre de commande d’exécution. |
OperatingSystemTypes
Type de système d’exploitation.
Nom | Type | Description |
---|---|---|
Linux |
string |
|
Windows |
string |
RunCommandDocument
Décrit les propriétés d’une commande d’exécution.
Nom | Type | Description |
---|---|---|
$schema |
string |
Schéma de commande d’exécution de la machine virtuelle. |
description |
string |
Description de la commande d’exécution de la machine virtuelle. |
id |
string |
ID de commande d’exécution de la machine virtuelle. |
label |
string |
Étiquette de commande d’exécution de la machine virtuelle. |
osType |
Type de système d’exploitation. |
|
parameters |
Paramètres utilisés par le script. |
|
script |
string[] |
Script à exécuter. |
RunCommandParameterDefinition
Décrit les propriétés d’un paramètre de commande d’exécution.
Nom | Type | Valeur par défaut | Description |
---|---|---|---|
defaultValue |
string |
Valeur par défaut du paramètre de commande Run. |
|
name |
string |
Nom du paramètre de commande d’exécution. |
|
required |
boolean |
False |
Paramètre de commande d’exécution requis. |
type |
string |
Type de paramètre de commande d’exécution. |