Операция получения расширения.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}?api-version=2024-03-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}?$expand={$expand}&api-version=2024-03-01
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
resourceGroupName
|
path |
True
|
string
|
Имя группы ресурсов.
|
subscriptionId
|
path |
True
|
string
|
Учетные данные подписки, которые однозначно идентифицируют подписку Microsoft Azure. Идентификатор подписки формирует часть URI для каждого вызова службы.
|
vmExtensionName
|
path |
True
|
string
|
Имя расширения виртуальной машины.
|
vmName
|
path |
True
|
string
|
Имя виртуальной машины, содержащей расширение.
|
api-version
|
query |
True
|
string
|
Версия API клиента.
|
$expand
|
query |
|
string
|
Выражение expand, применяемое к операции.
|
Ответы
Безопасность
azure_auth
Поток OAuth2 в Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
VirtualMachineExtension_Get_MaximumSet_Gen
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/aaaaaaaaaaaaaaaaaaaaaaaaaaaaa/extensions/aaaaaaa?$expand=aaaaaa&api-version=2024-03-01
/**
* Samples for VirtualMachineExtensions Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/
* virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json
*/
/**
* Sample code: VirtualMachineExtension_Get_MaximumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualMachineExtensionGetMaximumSetGen(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getVirtualMachineExtensions().getWithResponse("rgcompute",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", "aaaaaa", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python virtual_machine_extension_get_maximum_set_gen.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.virtual_machine_extensions.get(
resource_group_name="rgcompute",
vm_name="aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
vm_extension_name="aaaaaaa",
)
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json
func ExampleVirtualMachineExtensionsClient_Get_virtualMachineExtensionGetMaximumSetGen() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewVirtualMachineExtensionsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", &armcompute.VirtualMachineExtensionsClientGetOptions{Expand: to.Ptr("aaaaaa")})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.VirtualMachineExtension = armcompute.VirtualMachineExtension{
// Name: to.Ptr("myVMExtension"),
// Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"),
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "key9183": to.Ptr("aa"),
// },
// Properties: &armcompute.VirtualMachineExtensionProperties{
// Type: to.Ptr("extType"),
// AutoUpgradeMinorVersion: to.Ptr(true),
// EnableAutomaticUpgrade: to.Ptr(true),
// ForceUpdateTag: to.Ptr("a"),
// InstanceView: &armcompute.VirtualMachineExtensionInstanceView{
// Name: to.Ptr("aaaaaaaaaaaaaaaaa"),
// Type: to.Ptr("aaaaaaaaa"),
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"),
// DisplayStatus: to.Ptr("aaaaaa"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// Message: to.Ptr("a"),
// Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()),
// }},
// Substatuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"),
// DisplayStatus: to.Ptr("aaaaaa"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// Message: to.Ptr("a"),
// Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t}()),
// }},
// TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"),
// },
// ProtectedSettings: map[string]any{
// },
// ProvisioningState: to.Ptr("Succeeded"),
// Publisher: to.Ptr("extPublisher"),
// Settings: map[string]any{
// },
// SuppressFailures: to.Ptr(true),
// TypeHandlerVersion: to.Ptr("1.2"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to The operation to get the extension.
*
* @summary The operation to get the extension.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json
*/
async function virtualMachineExtensionGetMaximumSetGen() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute";
const vmName = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
const vmExtensionName = "aaaaaaa";
const expand = "aaaaaa";
const options = { expand };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.virtualMachineExtensions.get(
resourceGroupName,
vmName,
vmExtensionName,
options,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"name": "myVMExtension",
"type": "Microsoft.Compute/virtualMachines/extensions",
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension",
"location": "westus",
"properties": {
"autoUpgradeMinorVersion": true,
"provisioningState": "Creating",
"publisher": "extPublisher",
"type": "extType",
"typeHandlerVersion": "1.2",
"suppressFailures": true,
"settings": {},
"forceUpdateTag": "a",
"enableAutomaticUpgrade": true,
"protectedSettings": {},
"instanceView": {
"name": "aaaaaaaaaaaaaaaaa",
"type": "aaaaaaaaa",
"typeHandlerVersion": "aaaaaaaaaaaaaaaaaaaaaaaaaa",
"substatuses": [
{
"code": "aaaaaaaaaaaaaaaaaaaaaaa",
"level": "Info",
"displayStatus": "aaaaaa",
"message": "a",
"time": "2021-11-30T12:58:26.522Z"
}
],
"statuses": [
{
"code": "aaaaaaaaaaaaaaaaaaaaaaa",
"level": "Info",
"displayStatus": "aaaaaa",
"message": "a",
"time": "2021-11-30T12:58:26.522Z"
}
]
}
},
"tags": {
"key9183": "aa"
}
}
VirtualMachineExtension_Get_MinimumSet_Gen
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension?api-version=2024-03-01
/**
* Samples for VirtualMachineExtensions Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/
* virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json
*/
/**
* Sample code: VirtualMachineExtension_Get_MinimumSet_Gen.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void virtualMachineExtensionGetMinimumSetGen(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getVirtualMachineExtensions().getWithResponse("rgcompute",
"myVM", "myVMExtension", null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python virtual_machine_extension_get_minimum_set_gen.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.virtual_machine_extensions.get(
resource_group_name="rgcompute",
vm_name="myVM",
vm_extension_name="myVMExtension",
)
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json
func ExampleVirtualMachineExtensionsClient_Get_virtualMachineExtensionGetMinimumSetGen() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewVirtualMachineExtensionsClient().Get(ctx, "rgcompute", "myVM", "myVMExtension", &armcompute.VirtualMachineExtensionsClientGetOptions{Expand: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.VirtualMachineExtension = armcompute.VirtualMachineExtension{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"),
// Location: to.Ptr("westus"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to The operation to get the extension.
*
* @summary The operation to get the extension.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json
*/
async function virtualMachineExtensionGetMinimumSetGen() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "rgcompute";
const vmName = "myVM";
const vmExtensionName = "myVMExtension";
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.virtualMachineExtensions.get(
resourceGroupName,
vmName,
vmExtensionName,
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"location": "westus",
"id": "/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"
}
Определения
ApiError
Ошибка API.
Имя |
Тип |
Описание |
code
|
string
|
Код ошибки.
|
details
|
ApiErrorBase[]
|
Сведения об ошибке API
|
innererror
|
InnerError
|
Внутренняя ошибка API
|
message
|
string
|
Сообщение об ошибке.
|
target
|
string
|
Целевой объект конкретной ошибки.
|
ApiErrorBase
База ошибок API.
Имя |
Тип |
Описание |
code
|
string
|
Код ошибки.
|
message
|
string
|
Сообщение об ошибке.
|
target
|
string
|
Целевой объект конкретной ошибки.
|
CloudError
Ответ об ошибке от службы вычислений.
Имя |
Тип |
Описание |
error
|
ApiError
|
Ошибка API.
|
InnerError
Сведения о внутренней ошибке.
Имя |
Тип |
Описание |
errordetail
|
string
|
Внутреннее сообщение об ошибке или дамп исключений.
|
exceptiontype
|
string
|
Тип исключения.
|
InstanceViewStatus
Состояние представления экземпляра.
Имя |
Тип |
Описание |
code
|
string
|
Код состояния.
|
displayStatus
|
string
|
Короткая локализуемая метка для состояния.
|
level
|
StatusLevelTypes
|
Код уровня.
|
message
|
string
|
Подробное сообщение о состоянии, в том числе для оповещений и сообщений об ошибках.
|
time
|
string
|
Время состояния.
|
KeyVaultSecretReference
Описание ссылки на секрет Key Vault
Имя |
Тип |
Описание |
secretUrl
|
string
|
URL-адрес, ссылающийся на секрет в Key Vault.
|
sourceVault
|
SubResource
|
Относительный URL-адрес Key Vault, содержащего секрет.
|
StatusLevelTypes
Код уровня.
Имя |
Тип |
Описание |
Error
|
string
|
|
Info
|
string
|
|
Warning
|
string
|
|
SubResource
Имя |
Тип |
Описание |
id
|
string
|
Идентификатор ресурса
|
VirtualMachineExtension
Описывает расширение виртуальной машины.
Имя |
Тип |
Описание |
id
|
string
|
Идентификатор ресурса
|
location
|
string
|
Расположение ресурса
|
name
|
string
|
Имя ресурса
|
properties.autoUpgradeMinorVersion
|
boolean
|
Указывает, должно ли расширение использовать более новую дополнительную версию, если она доступна во время развертывания. Однако после развертывания расширение не будет обновляться до дополнительных версий, кроме случаев повторного развертывания, даже если это свойство имеет значение true.
|
properties.enableAutomaticUpgrade
|
boolean
|
Указывает, должно ли расширение автоматически обновляться платформой, если доступна более новая версия расширения.
|
properties.forceUpdateTag
|
string
|
Способ принудительного обновления обработчика расширений, даже если конфигурация расширения не изменилась.
|
properties.instanceView
|
VirtualMachineExtensionInstanceView
|
Представление экземпляра расширения виртуальной машины.
|
properties.protectedSettings
|
object
|
Расширение может содержать protectedSettings или protectedSettingsFromKeyVault или вообще не иметь защищенных параметров.
|
properties.protectedSettingsFromKeyVault
|
KeyVaultSecretReference
|
Расширения защищают параметры, которые передаются по ссылке и используются из хранилища ключей.
|
properties.provisionAfterExtensions
|
string[]
|
Коллекция имен расширений, после которых необходимо подготовить это расширение.
|
properties.provisioningState
|
string
|
Состояние подготовки, которое отображается только в ответе.
|
properties.publisher
|
string
|
Имя издателя обработчика расширений.
|
properties.settings
|
object
|
Общедоступные параметры расширения в формате JSON.
|
properties.suppressFailures
|
boolean
|
Указывает, будут ли сбои, вытекающие из расширения, подавляться (операционные сбои, такие как отсутствие подключения к виртуальной машине, не будут подавляться независимо от этого значения). Значение по умолчанию — false.
|
properties.type
|
string
|
Указывает тип расширения; пример : CustomScriptExtension.
|
properties.typeHandlerVersion
|
string
|
Указывает версию обработчика скрипта.
|
tags
|
object
|
Теги ресурсов
|
type
|
string
|
Тип ресурса
|
VirtualMachineExtensionInstanceView
Представление экземпляра расширения виртуальной машины.
Имя |
Тип |
Описание |
name
|
string
|
Имя расширения виртуальной машины.
|
statuses
|
InstanceViewStatus[]
|
Сведения о состоянии ресурса.
|
substatuses
|
InstanceViewStatus[]
|
Сведения о состоянии ресурса.
|
type
|
string
|
Указывает тип расширения; пример : CustomScriptExtension.
|
typeHandlerVersion
|
string
|
Указывает версию обработчика скрипта.
|