Skip to content
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 doc/sphinx/azhelpgen/doc_source_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
"deployment": "src/azure-cli/azure/cli/command_modules/resource/_help.py",
"functionapp": "src/azure-cli/azure/cli/command_modules/appservice/_help.py",
"lock": "src/azure-cli/azure/cli/command_modules/resource/_help.py",
"netappfiles": "src/command_modules/azure-cli-netappfiles/azure/cli/command_modules/netappfiles/_help.py"
"netappfiles": "src/azure-cli/azure/cli/command_modules/netappfiles/_help.py"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
Release History
===============

2.0.0
++++++++++++++++++

* GA release.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include *.rst
30 changes: 30 additions & 0 deletions src/azure-cli/azure/cli/command_modules/netappfiles/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Microsoft Azure CLI 'Azure NetApp Files (ANF)' Command Module
=============================================================

This package is for the Azure NetApp Files (ANF) module.
i.e. 'az netappfiles'


It contains commands that can be used to create and manage volumes. The typical sequence would be to first create an account

az netappfiles account create --resource-group rg -n account_name


Then allocate a storage pool in which volumes can be created

az netappfiles 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 netappfiles 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 netappfiles 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 netappfiles --help
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
import pkg_resources
pkg_resources.declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azure.cli.command_modules.netappfiles._help import helps # pylint: disable=unused-import


class NetAppFilesCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
netappfiles_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.netappfiles.custom#{}')
super(NetAppFilesCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=netappfiles_custom)

def load_command_table(self, args):
super(NetAppFilesCommandsLoader, self).load_command_table(args)
from azure.cli.command_modules.netappfiles.commands import load_command_table
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
super(NetAppFilesCommandsLoader, self).load_arguments(command)
from azure.cli.command_modules.netappfiles._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = NetAppFilesCommandsLoader
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

# pylint: disable=unused-argument


def cf_netappfiles(cli_ctx, *kwargs):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.netapp import AzureNetAppFilesManagementClient
return get_mgmt_service_client(cli_ctx, AzureNetAppFilesManagementClient)


def accounts_mgmt_client_factory(cli_ctx, _):
return cf_netappfiles(cli_ctx).accounts


def pools_mgmt_client_factory(cli_ctx, _):
return cf_netappfiles(cli_ctx).pools


def volumes_mgmt_client_factory(cli_ctx, _):
return cf_netappfiles(cli_ctx).volumes


def mount_targets_mgmt_client_factory(cli_ctx, _):
return cf_netappfiles(cli_ctx).mount_targets


def snapshots_mgmt_client_factory(cli_ctx, _):
return cf_netappfiles(cli_ctx).snapshots
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from knack.util import CLIError
from msrest.exceptions import ValidationError # pylint: disable=import-error
from msrestazure.azure_exceptions import CloudError


def netappfiles_exception_handler(ex):
if isinstance(ex, (CloudError, ValidationError, ValueError)):
message = ex
raise CLIError(message)
else:
import sys

from six import reraise
reraise(*sys.exc_info())
Loading