Skip to content

Commit

Permalink
Merge pull request #263 from calvinhzy/storage_account_customer_migra…
Browse files Browse the repository at this point in the history
…tion

[Storage-Preview] `az storage account migration`: Add command group
  • Loading branch information
calvinhzy authored Aug 11, 2023
2 parents 05bbb03 + 3b0a859 commit 5bbcf54
Show file tree
Hide file tree
Showing 11 changed files with 327 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Commands/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@
- [stack-hci](/Commands/stack-hci/readme.md)
: Manage Azure Stack HCI.

- [storage](/Commands/storage/readme.md)
: Manage Azure Cloud Storage resources.

- [storage-mover](/Commands/storage-mover/readme.md)
: Manage top-level Storage Mover resource.

Expand Down
9 changes: 9 additions & 0 deletions Commands/storage/account/migration/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _storage account migration show_

Get the status of the ongoing migration for the specified storage account.

## Versions

### [2023-01-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5zdG9yYWdlL3N0b3JhZ2VhY2NvdW50cy97fS9hY2NvdW50bWlncmF0aW9ucy97fQ==/2023-01-01.xml) **Preview**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/accountmigrations/{} 2023-01-01 -->
9 changes: 9 additions & 0 deletions Commands/storage/account/migration/_start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _storage account migration start_

Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.

## Versions

### [2023-01-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5zdG9yYWdlL3N0b3JhZ2VhY2NvdW50cy97fS9zdGFydGFjY291bnRtaWdyYXRpb24=/2023-01-01.xml) **Preview**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/startaccountmigration 2023-01-01 -->
11 changes: 11 additions & 0 deletions Commands/storage/account/migration/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# [Group] _storage account migration_

Manage Storage Account Migration

## Commands

- [show](/Commands/storage/account/migration/_show.md)
: Get the status of the ongoing migration for the specified storage account.

- [start](/Commands/storage/account/migration/_start.md)
: Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.
8 changes: 8 additions & 0 deletions Commands/storage/account/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [Group] _storage account_

Manage storage accounts.

## Subgroups

- [migration](/Commands/storage/account/migration/readme.md)
: Manage Storage Account Migration
8 changes: 8 additions & 0 deletions Commands/storage/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# [Group] _storage_

Manage Azure Cloud Storage resources.

## Subgroups

