Atualiza (corrige) um disco.
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}?api-version=2024-03-02
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
diskName
|
path |
True
|
string
|
O nome do disco gerenciado que está sendo criado. O nome não pode ser alterado após a criação do disco. Os caracteres suportados para o nome são a-z, A-Z, 0-9, _ e -. O comprimento máximo do nome é de 80 caracteres.
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos.
|
subscriptionId
|
path |
True
|
string
|
Credenciais de assinatura que identificam exclusivamente a assinatura do Microsoft Azure. O ID da assinatura faz parte do URI de cada chamada de serviço.
|
api-version
|
query |
True
|
string
|
Versão da API do cliente.
|
Corpo do Pedido
Name |
Tipo |
Description |
properties.burstingEnabled
|
boolean
|
Defina como true para habilitar o bursting além do destino de desempenho provisionado do disco. O bursting está desativado por padrão. Não se aplica a discos Ultra.
|
properties.dataAccessAuthMode
|
DataAccessAuthMode
|
Requisitos de autenticação adicionais ao exportar ou carregar para um disco ou instantâneo.
|
properties.diskAccessId
|
string
|
ID ARM do recurso DiskAccess para usar pontos de extremidade privados em discos.
|
properties.diskIOPSReadOnly
|
integer
|
O número total de IOPS que serão permitidas em todas as VMs que montam o disco compartilhado como Somente Leitura. Uma operação pode transferir entre 4k e 256k bytes.
|
properties.diskIOPSReadWrite
|
integer
|
O número de IOPS permitido para este disco; apenas configurável para discos UltraSSD. Uma operação pode transferir entre 4k e 256k bytes.
|
properties.diskMBpsReadOnly
|
integer
|
A taxa de transferência total (MBps) que será permitida em todas as VMs que montam o disco compartilhado como Somente leitura. MBps significa milhões de bytes por segundo - MB aqui usa a notação ISO, de potências de 10.
|
properties.diskMBpsReadWrite
|
integer
|
A largura de banda permitida para este disco; apenas configurável para discos UltraSSD. MBps significa milhões de bytes por segundo - MB aqui usa a notação ISO, de potências de 10.
|
properties.diskSizeGB
|
integer
|
Se creationData.createOption estiver vazio, este campo é obrigatório e indica o tamanho do disco a ser criado. Se este campo estiver presente para atualizações ou criação com outras opções, indica um redimensionamento. Os redimensionamentos só são permitidos se o disco não estiver conectado a uma VM em execução e só podem aumentar o tamanho do disco.
|
properties.encryption
|
Encryption
|
A propriedade de criptografia pode ser usada para criptografar dados em repouso com chaves gerenciadas pelo cliente ou chaves gerenciadas pela plataforma.
|
properties.encryptionSettingsCollection
|
EncryptionSettingsCollection
|
A coleção de configurações de criptografia usada como Criptografia de Disco do Azure pode conter várias configurações de criptografia por disco ou instantâneo.
|
properties.maxShares
|
integer
|
O número máximo de VMs que podem ser conectadas ao disco ao mesmo tempo. Valor maior que um indica um disco que pode ser montado em várias VMs ao mesmo tempo.
|
properties.networkAccessPolicy
|
NetworkAccessPolicy
|
Política para aceder ao disco através da rede.
|
properties.optimizedForFrequentAttach
|
boolean
|
Definir essa propriedade como true melhora a confiabilidade e o desempenho de discos de dados que são frequentemente (mais de 5 vezes por dia) separados de uma máquina virtual e conectados a outra. Essa propriedade não deve ser definida para discos que não são desanexados e anexados com freqüência, pois faz com que os discos não se alinhem com o domínio de falha da máquina virtual.
|
properties.osType
|
OperatingSystemTypes
|
o tipo de sistema operacional.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
Política para controlar a exportação no disco.
|
properties.purchasePlan
|
PurchasePlan
|
Informações do plano de compra a serem adicionadas no disco do sistema operacional
|
properties.supportedCapabilities
|
SupportedCapabilities
|
Lista de recursos suportados a serem adicionados no disco do sistema operacional.
|
properties.supportsHibernation
|
boolean
|
Indica que o SO num disco suporta a hibernação.
|
properties.tier
|
string
|
Camada de desempenho do disco (por exemplo, P4, S10) conforme descrito aqui: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Não se aplica a discos Ultra.
|
sku
|
DiskSku
|
O nome da sku dos discos. Pode ser Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS ou PremiumV2_LRS.
|
tags
|
object
|
Tags de recursos
|
Respostas
Name |
Tipo |
Description |
200 OK
|
Disk
|
OK
|
202 Accepted
|
Disk
|
Aceito
|
Segurança
azure_auth
Azure Ative Directory OAuth2 Flow
Tipo:
oauth2
Fluxo:
implicit
URL de Autorização:
https://login.microsoftonline.com/common/oauth2/authorize
Âmbitos
Name |
Description |
user_impersonation
|
personificar a sua conta de utilizador
|
Exemplos
Create or update a bursting enabled managed disk.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"diskSizeGB": 1024,
"burstingEnabled": true
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_CreateOrUpdate_BurstingEnabled.json
*/
/**
* Sample code: Create or update a bursting enabled managed disk.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void createOrUpdateABurstingEnabledManagedDisk(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withDiskSizeGB(1024).withBurstingEnabled(true), 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_create_or_update_bursting_enabled.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"burstingEnabled": True, "diskSizeGB": 1024}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
func ExampleDisksClient_BeginUpdate_createOrUpdateABurstingEnabledManagedDisk() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
BurstingEnabled: to.Ptr(true),
DiskSizeGB: to.Ptr[int32](1024),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// BurstingEnabled: to.Ptr(true),
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// DiskSizeGB: to.Ptr[int32](1024),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
*/
async function createOrUpdateABurstingEnabledManagedDisk() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { burstingEnabled: true, diskSizeGB: 1024 };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
DiskSizeGB = 1024,
BurstingEnabled = true,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 1024,
"provisioningState": "Updating"
},
"location": "West US",
"name": "myDisk"
}
{
"id": "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk",
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 1024,
"burstingEnabled": true,
"provisioningState": "Succeeded"
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk to add accelerated networking.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportedCapabilities": {
"acceleratedNetwork": false
}
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.SupportedCapabilities;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddAcceleratedNetworking.json
*/
/**
* Sample code: Update a managed disk to add accelerated networking.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateAManagedDiskToAddAcceleratedNetworking(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withSupportedCapabilities(new SupportedCapabilities().withAcceleratedNetwork(false)),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_accelerated_networking.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportedCapabilities": {"acceleratedNetwork": False}}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddAcceleratedNetworking() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportedCapabilities: &armcompute.SupportedCapabilities{
AcceleratedNetwork: to.Ptr(false),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportedCapabilities: &armcompute.SupportedCapabilities{
// AcceleratedNetwork: to.Ptr(false),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
*/
async function updateAManagedDiskToAddAcceleratedNetworking() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = {
supportedCapabilities: { acceleratedNetwork: false },
};
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportedCapabilities = new SupportedCapabilities
{
AcceleratedNetwork = false,
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"acceleratedNetwork": false
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"acceleratedNetwork": false
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to add architecture.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportedCapabilities": {
"architecture": "Arm64"
}
}
}
import com.azure.resourcemanager.compute.models.Architecture;
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.SupportedCapabilities;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_ToAddArchitecture.json
*/
/**
* Sample code: Update a managed disk to add architecture.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToAddArchitecture(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks()
.update("myResourceGroup", "myDisk",
new DiskUpdate()
.withSupportedCapabilities(new SupportedCapabilities().withArchitecture(Architecture.ARM64)),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_to_add_architecture.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportedCapabilities": {"architecture": "Arm64"}}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddArchitecture() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportedCapabilities: &armcompute.SupportedCapabilities{
Architecture: to.Ptr(armcompute.ArchitectureArm64),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportedCapabilities: &armcompute.SupportedCapabilities{
// Architecture: to.Ptr(armcompute.ArchitectureArm64),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
*/
async function updateAManagedDiskToAddArchitecture() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { supportedCapabilities: { architecture: "Arm64" } };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportedCapabilities = new SupportedCapabilities
{
Architecture = ArchitectureType.Arm64,
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"architecture": "Arm64"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"architecture": "Arm64"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to add purchase plan.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"purchasePlan": {
"name": "myPurchasePlanName",
"publisher": "myPurchasePlanPublisher",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode"
}
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.PurchasePlanAutoGenerated;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddPurchasePlan.json
*/
/**
* Sample code: Update a managed disk to add purchase plan.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToAddPurchasePlan(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks()
.update("myResourceGroup", "myDisk",
new DiskUpdate().withPurchasePlan(new PurchasePlanAutoGenerated().withName("myPurchasePlanName")
.withPublisher("myPurchasePlanPublisher").withProduct("myPurchasePlanProduct")
.withPromotionCode("fakeTokenPlaceholder")),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_purchase_plan.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={
"properties": {
"purchasePlan": {
"name": "myPurchasePlanName",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode",
"publisher": "myPurchasePlanPublisher",
}
}
},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddPurchasePlan() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
PurchasePlan: &armcompute.DiskPurchasePlan{
Name: to.Ptr("myPurchasePlanName"),
Product: to.Ptr("myPurchasePlanProduct"),
PromotionCode: to.Ptr("myPurchasePlanPromotionCode"),
Publisher: to.Ptr("myPurchasePlanPublisher"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// PurchasePlan: &armcompute.DiskPurchasePlan{
// Name: to.Ptr("myPurchasePlanName"),
// Product: to.Ptr("myPurchasePlanProduct"),
// PromotionCode: to.Ptr("myPurchasePlanPromotionCode"),
// Publisher: to.Ptr("myPurchasePlanPublisher"),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
*/
async function updateAManagedDiskToAddPurchasePlan() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = {
purchasePlan: {
name: "myPurchasePlanName",
product: "myPurchasePlanProduct",
promotionCode: "myPurchasePlanPromotionCode",
publisher: "myPurchasePlanPublisher",
},
};
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
PurchasePlan = new DiskPurchasePlan("myPurchasePlanName", "myPurchasePlanPublisher", "myPurchasePlanProduct")
{
PromotionCode = "myPurchasePlanPromotionCode",
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"purchasePlan": {
"name": "myPurchasePlanName",
"publisher": "myPurchasePlanPublisher",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"purchasePlan": {
"name": "myPurchasePlanName",
"publisher": "myPurchasePlanPublisher",
"product": "myPurchasePlanProduct",
"promotionCode": "myPurchasePlanPromotionCode"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to add supportsHibernation.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportsHibernation": true
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddSupportsHibernation.json
*/
/**
* Sample code: Update a managed disk to add supportsHibernation.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateAManagedDiskToAddSupportsHibernation(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withSupportsHibernation(true), 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_supports_hibernation.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportsHibernation": True}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddSupportsHibernation() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportsHibernation: to.Ptr(true),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionImport),
// SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"),
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportsHibernation: to.Ptr(true),
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
*/
async function updateAManagedDiskToAddSupportsHibernation() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { supportsHibernation: true };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportsHibernation = true,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportsHibernation": true,
"creationData": {
"createOption": "Import",
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportsHibernation": true,
"creationData": {
"createOption": "Import",
"sourceUri": "https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update a managed disk to change tier.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"tier": "P30"
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_ChangeTier.json
*/
/**
* Sample code: Update a managed disk to change tier.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToChangeTier(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withTier("P30"), 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_change_tier.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"tier": "P30"}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToChangeTier() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
Tier: to.Ptr("P30"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// Tier: to.Ptr("P30"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json
*/
async function updateAManagedDiskToChangeTier() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { tier: "P30" };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
Tier = "P30",
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Updating",
"tier": "P10",
"propertyUpdatesInProgress": {
"targetTier": "P30"
}
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Succeeded",
"tier": "P30"
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk to disable bursting.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"burstingEnabled": false
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_DisableBursting.json
*/
/**
* Sample code: Update a managed disk to disable bursting.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskToDisableBursting(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withBurstingEnabled(false), 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_disable_bursting.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"burstingEnabled": False}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToDisableBursting() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
BurstingEnabled: to.Ptr(false),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json
*/
async function updateAManagedDiskToDisableBursting() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { burstingEnabled: false };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
BurstingEnabled = false,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Updating"
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"provisioningState": "Succeeded"
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk to disable optimizedForFrequentAttach.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"optimizedForFrequentAttach": false
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_DisableOptimizedForFrequentAttach.json
*/
/**
* Sample code: Update a managed disk to disable optimizedForFrequentAttach.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateAManagedDiskToDisableOptimizedForFrequentAttach(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withOptimizedForFrequentAttach(false), 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_disable_optimized_for_frequent_attach.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"optimizedForFrequentAttach": False}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskToDisableOptimizedForFrequentAttach() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
OptimizedForFrequentAttach: to.Ptr(false),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// DiskSizeGB: to.Ptr[int32](200),
// OptimizedForFrequentAttach: to.Ptr(false),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
*/
async function updateAManagedDiskToDisableOptimizedForFrequentAttach() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { optimizedForFrequentAttach: false };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
IsOptimizedForFrequentAttach = false,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Updating",
"optimizedForFrequentAttach": false
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Succeeded",
"optimizedForFrequentAttach": false
},
"location": "West US",
"name": "myDisk"
}
Update a managed disk with diskControllerTypes.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"supportedCapabilities": {
"diskControllerTypes": "SCSI"
}
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.SupportedCapabilities;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_AddDiskControllerTypes.json
*/
/**
* Sample code: Update a managed disk with diskControllerTypes.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void updateAManagedDiskWithDiskControllerTypes(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withSupportedCapabilities(new SupportedCapabilities().withDiskControllerTypes("SCSI")),
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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_add_disk_controller_types.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"supportedCapabilities": {"diskControllerTypes": "SCSI"}}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
func ExampleDisksClient_BeginUpdate_updateAManagedDiskWithDiskControllerTypes() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
SupportedCapabilities: &armcompute.SupportedCapabilities{
DiskControllerTypes: to.Ptr("SCSI"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("westus"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage),
// ImageReference: &armcompute.ImageDiskReference{
// ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"),
// },
// },
// DiskSizeGB: to.Ptr[int32](127),
// HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1),
// OSType: to.Ptr(armcompute.OperatingSystemTypesWindows),
// ProvisioningState: to.Ptr("Succeeded"),
// SupportedCapabilities: &armcompute.SupportedCapabilities{
// DiskControllerTypes: to.Ptr("SCSI"),
// },
// },
// SKU: &armcompute.DiskSKU{
// Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS),
// Tier: to.Ptr("Standard"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
*/
async function updateAManagedDiskWithDiskControllerTypes() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = {
supportedCapabilities: { diskControllerTypes: "SCSI" },
};
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
SupportedCapabilities = new SupportedCapabilities
{
DiskControllerTypes = "SCSI",
},
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"diskControllerTypes": "SCSI"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Updating"
}
}
{
"name": "myDisk",
"location": "westus",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"osType": "Windows",
"hyperVGeneration": "V1",
"supportedCapabilities": {
"diskControllerTypes": "SCSI"
},
"creationData": {
"createOption": "FromImage",
"imageReference": {
"id": "/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"
}
},
"diskSizeGB": 127,
"provisioningState": "Succeeded"
}
}
Update managed disk to remove disk access resource association.
Pedido de amostra
PATCH https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"networkAccessPolicy": "AllowAll"
}
}
import com.azure.resourcemanager.compute.models.DiskUpdate;
import com.azure.resourcemanager.compute.models.NetworkAccessPolicy;
/**
* Samples for Disks Update.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/
* Disk_Update_RemoveDiskAccess.json
*/
/**
* Sample code: Update managed disk to remove disk access resource association.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
updateManagedDiskToRemoveDiskAccessResourceAssociation(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getDisks().update("myResourceGroup", "myDisk",
new DiskUpdate().withNetworkAccessPolicy(NetworkAccessPolicy.ALLOW_ALL), 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 typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python disk_update_remove_disk_access.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.disks.begin_update(
resource_group_name="myResourceGroup",
disk_name="myDisk",
disk={"properties": {"networkAccessPolicy": "AllowAll"}},
).result()
print(response)
# x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/069a65e8a6d1a6c0c58d9a9d97610b7103b6e8a5/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
func ExampleDisksClient_BeginUpdate_updateManagedDiskToRemoveDiskAccessResourceAssociation() {
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)
}
poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{
Properties: &armcompute.DiskUpdateProperties{
NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.Disk = armcompute.Disk{
// Name: to.Ptr("myDisk"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.DiskProperties{
// CreationData: &armcompute.CreationData{
// CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty),
// },
// DiskSizeGB: to.Ptr[int32](200),
// NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
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 Updates (patches) a disk.
*
* @summary Updates (patches) a disk.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
*/
async function updateManagedDiskToRemoveDiskAccessResourceAssociation() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const diskName = "myDisk";
const disk = { networkAccessPolicy: "AllowAll" };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.disks.beginUpdateAndWait(resourceGroupName, diskName, disk);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Compute;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json
// this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ManagedDiskResource created on azure
// for more information of creating ManagedDiskResource, please refer to the document of ManagedDiskResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string diskName = "myDisk";
ResourceIdentifier managedDiskResourceId = ManagedDiskResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, diskName);
ManagedDiskResource managedDisk = client.GetManagedDiskResource(managedDiskResourceId);
// invoke the operation
ManagedDiskPatch patch = new ManagedDiskPatch
{
NetworkAccessPolicy = NetworkAccessPolicy.AllowAll,
};
ArmOperation<ManagedDiskResource> lro = await managedDisk.UpdateAsync(WaitUntil.Completed, patch);
ManagedDiskResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ManagedDiskData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
Location: https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk?api-version=2024-03-02
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Updating",
"networkAccessPolicy": "AllowAll"
},
"location": "West US",
"name": "myDisk"
}
{
"properties": {
"creationData": {
"createOption": "Empty"
},
"diskSizeGB": 200,
"provisioningState": "Succeeded",
"networkAccessPolicy": "AllowAll"
},
"location": "West US",
"name": "myDisk"
}
Definições
Architecture
Arquitetura de CPU suportada por um disco do sistema operacional.
Name |
Tipo |
Description |
Arm64
|
string
|
|
x64
|
string
|
|
CreationData
Dados usados ao criar um disco.
Name |
Tipo |
Description |
createOption
|
DiskCreateOption
|
Isso enumera as possíveis fontes de criação de um disco.
|
elasticSanResourceId
|
string
|
Obrigatório se createOption for CopyFromSanSnapshot. Este é o ID ARM do instantâneo de volume do san elástico de origem.
|
galleryImageReference
|
ImageDiskReference
|
Obrigatório se criar a partir de uma imagem da Galeria. O id/sharedGalleryImageId/communityGalleryImageId do ImageDiskReference será o id ARM da versão da imagem de galé compartilhada a partir da qual criar um disco.
|
imageReference
|
ImageDiskReference
|
Informações de origem do disco para PIR ou imagens do usuário.
|
logicalSectorSize
|
integer
|
Tamanho do setor lógico em bytes para discos Ultra. Os valores suportados são 512 ad 4096. 4096 é o padrão.
|
performancePlus
|
boolean
|
Defina esse sinalizador como true para obter um aumento na meta de desempenho do disco implantado, veja aqui a respetiva meta de desempenho. Este sinalizador só pode ser definido no tempo de criação do disco e não pode ser desativado depois de ativado.
|
provisionedBandwidthCopySpeed
|
ProvisionedBandwidthCopyOption
|
Se esse campo estiver definido em um snapshot e createOption for CopyStart, o snapshot será copiado em uma velocidade mais rápida.
|
securityDataUri
|
string
|
Se createOption for ImportSecure, este é o URI de um blob a ser importado para o estado convidado da VM.
|
sourceResourceId
|
string
|
Se createOption for Copy, esta é a ID ARM do snapshot ou disco de origem.
|
sourceUniqueId
|
string
|
Se este campo estiver definido, este é o id exclusivo que identifica a origem deste recurso.
|
sourceUri
|
string
|
Se createOption for Import, este é o URI de um blob a ser importado para um disco gerenciado.
|
storageAccountId
|
string
|
Obrigatório se createOption for Import. O identificador do Azure Resource Manager da conta de armazenamento que contém o blob a ser importado como um disco.
|
uploadSizeBytes
|
integer
|
Se createOption for Upload, este é o tamanho do conteúdo do upload, incluindo o rodapé VHD. Esse valor deve estar entre 20972032 (20 MiB + 512 bytes para o rodapé VHD) e 35183298347520 bytes (32 TiB + 512 bytes para o rodapé VHD).
|
DataAccessAuthMode
Requisitos de autenticação adicionais ao exportar ou carregar para um disco ou instantâneo.
Name |
Tipo |
Description |
AzureActiveDirectory
|
string
|
Quando a URL de exportação/carregamento é usada, o sistema verifica se o usuário tem uma identidade no Ative Directory do Azure e tem as permissões necessárias para exportar/carregar os dados. Consulte aka.ms/DisksAzureADAuth.
|
None
|
string
|
Nenhuma autenticação adicional seria executada ao acessar o URL de exportação/upload.
|
Disk
Recurso de disco.
Name |
Tipo |
Description |
extendedLocation
|
ExtendedLocation
|
O local estendido onde o disco será criado. O local estendido não pode ser alterado.
|
id
|
string
|
ID do recurso
|
location
|
string
|
Localização do recurso
|
managedBy
|
string
|
Um URI relativo que contém a ID da VM que tem o disco conectado.
|
managedByExtended
|
string[]
|
Lista de URIs relativos que contêm as IDs das VMs que têm o disco conectado. maxShares deve ser definido como um valor maior que um para discos para permitir anexá-los a várias VMs.
|
name
|
string
|
Nome do recurso
|
properties.LastOwnershipUpdateTime
|
string
|
A hora UTC em que o estado de propriedade do disco foi alterado pela última vez, ou seja, a hora em que o disco foi conectado ou desanexado pela última vez de uma VM ou a hora em que a VM à qual o disco foi conectado foi desalocada ou iniciada.
|
properties.burstingEnabled
|
boolean
|
Defina como true para habilitar o bursting além do destino de desempenho provisionado do disco. O bursting está desativado por padrão. Não se aplica a discos Ultra.
|
properties.burstingEnabledTime
|
string
|
Última vez em que o bursting foi ativado pela última vez em um disco.
|
properties.completionPercent
|
number
|
Porcentagem concluída para a cópia em segundo plano quando um recurso é criado por meio da operação CopyStart.
|
properties.creationData
|
CreationData
|
Informações sobre a origem do disco. As informações de CreationData não podem ser alteradas após a criação do disco.
|
properties.dataAccessAuthMode
|
DataAccessAuthMode
|
Requisitos de autenticação adicionais ao exportar ou carregar para um disco ou instantâneo.
|
properties.diskAccessId
|
string
|
ID ARM do recurso DiskAccess para usar pontos de extremidade privados em discos.
|
properties.diskIOPSReadOnly
|
integer
|
O número total de IOPS que serão permitidas em todas as VMs que montam o disco compartilhado como Somente Leitura. Uma operação pode transferir entre 4k e 256k bytes.
|
properties.diskIOPSReadWrite
|
integer
|
O número de IOPS permitido para este disco; apenas configurável para discos UltraSSD. Uma operação pode transferir entre 4k e 256k bytes.
|
properties.diskMBpsReadOnly
|
integer
|
A taxa de transferência total (MBps) que será permitida em todas as VMs que montam o disco compartilhado como Somente leitura. MBps significa milhões de bytes por segundo - MB aqui usa a notação ISO, de potências de 10.
|
properties.diskMBpsReadWrite
|
integer
|
A largura de banda permitida para este disco; apenas configurável para discos UltraSSD. MBps significa milhões de bytes por segundo - MB aqui usa a notação ISO, de potências de 10.
|
properties.diskSizeBytes
|
integer
|
O tamanho do disco em bytes. Este campo é somente leitura.
|
properties.diskSizeGB
|
integer
|
Se creationData.createOption estiver vazio, este campo é obrigatório e indica o tamanho do disco a ser criado. Se este campo estiver presente para atualizações ou criação com outras opções, indica um redimensionamento. Os redimensionamentos só são permitidos se o disco não estiver conectado a uma VM em execução e só podem aumentar o tamanho do disco.
|
properties.diskState
|
DiskState
|
O estado do disco.
|
properties.encryption
|
Encryption
|
A propriedade de criptografia pode ser usada para criptografar dados em repouso com chaves gerenciadas pelo cliente ou chaves gerenciadas pela plataforma.
|
properties.encryptionSettingsCollection
|
EncryptionSettingsCollection
|
A coleção de configurações de criptografia usada para a Criptografia de Disco do Azure pode conter várias configurações de criptografia por disco ou instantâneo.
|
properties.hyperVGeneration
|
HyperVGeneration
|
A geração do hipervisor da máquina virtual. Aplicável apenas a discos do SO.
|
properties.maxShares
|
integer
|
O número máximo de VMs que podem ser conectadas ao disco ao mesmo tempo. Valor maior que um indica um disco que pode ser montado em várias VMs ao mesmo tempo.
|
properties.networkAccessPolicy
|
NetworkAccessPolicy
|
Política para aceder ao disco através da rede.
|
properties.optimizedForFrequentAttach
|
boolean
|
Definir essa propriedade como true melhora a confiabilidade e o desempenho de discos de dados que são frequentemente (mais de 5 vezes por dia) separados de uma máquina virtual e conectados a outra. Essa propriedade não deve ser definida para discos que não são desanexados e anexados com freqüência, pois faz com que os discos não se alinhem com o domínio de falha da máquina virtual.
|
properties.osType
|
OperatingSystemTypes
|
O tipo de sistema operacional.
|
properties.propertyUpdatesInProgress
|
PropertyUpdatesInProgress
|
Propriedades do disco cuja atualização está pendente.
|
properties.provisioningState
|
string
|
O estado de provisionamento do disco.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
Política para controlar a exportação no disco.
|
properties.purchasePlan
|
PurchasePlan
|
Informações do plano de compra para a imagem a partir da qual o disco do SO foi criado. Por exemplo - {nome: 2019-Datacenter, editor: MicrosoftWindowsServer, produto: WindowsServer}
|
properties.securityProfile
|
DiskSecurityProfile
|
Contém as informações relacionadas à segurança do recurso.
|
properties.shareInfo
|
ShareInfoElement[]
|
Detalhes da lista de todas as VMs que têm o disco conectado. maxShares deve ser definido como um valor maior que um para discos para permitir anexá-los a várias VMs.
|
properties.supportedCapabilities
|
SupportedCapabilities
|
Lista de recursos suportados para a imagem a partir da qual o disco do sistema operacional foi criado.
|
properties.supportsHibernation
|
boolean
|
Indica que o SO num disco suporta a hibernação.
|
properties.tier
|
string
|
Camada de desempenho do disco (por exemplo, P4, S10) conforme descrito aqui: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Não se aplica a discos Ultra.
|
properties.timeCreated
|
string
|
A hora em que o disco foi criado.
|
properties.uniqueId
|
string
|
Guid único identificando o recurso.
|
sku
|
DiskSku
|
O nome da sku dos discos. Pode ser Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS ou PremiumV2_LRS.
|
tags
|
object
|
Tags de recursos
|
type
|
string
|
Tipo de recurso
|
zones
|
string[]
|
A lista de zonas lógicas para disco.
|
DiskCreateOption
Isso enumera as possíveis fontes de criação de um disco.
Name |
Tipo |
Description |
Attach
|
string
|
O disco será anexado a uma VM.
|
Copy
|
string
|
Crie um novo disco ou instantâneo copiando de um disco ou instantâneo especificado pelo sourceResourceId fornecido.
|
CopyFromSanSnapshot
|
string
|
Criar um novo disco exportando do elastic san volume snapshot
|
CopyStart
|
string
|
Crie um novo disco usando um processo de cópia detalhada, em que a criação do recurso é considerada concluída somente depois que todos os dados tiverem sido copiados da fonte.
|
Empty
|
string
|
Crie um disco de dados vazio de um tamanho dado por diskSizeGB.
|
FromImage
|
string
|
Crie um novo disco a partir de uma imagem de plataforma especificada por imageReference ou galleryImageReference.
|
Import
|
string
|
Crie um disco importando de um blob especificado por um sourceUri em uma conta de armazenamento especificada por storageAccountId.
|
ImportSecure
|
string
|
Semelhante à opção Importar criar. Crie uma nova VM de inicialização confiável ou um disco suportado por VM confidencial importando blob adicional para o estado de convidado da VM especificado por securityDataUri na conta de armazenamento especificada por storageAccountId
|
Restore
|
string
|
Crie um novo disco copiando de um ponto de recuperação de backup.
|
Upload
|
string
|
Crie um novo disco obtendo um token de gravação e usando-o para carregar diretamente o conteúdo do disco.
|
UploadPreparedSecure
|
string
|
Semelhante à opção Upload create. Crie uma nova VM de Inicialização Confiável ou um disco suportado por VM Confidencial e carregue usando o token de gravação no disco e no estado convidado da VM
|
DiskSecurityProfile
Contém as informações relacionadas à segurança do recurso.
Name |
Tipo |
Description |
secureVMDiskEncryptionSetId
|
string
|
ResourceId do conjunto de criptografia de disco associado ao disco suportado por VM confidencial criptografado com chave gerenciada pelo cliente
|
securityType
|
DiskSecurityTypes
|
Especifica o SecurityType da VM. Aplicável apenas a discos do SO.
|
DiskSecurityTypes
Especifica o SecurityType da VM. Aplicável apenas a discos do SO.
Name |
Tipo |
Description |
ConfidentialVM_DiskEncryptedWithCustomerKey
|
string
|
Indica o disco confidencial da VM com o disco do SO e o estado do convidado da VM encriptados com uma chave gerida pelo cliente
|
ConfidentialVM_DiskEncryptedWithPlatformKey
|
string
|
Indica o disco confidencial da VM com o disco do sistema operacional e o estado do convidado da VM criptografados com uma chave gerenciada pela plataforma
|
ConfidentialVM_NonPersistedTPM
|
string
|
Indica disco VM confidencial com um vTPM efêmero. O estado vTPM não é persistido nas reinicializações da VM.
|
ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey
|
string
|
Indica disco confidencial da VM com apenas o estado do convidado da VM criptografado
|
TrustedLaunch
|
string
|
O Trusted Launch fornece recursos de segurança, como inicialização segura e vTPM (Trusted Platform Module) virtual
|
DiskSku
O nome da sku dos discos. Pode ser Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS ou PremiumV2_LRS.
DiskState
Isso enumera o estado possível do disco.
Name |
Tipo |
Description |
ActiveSAS
|
string
|
O disco atualmente tem um Uri SAS ativo associado a ele.
|
ActiveSASFrozen
|
string
|
O disco está conectado a uma VM em estado de hibernação e tem um URI SAS ativo associado a ele.
|
ActiveUpload
|
string
|
Um disco é criado para upload e um token de gravação foi emitido para upload para ele.
|
Attached
|
string
|
O disco está atualmente conectado a uma VM em execução.
|
Frozen
|
string
|
O disco está conectado a uma VM que está em estado de hibernação.
|
ReadyToUpload
|
string
|
Um disco está pronto para ser criado por upload solicitando um token de gravação.
|
Reserved
|
string
|
O disco está conectado a uma VM desalocada parada.
|
Unattached
|
string
|
O disco não está sendo usado e pode ser conectado a uma VM.
|
DiskStorageAccountTypes
O nome do sku.
Name |
Tipo |
Description |
PremiumV2_LRS
|
string
|
SSD Premium v2 armazenamento localmente redundante. Ideal para cargas de trabalho sensíveis à produção e ao desempenho que exigem consistentemente baixa latência e alta IOPS e taxa de transferência.
|
Premium_LRS
|
string
|
SSD Premium armazenamento localmente redundante. Ideal para cargas de trabalho sensíveis à produção e ao desempenho.
|
Premium_ZRS
|
string
|
Armazenamento redundante de zona SSD premium. Ideal para cargas de trabalho de produção que precisam de resiliência de armazenamento contra falhas de zona.
|
StandardSSD_LRS
|
string
|
SSD padrão armazenamento localmente redundante. Ideal para servidores web, aplicações empresariais levemente utilizadas e desenvolvimento/teste.
|
StandardSSD_ZRS
|
string
|
Armazenamento redundante de zona SSD padrão. Ideal para servidores Web, aplicativos corporativos levemente usados e desenvolvimento/teste que precisam de resiliência de armazenamento contra falhas de zona.
|
Standard_LRS
|
string
|
HDD padrão armazenamento localmente redundante. Ideal para backup, acesso não crítico e pouco frequente.
|
UltraSSD_LRS
|
string
|
Ultra SSD armazenamento localmente redundante. Ideal para cargas de trabalho intensivas de E/S, como SAP HANA, bancos de dados de camada superior (por exemplo, SQL, Oracle) e outras cargas de trabalho com muitas transações.
|
DiskUpdate
Recurso de atualização de disco.
Name |
Tipo |
Description |
properties.burstingEnabled
|
boolean
|
Defina como true para habilitar o bursting além do destino de desempenho provisionado do disco. O bursting está desativado por padrão. Não se aplica a discos Ultra.
|
properties.dataAccessAuthMode
|
DataAccessAuthMode
|
Requisitos de autenticação adicionais ao exportar ou carregar para um disco ou instantâneo.
|
properties.diskAccessId
|
string
|
ID ARM do recurso DiskAccess para usar pontos de extremidade privados em discos.
|
properties.diskIOPSReadOnly
|
integer
|
O número total de IOPS que serão permitidas em todas as VMs que montam o disco compartilhado como Somente Leitura. Uma operação pode transferir entre 4k e 256k bytes.
|
properties.diskIOPSReadWrite
|
integer
|
O número de IOPS permitido para este disco; apenas configurável para discos UltraSSD. Uma operação pode transferir entre 4k e 256k bytes.
|
properties.diskMBpsReadOnly
|
integer
|
A taxa de transferência total (MBps) que será permitida em todas as VMs que montam o disco compartilhado como Somente leitura. MBps significa milhões de bytes por segundo - MB aqui usa a notação ISO, de potências de 10.
|
properties.diskMBpsReadWrite
|
integer
|
A largura de banda permitida para este disco; apenas configurável para discos UltraSSD. MBps significa milhões de bytes por segundo - MB aqui usa a notação ISO, de potências de 10.
|
properties.diskSizeGB
|
integer
|
Se creationData.createOption estiver vazio, este campo é obrigatório e indica o tamanho do disco a ser criado. Se este campo estiver presente para atualizações ou criação com outras opções, indica um redimensionamento. Os redimensionamentos só são permitidos se o disco não estiver conectado a uma VM em execução e só podem aumentar o tamanho do disco.
|
properties.encryption
|
Encryption
|
A propriedade de criptografia pode ser usada para criptografar dados em repouso com chaves gerenciadas pelo cliente ou chaves gerenciadas pela plataforma.
|
properties.encryptionSettingsCollection
|
EncryptionSettingsCollection
|
A coleção de configurações de criptografia usada como Criptografia de Disco do Azure pode conter várias configurações de criptografia por disco ou instantâneo.
|
properties.maxShares
|
integer
|
O número máximo de VMs que podem ser conectadas ao disco ao mesmo tempo. Valor maior que um indica um disco que pode ser montado em várias VMs ao mesmo tempo.
|
properties.networkAccessPolicy
|
NetworkAccessPolicy
|
Política para aceder ao disco através da rede.
|
properties.optimizedForFrequentAttach
|
boolean
|
Definir essa propriedade como true melhora a confiabilidade e o desempenho de discos de dados que são frequentemente (mais de 5 vezes por dia) separados de uma máquina virtual e conectados a outra. Essa propriedade não deve ser definida para discos que não são desanexados e anexados com freqüência, pois faz com que os discos não se alinhem com o domínio de falha da máquina virtual.
|
properties.osType
|
OperatingSystemTypes
|
o tipo de sistema operacional.
|
properties.propertyUpdatesInProgress
|
PropertyUpdatesInProgress
|
Propriedades do disco cuja atualização está pendente.
|
properties.publicNetworkAccess
|
PublicNetworkAccess
|
Política para controlar a exportação no disco.
|
properties.purchasePlan
|
PurchasePlan
|
Informações do plano de compra a serem adicionadas no disco do sistema operacional
|
properties.supportedCapabilities
|
SupportedCapabilities
|
Lista de recursos suportados a serem adicionados no disco do sistema operacional.
|
properties.supportsHibernation
|
boolean
|
Indica que o SO num disco suporta a hibernação.
|
properties.tier
|
string
|
Camada de desempenho do disco (por exemplo, P4, S10) conforme descrito aqui: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Não se aplica a discos Ultra.
|
sku
|
DiskSku
|
O nome da sku dos discos. Pode ser Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS ou PremiumV2_LRS.
|
tags
|
object
|
Tags de recursos
|
Encryption
Configurações de criptografia em repouso para disco ou instantâneo
Name |
Tipo |
Description |
diskEncryptionSetId
|
string
|
ResourceId do conjunto de criptografia de disco a ser usado para habilitar a criptografia em repouso.
|
type
|
EncryptionType
|
O tipo de chave usada para criptografar os dados do disco.
|
EncryptionSettingsCollection
Configurações de criptografia para disco ou instantâneo
Name |
Tipo |
Description |
enabled
|
boolean
|
Defina esse sinalizador como true e forneça DiskEncryptionKey e KeyEncryptionKey opcional para habilitar a criptografia. Defina esse sinalizador como false e remova DiskEncryptionKey e KeyEncryptionKey para desabilitar a criptografia. Se EncryptionSettings for null no objeto request, as configurações existentes permanecerão inalteradas.
|
encryptionSettings
|
EncryptionSettingsElement[]
|
Uma coleção de configurações de criptografia, uma para cada volume de disco.
|
encryptionSettingsVersion
|
string
|
Descreve o tipo de criptografia usado para os discos. Uma vez que este campo é definido, ele não pode ser substituído. '1.0' corresponde ao aplicativo Azure Disk Encryption with AAD.'1.1' corresponde ao Azure Disk Encryption.
|
EncryptionSettingsElement
Configurações de criptografia para um volume de disco.
Name |
Tipo |
Description |
diskEncryptionKey
|
KeyVaultAndSecretReference
|
URL secreto do cofre da chave e ID do cofre da chave de encriptação do disco
|
keyEncryptionKey
|
KeyVaultAndKeyReference
|
URL da chave do cofre e ID do cofre da chave de encriptação da chave. KeyEncryptionKey é opcional e, quando fornecido, é usado para desembrulhar a chave de criptografia do disco.
|
EncryptionType
O tipo de chave usada para criptografar os dados do disco.
Name |
Tipo |
Description |
EncryptionAtRestWithCustomerKey
|
string
|
O disco é criptografado em repouso com a chave gerenciada pelo cliente que pode ser alterada e revogada por um cliente.
|
EncryptionAtRestWithPlatformAndCustomerKeys
|
string
|
O disco é encriptado em repouso com 2 camadas de encriptação. Uma das chaves é gerida pelo Cliente e a outra chave é gerida pela Plataforma.
|
EncryptionAtRestWithPlatformKey
|
string
|
O disco é criptografado em repouso com a chave gerenciada da plataforma. É o tipo de criptografia padrão. Este não é um tipo de encriptação válido para conjuntos de encriptação de disco.
|
ExtendedLocation
O tipo complexo do local estendido.
Name |
Tipo |
Description |
name
|
string
|
O nome do local estendido.
|
type
|
ExtendedLocationTypes
|
O tipo de local estendido.
|
ExtendedLocationTypes
O tipo de local estendido.
Name |
Tipo |
Description |
EdgeZone
|
string
|
|
HyperVGeneration
A geração do hipervisor da máquina virtual. Aplicável apenas a discos do SO.
Name |
Tipo |
Description |
V1
|
string
|
|
V2
|
string
|
|
ImageDiskReference
A imagem de origem usada para criar o disco.
Name |
Tipo |
Description |
communityGalleryImageId
|
string
|
Um uri relativo que contém uma referência de imagem da Galeria de Computação do Azure da comunidade.
|
id
|
string
|
Um uri relativo que contém um repositório de imagens da plataforma, uma imagem do usuário ou uma referência de imagem da Galeria de Computação do Azure.
|
lun
|
integer
|
Se o disco for criado a partir do disco de dados de uma imagem, este é um índice que indica qual dos discos de dados na imagem deve ser usado. Para discos do SO, este campo é null.
|
sharedGalleryImageId
|
string
|
Um uri relativo que contém uma referência de imagem compartilhada direta da Galeria de Computação do Azure.
|
KeyVaultAndKeyReference
Key Vault Key Url e vault id do KeK, KeK é opcional e quando fornecido é usado para desembrulhar a encryptionKey
Name |
Tipo |
Description |
keyUrl
|
string
|
URL apontando para uma chave ou segredo no KeyVault
|
sourceVault
|
SourceVault
|
ID do recurso do KeyVault que contém a chave ou o segredo
|
KeyVaultAndSecretReference
URL secreto do cofre da chave e ID do cofre da chave de encriptação
Name |
Tipo |
Description |
secretUrl
|
string
|
URL apontando para uma chave ou segredo no KeyVault
|
sourceVault
|
SourceVault
|
ID do recurso do KeyVault que contém a chave ou o segredo
|
NetworkAccessPolicy
Política para aceder ao disco através da rede.
Name |
Tipo |
Description |
AllowAll
|
string
|
O disco pode ser exportado ou carregado a partir de qualquer rede.
|
AllowPrivate
|
string
|
O disco pode ser exportado ou carregado usando os pontos de extremidade privados de um recurso do DiskAccess.
|
DenyAll
|
string
|
O disco não pode ser exportado.
|
OperatingSystemTypes
O tipo de sistema operacional.
Name |
Tipo |
Description |
Linux
|
string
|
|
Windows
|
string
|
|
PropertyUpdatesInProgress
Propriedades do disco cuja atualização está pendente.
Name |
Tipo |
Description |
targetTier
|
string
|
A camada de desempenho de destino do disco se uma operação de alteração de camada estiver em andamento.
|
ProvisionedBandwidthCopyOption
Se esse campo estiver definido em um snapshot e createOption for CopyStart, o snapshot será copiado em uma velocidade mais rápida.
Name |
Tipo |
Description |
Enhanced
|
string
|
|
None
|
string
|
|
PublicNetworkAccess
Política para controlar a exportação no disco.
Name |
Tipo |
Description |
Disabled
|
string
|
Não é possível acessar os dados subjacentes do disco publicamente na Internet, mesmo quando NetworkAccessPolicy está definido como AllowAll. Você pode acessar os dados por meio do URI SAS somente de sua VNET confiável do Azure quando NetworkAccessPolicy estiver definido como AllowPrivate.
|
Enabled
|
string
|
Você pode gerar um URI SAS para acessar os dados subjacentes do disco publicamente na Internet quando NetworkAccessPolicy estiver definido como AllowAll. Você pode acessar os dados por meio do URI SAS somente de sua VNET confiável do Azure quando NetworkAccessPolicy estiver definido como AllowPrivate.
|
PurchasePlan
Usado para estabelecer o contexto de compra de qualquer artefato de 3ª Parte através do MarketPlace.
Name |
Tipo |
Description |
name
|
string
|
O ID do plano.
|
product
|
string
|
Especifica o produto da imagem do mercado. Este é o mesmo valor que Offer sob o elemento imageReference.
|
promotionCode
|
string
|
O código promocional da oferta.
|
publisher
|
string
|
O ID do editor.
|
ShareInfoElement
Name |
Tipo |
Description |
vmUri
|
string
|
Um URI relativo que contém a ID da VM que tem o disco conectado.
|
SourceVault
A id do vault é uma id de recurso do Azure Resource Manager no formato /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
Name |
Tipo |
Description |
id
|
string
|
ID do recurso
|
SupportedCapabilities
Lista de recursos suportados persistiu no recurso de disco para uso da VM.
Name |
Tipo |
Description |
acceleratedNetwork
|
boolean
|
True se a imagem a partir da qual o disco do SO é criado suportar redes aceleradas.
|
architecture
|
Architecture
|
Arquitetura de CPU suportada por um disco do sistema operacional.
|
diskControllerTypes
|
string
|
Os controladores de disco suportados por um disco do SO. Se definido, pode ser SCSI ou SCSI, NVME ou NVME, SCSI.
|