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
3 changes: 2 additions & 1 deletion doc/sphinx/azhelpgen/doc_source_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@
"aks": "src/azure-cli/azure/cli/command_modules/acs/_help.py",
"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"
"lock": "src/azure-cli/azure/cli/command_modules/resource/_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.
30 changes: 30 additions & 0 deletions src/azure-cli/azure/cli/command_modules/netappfiles/__init__.py
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