Migracja na żywo konta magazynu w celu włączenia sieci Hns
POST https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration?api-version=2023-01-01&requestType={requestType}
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
accountName
|
path |
True
|
string
|
Nazwa konta magazynu w określonej grupie zasobów. Nazwy kont magazynu muszą mieć długość od 3 do 24 znaków, a tylko cyfry i małe litery.
Regex pattern: ^[a-z0-9]+$
|
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów w ramach subskrypcji użytkownika. W nazwie jest uwzględniana wielkość liter.
Regex pattern: ^[-\w\._\(\)]+$
|
subscriptionId
|
path |
True
|
string
|
Identyfikator subskrypcji docelowej.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia dla tej operacji.
|
requestType
|
query |
True
|
string
|
Wymagane. Hierarchiczny typ migracji przestrzeni nazw może być żądaniem weryfikacji hierarchicznej przestrzeni nazw "HnsOnValidationRequest" lub żądaniem nawodnienia "HnsOnHydrationRequest". Żądanie weryfikacji zweryfikuje migrację, podczas gdy żądanie nawodnienia przeprowadzi migrację konta.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
200 OK
|
|
OK — zwracany po zakończeniu migracji konta magazynu do hierarchicznej przestrzeni nazw.
|
202 Accepted
|
|
Zaakceptowano — zaakceptowane żądanie migracji przestrzeni nazw hierarchicznych; operacja zostanie ukończona asynchronicznie.
|
Other Status Codes
|
ErrorResponse
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
StorageAccountHierarchicalNamespaceMigration
Sample Request
POST https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/res4228/providers/Microsoft.Storage/storageAccounts/sto2434/hnsonmigration?api-version=2023-01-01&requestType=HnsOnValidationRequest
/** Samples for StorageAccounts HierarchicalNamespaceMigration. */
public final class Main {
/*
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/
* StorageAccountHierarchicalNamespaceMigration.json
*/
/**
* Sample code: StorageAccountHierarchicalNamespaceMigration.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
storageAccountHierarchicalNamespaceMigration(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getStorageAccounts().hierarchicalNamespaceMigration("res4228",
"sto2434", "HnsOnValidationRequest", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python storage_account_hierarchical_namespace_migration.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}",
)
client.storage_accounts.begin_hierarchical_namespace_migration(
resource_group_name="res4228",
account_name="sto2434",
request_type="HnsOnValidationRequest",
).result()
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountHierarchicalNamespaceMigration.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/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountHierarchicalNamespaceMigration.json
func ExampleAccountsClient_BeginHierarchicalNamespaceMigration() {
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)
}
poller, err := clientFactory.NewAccountsClient().BeginHierarchicalNamespaceMigration(ctx, "res4228", "sto2434", "HnsOnValidationRequest", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
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 Live Migration of storage account to enable Hns
*
* @summary Live Migration of storage account to enable Hns
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountHierarchicalNamespaceMigration.json
*/
async function storageAccountHierarchicalNamespaceMigration() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res4228";
const accountName = "sto2434";
const requestType = "HnsOnValidationRequest";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.storageAccounts.beginHierarchicalNamespaceMigrationAndWait(
resourceGroupName,
accountName,
requestType
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
Location: https://endpoint:port/subscriptions/{subscription-id}/providers/Microsoft.Storage/locations/{location}/asyncoperations/{operationid}?monitor=true&api-version=2022-09-01
Definicje
ErrorResponse
Odpowiedź o błędzie od dostawcy zasobów magazynu.
Nazwa |
Typ |
Opis |
error
|
ErrorResponseBody
|
Treść odpowiedzi dostawcy zasobów usługi Azure Storage.
|
ErrorResponseBody
Kontrakt treści odpowiedzi na błąd.
Nazwa |
Typ |
Opis |
code
|
string
|
Identyfikator błędu. Kody są niezmienne i mają być używane programowo.
|
message
|
string
|
Komunikat opisujący błąd, który ma być odpowiedni do wyświetlania w interfejsie użytkownika.
|