- [account](/Commands/storage/account/readme.md)
: Manage storage accounts.
81 changes: 81 additions & 0 deletions Commands/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -94488,6 +94488,87 @@
"stack-hci"
]
},
"storage": {
"commandGroups": {
"account": {
"commandGroups": {
"migration": {
"commands": {
"show": {
"help": {
"short": "Get the status of the ongoing migration for the specified storage account."
},
"names": [
"storage",
"account",
"migration",
"show"
],
"versions": [
{
"name": "2023-01-01",
"resources": [
{
"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/accountmigrations/{}",
"plane": "mgmt-plane",
"version": "2023-01-01"
}
],
"stage": "Preview"
}
]
},
"start": {
"help": {
"short": "Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region."
},
"names": [
"storage",
"account",
"migration",
"start"
],
"versions": [
{
"name": "2023-01-01",
"resources": [
{
"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/startaccountmigration",
"plane": "mgmt-plane",
"version": "2023-01-01"
}
],
"stage": "Preview"
}
]
}
},
"help": {
"short": "Manage Storage Account Migration"
},
"names": [
"storage",
"account",
"migration"
]
}
},
"help": {
"short": "Manage storage accounts."
},
"names": [
"storage",
"account"
]
}
},
"help": {
"short": "Manage Azure Cloud Storage resources."
},
"names": [
"storage"
]
},
"storage-mover": {
"commandGroups": {
"agent": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/accountmigrations/{}", "version": "2023-01-01", "swagger": "mgmt-plane/storage/ResourceProviders/Microsoft.Storage/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMve2FjY291bnROYW1lfS9hY2NvdW50TWlncmF0aW9ucy97bWlncmF0aW9uTmFtZX0=/V/MjAyMy0wMS0wMQ=="}], "commandGroups": [{"name": "storage account migration", "commands": [{"name": "show", "version": "2023-01-01", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/accountmigrations/{}", "version": "2023-01-01", "swagger": "mgmt-plane/storage/ResourceProviders/Microsoft.Storage/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMve2FjY291bnROYW1lfS9hY2NvdW50TWlncmF0aW9ucy97bWlncmF0aW9uTmFtZX0=/V/MjAyMy0wMS0wMQ=="}], "argGroups": [{"name": "", "args": [{"type": "string", "var": "$Path.accountName", "options": ["account-name"], "required": true, "idPart": "name", "help": {"short": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only."}, "format": {"pattern": "^[a-z0-9]+$", "maxLength": 24, "minLength": 3}}, {"type": "string", "var": "$Path.migrationName", "options": ["n", "name", "migration-name"], "required": true, "idPart": "child_name_1", "help": {"short": "The name of the Storage Account Migration. It should always be 'default'"}, "format": {"pattern": "^[a-z][a-z0-9]*$"}, "enum": {"items": [{"name": "default", "value": "default"}]}}, {"type": "ResourceGroupName", "var": "$Path.resourceGroupName", "options": ["g", "resource-group"], "required": true, "idPart": "resource_group"}, {"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}]}], "operations": [{"operationId": "StorageAccounts_GetCustomerInitiatedMigration", "http": {"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}", "request": {"method": "get", "path": {"params": [{"type": "string", "name": "accountName", "arg": "$Path.accountName", "required": true, "format": {"pattern": "^[a-z0-9]+$", "maxLength": 24, "minLength": 3}}, {"type": "string", "name": "migrationName", "arg": "$Path.migrationName", "required": true, "format": {"pattern": "^[a-z][a-z0-9]*$"}, "enum": {"items": [{"value": "default"}]}}, {"type": "string", "name": "resourceGroupName", "arg": "$Path.resourceGroupName", "required": true, "format": {"pattern": "^[-\\w\\._\\(\\)]+$", "maxLength": 90, "minLength": 1}}, {"type": "string", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true, "format": {"minLength": 1}}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2023-01-01"}, "type": "string", "name": "api-version", "required": true, "format": {"minLength": 1}}]}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"readOnly": true, "type": "string", "name": "id"}, {"type": "string", "name": "name"}, {"type": "object", "name": "properties", "required": true, "props": [{"readOnly": true, "type": "string", "name": "migrationFailedDetailedReason"}, {"readOnly": true, "type": "string", "name": "migrationFailedReason"}, {"readOnly": true, "type": "string", "name": "migrationStatus", "enum": {"items": [{"value": "Complete"}, {"value": "Failed"}, {"value": "InProgress"}, {"value": "Invalid"}, {"value": "SubmittedForConversion"}]}}, {"type": "string", "name": "targetSkuName", "required": true, "enum": {"items": [{"value": "Premium_LRS"}, {"value": "Premium_ZRS"}, {"value": "Standard_GRS"}, {"value": "Standard_GZRS"}, {"value": "Standard_LRS"}, {"value": "Standard_RAGRS"}, {"value": "Standard_RAGZRS"}, {"value": "Standard_ZRS"}]}}], "clientFlatten": true}, {"type": "string", "name": "type"}]}}}}, {"isError": true, "body": {"json": {"schema": {"type": "@MgmtErrorFormat"}}}}]}}], "outputs": [{"type": "object", "ref": "$Instance", "clientFlatten": true}]}]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version='1.0' encoding='utf-8'?>
<CodeGen plane="mgmt-plane">
<resource id="/subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/accountmigrations/{}" version="2023-01-01" swagger="mgmt-plane/storage/ResourceProviders/Microsoft.Storage/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMve2FjY291bnROYW1lfS9hY2NvdW50TWlncmF0aW9ucy97bWlncmF0aW9uTmFtZX0=/V/MjAyMy0wMS0wMQ=="/>
<commandGroup name="storage account migration">
<command name="show" version="2023-01-01">
<resource id="/subscriptions/{}/resourcegroups/{}/providers/microsoft.storage/storageaccounts/{}/accountmigrations/{}" version="2023-01-01" swagger="mgmt-plane/storage/ResourceProviders/Microsoft.Storage/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuU3RvcmFnZS9zdG9yYWdlQWNjb3VudHMve2FjY291bnROYW1lfS9hY2NvdW50TWlncmF0aW9ucy97bWlncmF0aW9uTmFtZX0=/V/MjAyMy0wMS0wMQ=="/>
<argGroup name="">
<arg type="string" var="$Path.accountName" options="account-name" required="True" idPart="name">
<help short="The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only."/>
<format pattern="^[a-z0-9]+$" maxLength="24" minLength="3"/>
</arg>
<arg type="string" var="$Path.migrationName" options="migration-name name n" required="True" idPart="child_name_1">
<help short="The name of the Storage Account Migration. It should always be 'default'"/>
<format pattern="^[a-z][a-z0-9]*$"/>
<enum>
<item name="default" value="&quot;default&quot;"/>
</enum>
</arg>
<arg type="ResourceGroupName" var="$Path.resourceGroupName" options="resource-group g" required="True" idPart="resource_group"/>
<arg type="SubscriptionId" var="$Path.subscriptionId" options="subscription" required="True" idPart="subscription"/>
</argGroup>
<operation operationId="StorageAccounts_GetCustomerInitiatedMigration">
<http path="/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}">
<request method="get">
<path>
<param type="string" name="accountName" arg="$Path.accountName" required="True">
<format pattern="^[a-z0-9]+$" maxLength="24" minLength="3"/>
</param>
<param type="string" name="migrationName" arg="$Path.migrationName" required="True">
<format pattern="^[a-z][a-z0-9]*$"/>
<enum>
<item value="&quot;default&quot;"/>
</enum>
</param>
<param type="string" name="resourceGroupName" arg="$Path.resourceGroupName" required="True">
<format pattern="^[-\w\._\(\)]+$" maxLength="90" minLength="1"/>
</param>
<param type="string" name="subscriptionId" arg="$Path.subscriptionId" required="True">
<format minLength="1"/>
</param>
</path>
<query>
<const readOnly="True" const="True" type="string" name="api-version" required="True">
<default value="&quot;2023-01-01&quot;"/>
<format minLength="1"/>
</const>
</query>
</request>
<response statusCode="200">
<body>
<json var="$Instance">
<schema type="object">
<prop readOnly="True" type="string" name="id"/>
<prop type="string" name="name"/>
<prop type="object" name="properties" required="True" clientFlatten="True">
<prop readOnly="True" type="string" name="migrationFailedDetailedReason"/>
<prop readOnly="True" type="string" name="migrationFailedReason"/>
<prop readOnly="True" type="string" name="migrationStatus">
<enum>
<item value="&quot;Complete&quot;"/>
<item value="&quot;Failed&quot;"/>
<item value="&quot;InProgress&quot;"/>
<item value="&quot;Invalid&quot;"/>
<item value="&quot;SubmittedForConversion&quot;"/>
</enum>
</prop>
<prop type="string" name="targetSkuName" required="True">
<enum>
<item value="&quot;Premium_LRS&quot;"/>
<item value="&quot;Premium_ZRS&quot;"/>
<item value="&quot;Standard_GRS&quot;"/>
<item value="&quot;Standard_GZRS&quot;"/>
<item value="&quot;Standard_LRS&quot;"/>
<item value="&quot;Standard_RAGRS&quot;"/>
<item value="&quot;Standard_RAGZRS&quot;"/>
<item value="&quot;Standard_ZRS&quot;"/>
</enum>
</prop>
</prop>
<prop type="string" name="type"/>
</schema>
</json>
</body>
</response>
<response isError="True">
<body>
<json>
<schema type="@MgmtErrorFormat"/>
</json>
</body>
</response>
</http>
</operation>
<output type="object" ref="$Instance" clientFlatten="True"/>
</command>
</commandGroup>
</CodeGen>
Loading

0 comments on commit 5bbcf54

Please sign in to comment.