Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFSAAS-1708 update from review comments #4

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@

/src/sqlvm-preview/ @yareyes

/src/anf-preview/ @williexu
/src/anf-preview/ @b-lefr
2 changes: 1 addition & 1 deletion src/anf-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Release History
===============

0.0.1
0.1.0
+++++
* Initial release
33 changes: 33 additions & 0 deletions src/anf-preview/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Azure CLI for Azure NetApp Files (ANF) Extension #
This is an extension to azure cli which provides commands to create and manage Azure NetApp File (ANF) storage resources.

## How to use ##
First, install the extension:
```
az extension add --name anf-preview
```

It can then be used to create volumes and snapshots. The typical sequence would be to first create an account
```
az anf account create --resource-group rg -n account_name
```

Then allocate a storage pool in which volumes can be created
```
az anf pool create --resource-group rg -a account_name -n pool_name -l location --size 4398046511104 --service-level "Premium"
```

Volumes are created within the pool resource
```
az anf volume create --resource-group rg -a account_name -p pool_name -n volume_name -l location --service-level "Premium" --usage-threshold 107374182400 --creation-token "unique-token" --subnet-id "/subscriptions/mysubsid/resourceGroups/myrg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/default"
```

Snapshots of volumes can also be created
```
az anf snapshot create --resource-group rg -a account_name --p pool_name -v vname -n snapshot_name -l location --file-system-id volume-uuid
```

These resources can be updated, deleted and listed. See the help to find out more
```
az anf --help
```
5 changes: 0 additions & 5 deletions src/anf-preview/README.rst

This file was deleted.

32 changes: 32 additions & 0 deletions src/anf-preview/azext_anf_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,46 @@ def load_arguments(self, _):
with self.argument_context('anf') as c:
c.argument('account_name', options_list=['--account-name', '-a'], required=True, help='The name of the ANF account')

with self.argument_context('anf account') as c:
c.argument('account_name', id_part='name', options_list=['--account-name', '-n', '-a'], required=True, help='The name of the ANF account')

with self.argument_context('anf account list') as c:
c.argument('account_name', help='The name of the ANF account', id_part=None)

with self.argument_context('anf') as c:
c.argument('pool_name', options_list=['--pool-name', '-p'], required=True, help='The name of the ANF pool')

with self.argument_context('anf pool') as c:
c.argument('account_name', id_part='name')
c.argument('pool_name', id_part='child_name_1', options_list=['--pool-name', '-n', '-p'], required=True, help='The name of the ANF pool')

with self.argument_context('anf pool list') as c:
c.argument('account_name', options_list=['--account-name', '-n', '-a'], help='The name of the ANF account', id_part=None)

with self.argument_context('anf') as c:
c.argument('volume_name', options_list=['--volume-name', '-v'], required=True, help='The name of the ANF volume')

with self.argument_context('anf volume') as c:
c.argument('account_name', id_part='name')
c.argument('pool_name', id_part='child_name_1', options_list=['--pool-name', '-p'], required=True, help='The name of the ANF pool')
c.argument('volume_name', id_part='child_name_2', options_list=['--volume-name', '-n', '-v'], required=True, help='The name of the ANF volume')

with self.argument_context('anf volume list') as c:
c.argument('account_name', options_list=['--account-name', '-a'], required=True, help='The name of the ANF account', id_part=None)
c.argument('pool_name', options_list=['--pool-name', '-n', '-p'], required=True, help='The name of the ANF pool', id_part=None)

with self.argument_context('anf') as c:
c.argument('snapshot_name', options_list=['--snapshot-name', '-s'], required=True, help='The name of the ANF snapshot')

with self.argument_context('anf snapshot') as c:
c.argument('account_name', options_list=['--account-name', '-a'], id_part='name')
c.argument('pool_name', id_part='child_name_1', options_list=['--pool-name', '-p'], required=True, help='The name of the ANF pool')
c.argument('volume_name', id_part='child_name_2', options_list=['--volume-name','-v'], required=True, help='The name of the ANF volume')
c.argument('snapshot_name', id_part='child_name_3', options_list=['--snapshot-name', '-n', '-s'], required=True, help='The name of the ANF snapshot')

with self.argument_context('anf snapshot list') as c:
c.argument('account_name', options_list=['--account-name', '-a'], required=True, help='The name of the ANF account', id_part=None)
c.argument('volume_name', options_list=['--volume-name', '-n', '-v'], required=True, help='The name of the ANF volume', id_part=None)

with self.argument_context('anf') as c:
c.argument('tag', options_list=['--tags'], required=False, help='A list of space separated tags to apply to the account')
Loading