Skip to content

Commit

Permalink
[storage-or-policy] rename the extension (#1662)
Browse files Browse the repository at this point in the history
* rename the extension

* change codeowner
  • Loading branch information
Juliehzl authored May 8, 2020
1 parent e489082 commit 9d60981
Show file tree
Hide file tree
Showing 50 changed files with 28 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

/src/blueprint/ @fengzhou-msft

/src/storage-ors-preview/ @Juliehzl
/src/storage-or-preview/ @Juliehzl

/src/logic/ @bquantump

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ Release History
0.3.0
++++++
* Rename `az storage account ors-policy` to `az storage account or-policy`.
* Default to `--account-name` for `--destination-account` when creating policy in destination account.
* Default to `--account-name` for `--destination-account` when creating policy in destination account.

0.4.0
++++++
* Rename the extension to `storage-or-policy`.
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
# Azure CLI storage-ors-preview Extension #
This is an extension for storage-ors-preview features.
# Azure CLI storage-or-preview Extension #
This is an extension for storage-or-preview features.

### How to use ###
Install this extension using the below CLI command after release:
```
az extension add -n storage-ors-preview
az extension add -n storage-or-preview
```
Currently you can install use source wheel:
```
az extension add -s https://storageextension.blob.core.windows.net/cliextension/storage_ors_preview-0.3.0-py2.py3-none-any.whl
```

For release history, please refer to https://github.com/Juliehzl/azure-cli-extensions/blob/ors/src/storage-ors-preview/HISTORY.rst.

### Prepare
1. Prepare general purpose v2 storage account
Expand Down Expand Up @@ -70,7 +64,7 @@ az storage account or-policy create \
--prefix-match blobA blobB
```

3. Create Object Replication Service Policy to source storage account through policy associated with destination storage account.
3. Create Object Replication Policy to source storage account through policy associated with destination storage account.
```
az storage account or-policy show -g groupName -n destAccountName --policy-id "3496e652-4cea-4581-b2f7-c86b3971ba92" | az storage account or-policy create -g ResourceGroupName -n srcAccountName -p "@-"
```
Expand All @@ -81,23 +75,23 @@ To save the policyId/ruleId in PowerShell Scripts, you can use:

`$ruleId = (az storage account or-policy create --account-name accountName --resource-group groupName --properties @{path}) --query rules.ruleId)`

##### List ORS Policies on storage account
##### List OR Policies on storage account
```
az storage account or-policy list \
--account-name accountName \
--resource-group groupName
```

##### Show ORS Policy on storage account
##### Show OR Policy on storage account
```
az storage account or-policy show \
--policy-id $policyId \
--account-name accountName \
--resource-group groupName
```

##### Update ORS Policy on storage account
Change source storage account name of existing ORS policy.
##### Update OR Policy on storage account
Change source storage account name of existing OR policy.
```
az storage account or-policy update \
--policy-id $policyId \
Expand All @@ -106,14 +100,14 @@ az storage account or-policy update \
-s newSourceAccount
```

Update existing ORS policy through json file.
Update existing OR policy through json file.
```
az storage account or-policy update \
--policy @policy.json \
--account-name destAccountName \
--resource-group groupName \
```
##### Add rule to existing ORS Policy
##### Add rule to existing OR Policy
```
az storage account or-policy rule add \
--policy-id $policyId \
Expand All @@ -125,15 +119,15 @@ az storage account or-policy rule add \
--min-creation-time '2020-02-19T16:05:00Z'
```

##### List rules for ORS Policy
##### List rules for OR Policy
```
az storage account or-policy rule list \
--policy-id $policyId \
--account-name accountName \
--resource-group groupName
```

##### Show properties of specific rule in ORS Policy
##### Show properties of specific rule in OR Policy
```
az storage account or-policy rule show \
--rule-id $ruleId \
Expand All @@ -142,7 +136,7 @@ az storage account or-policy rule show \
--resource-group groupName
```

##### Update properties for specific ORS Policy Rule
##### Update properties for specific OR Policy Rule
Change prefix match filter properties.
```
az storage account or-policy rule update \
Expand All @@ -162,7 +156,7 @@ az storage account or-policy rule update \
--resource-group groupName \
--min-creation-time '2020-02-19T16:05:00Z'
```
##### Remove the specified rule in existing ORS Policy
##### Remove the specified rule in existing OR Policy
```
az storage account or-policy rule remove \
--rule-id $ruleId \
Expand All @@ -171,7 +165,7 @@ az storage account or-policy rule remove \
--resource-group groupName
```

##### Delete the specified ORS Policy for storage account
##### Delete the specified OR Policy for storage account
```
az storage account or-policy delete \
--policy-id $policyId \
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType

register_resource_type('latest', CUSTOM_MGMT_STORAGE_ORS, '2019-06-01')
storage_custom = CliCommandType(operations_tmpl='azext_storage_ors_preview.custom#{}')
storage_custom = CliCommandType(operations_tmpl='azext_storage_or_preview.custom#{}')

super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx,
resource_type=CUSTOM_MGMT_STORAGE_ORS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
def load_command_table(self, _):

or_policy_sdk = CliCommandType(
operations_tmpl='azext_storage_ors_preview.vendored_sdks.azure_mgmt_storage.operations'
operations_tmpl='azext_storage_or_preview.vendored_sdks.azure_mgmt_storage.operations'
'#ObjectReplicationPoliciesOperations.{}',
client_factory=cf_or_policy,
resource_type=CUSTOM_MGMT_STORAGE_ORS
)

or_policy_custom_type = CliCommandType(
operations_tmpl='azext_storage_ors_preview.operations.account#{}',
operations_tmpl='azext_storage_or_preview.operations.account#{}',
client_factory=cf_or_policy)

with self.command_group('storage account or-policy', or_policy_sdk, is_preview=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

from azure.cli.core.profiles import CustomResourceType

CUSTOM_MGMT_STORAGE_ORS = CustomResourceType('azext_storage_ors_preview.vendored_sdks.azure_mgmt_storage',
CUSTOM_MGMT_STORAGE_ORS = CustomResourceType('azext_storage_or_preview.vendored_sdks.azure_mgmt_storage',
'StorageManagementClient')
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# TODO: Confirm this is the right version number you want and it matches your
# HISTORY.rst entry.
VERSION = '0.3.1'
VERSION = '0.4.0'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand All @@ -43,7 +43,7 @@
HISTORY = f.read()

setup(
name='storage-ors-preview',
name='storage-or-preview',
version=VERSION,
description='Microsoft Azure Command-Line Tools Storage-ors-preview Extension',
# TODO: Update author and email, if applicable
Expand All @@ -56,5 +56,5 @@
classifiers=CLASSIFIERS,
packages=find_packages(),
install_requires=DEPENDENCIES,
package_data={'azext_storage_ors_preview': ['azext_metadata.json']},
package_data={'azext_storage_or_preview': ['azext_metadata.json']},
)

0 comments on commit 9d60981

Please sign in to comment.