Obtém o status da migração em curso para a conta de armazenamento especificada.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/default?api-version=2023-05-01
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
accountName
|
path |
True
|
string
|
O nome da conta de armazenamento dentro do grupo de recursos especificado. Os nomes das contas de armazenamento devem ter entre 3 e 24 caracteres e usar apenas números e letras minúsculas.
Padrão Regex: ^[a-z0-9]+$
|
migrationName
|
path |
True
|
MigrationName
|
O nome da Migração da Conta de Armazenamento. Deve ser sempre 'default'
Padrão Regex: ^[a-z][a-z0-9]*$
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos dentro da assinatura do usuário. O nome não diferencia maiúsculas de minúsculas.
Padrão Regex: ^[-\w\._\(\)]+$
|
subscriptionId
|
path |
True
|
string
|
A ID da assinatura de destino.
|
api-version
|
query |
True
|
string
|
A versão da API a ser usada para esta operação.
|
Respostas
Name |
Tipo |
Description |
200 OK
|
StorageAccountMigration
|
OK -- Obtenha os detalhes da migração em curso ou concluída com êxito.
|
Other Status Codes
|
ErrorResponse
|
Resposta de erro descrevendo por que a operação falhou.
|
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
StorageAccountGetMigrationFailed
Pedido de amostra
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default?api-version=2023-05-01
import com.azure.resourcemanager.storage.models.MigrationName;
/**
* Samples for StorageAccounts GetCustomerInitiatedMigration.
*/
public final class Main {
/*
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/
* StorageAccountGetMigrationFailed.json
*/
/**
* Sample code: StorageAccountGetMigrationFailed.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void storageAccountGetMigrationFailed(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getStorageAccounts()
.getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT,
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 TYPE_CHECKING, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python storage_account_get_migration_failed.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 = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.storage_accounts.get_customer_initiated_migration(
resource_group_name="resource-group-name",
account_name="accountname",
migration_name="default",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.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 armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.json
func ExampleAccountsClient_GetCustomerInitiatedMigration_storageAccountGetMigrationFailed() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstorage.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAccountsClient().GetCustomerInitiatedMigration(ctx, "resource-group-name", "accountname", armstorage.MigrationNameDefault, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AccountMigration = armstorage.AccountMigration{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/accountMigrations"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default"),
// StorageAccountMigrationDetails: &armstorage.AccountMigrationProperties{
// MigrationFailedDetailedReason: to.Ptr("ZRS is not supported for accounts with archive data."),
// MigrationFailedReason: to.Ptr("ZrsNotSupportedForAccountWithArchiveData"),
// MigrationStatus: to.Ptr(armstorage.MigrationStatusFailed),
// TargetSKUName: to.Ptr(armstorage.SKUNameStandardZRS),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the status of the ongoing migration for the specified storage account.
*
* @summary Gets the status of the ongoing migration for the specified storage account.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.json
*/
async function storageAccountGetMigrationFailed() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "resource-group-name";
const accountName = "accountname";
const migrationName = "default";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.storageAccounts.getCustomerInitiatedMigration(
resourceGroupName,
accountName,
migrationName,
);
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.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.json
// this example is just showing the usage of "StorageAccounts_GetCustomerInitiatedMigration" 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 StorageAccountResource created on azure
// for more information of creating StorageAccountResource, please refer to the document of StorageAccountResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "resource-group-name";
string accountName = "accountname";
ResourceIdentifier storageAccountResourceId = StorageAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
StorageAccountResource storageAccount = client.GetStorageAccountResource(storageAccountResourceId);
// get the collection of this StorageAccountMigrationResource
StorageAccountMigrationCollection collection = storageAccount.GetStorageAccountMigrations();
// invoke the operation
StorageAccountMigrationName migrationName = StorageAccountMigrationName.Default;
NullableResponse<StorageAccountMigrationResource> response = await collection.GetIfExistsAsync(migrationName);
StorageAccountMigrationResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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
StorageAccountMigrationData 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
{
"id": "/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default",
"name": "default",
"type": "Microsoft.Storage/storageAccounts/accountMigrations",
"properties": {
"targetSkuName": "Standard_ZRS",
"migrationStatus": "Failed",
"migrationFailedReason": "ZrsNotSupportedForAccountWithArchiveData",
"migrationFailedDetailedReason": "ZRS is not supported for accounts with archive data."
}
}
StorageAccountGetMigrationInProgress
Pedido de amostra
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default?api-version=2023-05-01
import com.azure.resourcemanager.storage.models.MigrationName;
/**
* Samples for StorageAccounts GetCustomerInitiatedMigration.
*/
public final class Main {
/*
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/
* StorageAccountGetMigrationInProgress.json
*/
/**
* Sample code: StorageAccountGetMigrationInProgress.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void storageAccountGetMigrationInProgress(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getStorageAccounts()
.getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT,
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 TYPE_CHECKING, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python storage_account_get_migration_in_progress.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 = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.storage_accounts.get_customer_initiated_migration(
resource_group_name="resource-group-name",
account_name="accountname",
migration_name="default",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.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 armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.json
func ExampleAccountsClient_GetCustomerInitiatedMigration_storageAccountGetMigrationInProgress() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstorage.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAccountsClient().GetCustomerInitiatedMigration(ctx, "resource-group-name", "accountname", armstorage.MigrationNameDefault, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AccountMigration = armstorage.AccountMigration{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/accountMigrations"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default"),
// StorageAccountMigrationDetails: &armstorage.AccountMigrationProperties{
// MigrationStatus: to.Ptr(armstorage.MigrationStatusInProgress),
// TargetSKUName: to.Ptr(armstorage.SKUNameStandardZRS),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the status of the ongoing migration for the specified storage account.
*
* @summary Gets the status of the ongoing migration for the specified storage account.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.json
*/
async function storageAccountGetMigrationInProgress() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "resource-group-name";
const accountName = "accountname";
const migrationName = "default";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.storageAccounts.getCustomerInitiatedMigration(
resourceGroupName,
accountName,
migrationName,
);
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.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.json
// this example is just showing the usage of "StorageAccounts_GetCustomerInitiatedMigration" 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 StorageAccountResource created on azure
// for more information of creating StorageAccountResource, please refer to the document of StorageAccountResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "resource-group-name";
string accountName = "accountname";
ResourceIdentifier storageAccountResourceId = StorageAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
StorageAccountResource storageAccount = client.GetStorageAccountResource(storageAccountResourceId);
// get the collection of this StorageAccountMigrationResource
StorageAccountMigrationCollection collection = storageAccount.GetStorageAccountMigrations();
// invoke the operation
StorageAccountMigrationName migrationName = StorageAccountMigrationName.Default;
NullableResponse<StorageAccountMigrationResource> response = await collection.GetIfExistsAsync(migrationName);
StorageAccountMigrationResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// 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
StorageAccountMigrationData 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
{
"id": "/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default",
"name": "default",
"type": "Microsoft.Storage/storageAccounts/accountMigrations",
"properties": {
"targetSkuName": "Standard_ZRS",
"migrationStatus": "InProgress"
}
}
Definições
Name |
Description |
ErrorResponse
|
Uma resposta de erro do provedor de recursos de armazenamento.
|
ErrorResponseBody
|
Contrato do corpo de resposta ao erro.
|
MigrationName
|
O nome da Migração da Conta de Armazenamento. Deve ser sempre 'default'
|
migrationStatus
|
Situação atual da migração
|
SkuName
|
O nome SKU. Necessário para a criação de conta; opcional para atualização. Observe que, em versões mais antigas, o nome da SKU era chamado accountType.
|
StorageAccountMigration
|
Os parâmetros ou status associados a uma migração de conta de armazenamento em andamento ou enfileirada para atualizar sua SKU ou região atual.
|
ErrorResponse
Uma resposta de erro do provedor de recursos de armazenamento.
Name |
Tipo |
Description |
error
|
ErrorResponseBody
|
Corpo de resposta de erro do Provedor de Recursos de Armazenamento do Azure.
|
ErrorResponseBody
Contrato do corpo de resposta ao erro.
Name |
Tipo |
Description |
code
|
string
|
Um identificador para o erro. Os códigos são invariantes e destinam-se a ser consumidos programaticamente.
|
message
|
string
|
Uma mensagem descrevendo o erro, destinada a ser adequada para exibição em uma interface do usuário.
|
MigrationName
O nome da Migração da Conta de Armazenamento. Deve ser sempre 'default'
Name |
Tipo |
Description |
default
|
string
|
|
migrationStatus
Situação atual da migração
Name |
Tipo |
Description |
Complete
|
string
|
|
Failed
|
string
|
|
InProgress
|
string
|
|
Invalid
|
string
|
|
SubmittedForConversion
|
string
|
|
SkuName
O nome SKU. Necessário para a criação de conta; opcional para atualização. Observe que, em versões mais antigas, o nome da SKU era chamado accountType.
Name |
Tipo |
Description |
Premium_LRS
|
string
|
|
Premium_ZRS
|
string
|
|
Standard_GRS
|
string
|
|
Standard_GZRS
|
string
|
|
Standard_LRS
|
string
|
|
Standard_RAGRS
|
string
|
|
Standard_RAGZRS
|
string
|
|
Standard_ZRS
|
string
|
|
StorageAccountMigration
Os parâmetros ou status associados a uma migração de conta de armazenamento em andamento ou enfileirada para atualizar sua SKU ou região atual.
Name |
Tipo |
Description |
id
|
string
|
ID do recurso de migração
|
name
|
string
|
O valor atual é 'padrão' para a migração iniciada pelo cliente
|
properties.migrationFailedDetailedReason
|
string
|
Motivo da falha na migração
|
properties.migrationFailedReason
|
string
|
Código de erro para falha de migração
|
properties.migrationStatus
|
migrationStatus
|
Situação atual da migração
|
properties.targetSkuName
|
SkuName
|
Nome da sku de destino para a conta
|
type
|
string
|
SrpAccountMigrationType no contrato ARM que é 'accountMigrations'
|