Virtual Machine Run Commands - Get
Hiermee haalt u een specifieke uitvoeringsopdracht voor een abonnement op een locatie op.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}?api-version=2024-07-01
URI-parameters
Name | In | Vereist | Type | Description |
---|---|---|---|---|
command
|
path | True |
string |
De opdracht-id. |
location
|
path | True |
string |
Er wordt een query uitgevoerd op de locatie waarop opdrachten worden uitgevoerd. Regex-patroon: |
subscription
|
path | True |
string |
Abonnementsreferenties die het Microsoft Azure-abonnement uniek identificeren. De abonnements-id maakt deel uit van de URI voor elke serviceoproep. |
api-version
|
query | True |
string |
Client-API-versie. |
Antwoorden
Name | Type | Description |
---|---|---|
200 OK |
OK Media Types: "application/json", "text/json" |
Beveiliging
azure_auth
Azure Active Directory OAuth2-stroom
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
Name | Description |
---|---|
user_impersonation | Uw gebruikersaccount imiteren |
Voorbeelden
VirtualMachineRunCommandGet
Voorbeeldaanvraag
Voorbeeldrespons
{
"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."
}
Definities
Name | Description |
---|---|
Operating |
Het type besturingssysteem. |
Run |
Beschrijft de eigenschappen van een opdracht Uitvoeren. |
Run |
Beschrijft de eigenschappen van een opdrachtparameter uitvoeren. |
OperatingSystemTypes
Het type besturingssysteem.
Waarde | Description |
---|---|
Linux | |
Windows |
RunCommandDocument
Beschrijft de eigenschappen van een opdracht Uitvoeren.
Name | Type | Description |
---|---|---|
$schema |
string |
Het opdrachtschema voor de VM-uitvoering. |
description |
string |
De beschrijving van de opdracht voor de VM-uitvoering. |
id |
string |
De opdracht-id van de VM uitvoeren. |
label |
string |
Het opdrachtlabel voor de VM-uitvoering. |
osType |
Het type besturingssysteem. |
|
parameters |
De parameters die door het script worden gebruikt. |
|
script |
string[] |
Het script dat moet worden uitgevoerd. |
RunCommandParameterDefinition
Beschrijft de eigenschappen van een opdrachtparameter uitvoeren.
Name | Type | Default value | Description |
---|---|---|---|
defaultValue |
string |
De standaardwaarde van de opdrachtopdrachtparameter uitvoeren. |
|
name |
string |
De parameternaam van de run-opdracht. |
|
required |
boolean |
False |
De opdrachtparameter uitvoeren is vereist. |
type |
string |
Het opdrachtparametertype uitvoeren. |