Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@
/src/azure-cli/azure/cli/command_modules/util/ @jiasli @Juliehzl @zhoxing-ms
/src/azure-cli/azure/cli/command_modules/synapse/ @idear1203 @sunsw1994 @aim-for-better
/src/azure-cli/azure/cli/command_modules/hdinsight/ @aim-for-better @haroldrandom @Juliehzl
/src/azure-cli/azure/cli/command_modules/databoxedge/ @evelyn-ys @Juliehzl
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 @@ -74,5 +74,6 @@
"apim": "src/azure-cli/azure/cli/command_modules/apim/_help.py",
"aro": "src/azure-cli/azure/cli/command_modules/aro/_help.py",
"util": "src/azure-cli/azure/cli/command_modules/util/_help.py",
"synapse": "src/azure-cli/azure/cli/command_modules/synapse/_help.py"
"synapse": "src/azure-cli/azure/cli/command_modules/synapse/_help.py",
"databoxedge": "src/azure-cli/azure/cli/command_modules/databoxedge/_help.py"
}
10 changes: 7 additions & 3 deletions src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class ResourceType(Enum): # pylint: disable=too-few-public-methods
MGMT_CONSUMPTION = ('azure.mgmt.consumption', None)
MGMT_CONTAINERINSTANCE = ('azure.mgmt.containerinstance', None)
MGMT_COSMOSDB = ('azure.mgmt.cosmosdb', None)
MGMT_DATABOXEDGE = ('azure.mgmt.databoxedge', None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could specify the client name here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

MGMT_DEPLOYMENTMANAGER = ('azure.mgmt.deploymentmanager', None)
MGMT_DATALAKE_ANALYTICS = ('azure.mgmt.datalake.analytics', None)
MGMT_DATALAKE_STORE = ('azure.mgmt.datalake.store', None)
Expand Down Expand Up @@ -208,7 +209,8 @@ def default_api_version(self):
}),
ResourceType.MGMT_APPSERVICE: '2019-08-01',
ResourceType.MGMT_IOTHUB: '2020-03-01',
ResourceType.MGMT_ARO: '2020-04-30'
ResourceType.MGMT_ARO: '2020-04-30',
ResourceType.MGMT_DATABOXEDGE: '2019-08-01'
},
'2020-09-01-hybrid': {
ResourceType.MGMT_STORAGE: '2019-06-01',
Expand Down Expand Up @@ -247,7 +249,8 @@ def default_api_version(self):
ResourceType.DATA_COSMOS_TABLE: '2017-04-17',
ResourceType.MGMT_APPSERVICE: '2018-02-01',
ResourceType.MGMT_EVENTHUB: '2018-01-01-preview',
ResourceType.MGMT_IOTHUB: '2019-07-01-preview'
ResourceType.MGMT_IOTHUB: '2019-07-01-preview',
ResourceType.MGMT_DATABOXEDGE: '2019-08-01'
Comment thread
jiasli marked this conversation as resolved.
},
'2019-03-01-hybrid': {
ResourceType.MGMT_STORAGE: '2017-10-01',
Expand Down Expand Up @@ -282,7 +285,8 @@ def default_api_version(self):
# API versions
ResourceType.MGMT_APPSERVICE: '2018-02-01',
ResourceType.MGMT_EVENTHUB: '2018-01-01-preview',
ResourceType.MGMT_IOTHUB: '2019-03-22'
ResourceType.MGMT_IOTHUB: '2019-03-22',
ResourceType.MGMT_DATABOXEDGE: '2019-08-01'
},
'2018-03-01-hybrid': {
ResourceType.MGMT_STORAGE: '2016-01-01',
Expand Down
46 changes: 46 additions & 0 deletions src/azure-cli/azure/cli/command_modules/databoxedge/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

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


class DataBoxEdgeManagementClientCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from .generated._client_factory import cf_databoxedge_cl

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you still want to use generated code, right?
and we should avoid to use relative import

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified

databoxedge_custom = CliCommandType(
operations_tmpl='azure.cli.command_modules.databoxedge.custom#{}',
client_factory=cf_databoxedge_cl)
parent = super(DataBoxEdgeManagementClientCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=databoxedge_custom)

def load_command_table(self, args):
from .generated.commands import load_command_table
load_command_table(self, args)
try:
from .manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from .generated._params import load_arguments
load_arguments(self, command)
try:
from .manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = DataBoxEdgeManagementClientCommandsLoader
15 changes: 15 additions & 0 deletions src/azure-cli/azure/cli/command_modules/databoxedge/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .generated._help import helps # pylint: disable=unused-import
try:
from .manual._help import helps # pylint: disable=reimported
except ImportError:
pass
17 changes: 17 additions & 0 deletions src/azure-cli/azure/cli/command_modules/databoxedge/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
17 changes: 17 additions & 0 deletions src/azure-cli/azure/cli/command_modules/databoxedge/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_databoxedge_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.databoxedge import DataBoxEdgeManagementClient
return get_mgmt_service_client(cli_ctx,
Comment thread
Juliehzl marked this conversation as resolved.
DataBoxEdgeManagementClient)


def cf_device(cli_ctx, *_):
return cf_databoxedge_cl(cli_ctx).devices


def cf_alert(cli_ctx, *_):
return cf_databoxedge_cl(cli_ctx).alerts


def cf_bandwidth_schedule(cli_ctx, *_):
return cf_databoxedge_cl(cli_ctx).bandwidth_schedules


def cf_job(cli_ctx, *_):
return cf_databoxedge_cl(cli_ctx).jobs


def cf_node(cli_ctx, *_):
return cf_databoxedge_cl(cli_ctx).nodes


def cf_order(cli_ctx, *_):
return cf_databoxedge_cl(cli_ctx).orders


def cf_sku(cli_ctx, *_):
return cf_databoxedge_cl(cli_ctx).skus
Loading