Skip to content

Commit eb905d1

Browse files
author
SDK Automation
committed
Update from master
1 parent 58e3e4b commit eb905d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1088
-1818
lines changed

src/portal/HISTORY.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.. :changelog:
2-
3-
Release History
4-
===============
5-
6-
0.1.1
7-
++++++
8-
* Initial release.
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0
7+
++++++
8+
* Initial release.

src/portal/README.md

Lines changed: 5 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,5 @@
1-
Microsoft Azure CLI 'portal' Extension
2-
==========================================
3-
4-
This package is for the 'portal' extension. i.e. 'az portal'
5-
More info on what is [Azure portal](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-overview).
6-
7-
### How to use ###
8-
Install this extension using the below CLI command
9-
```
10-
az extension add --name portal
11-
```
12-
13-
### Included Features ###
14-
Manage Azure portal dashboards: [more info](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard)
15-
16-
17-
#### Import a portal dashboard ####
18-
You should have a dashboard json template ready before using this operation, the file can be downloaded from Azure portal website.
19-
More info can be found [here](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard)
20-
Example:
21-
```
22-
az portal dashboard import \
23-
--name dashboardName \
24-
--resource-group groupName \
25-
--input-path "/path/to/dashboard/template/file/directory"
26-
```
27-
An example dashboard JSON template may look like:
28-
[dashboard.json](https://github.com/Azure/azure-cli-extensions/blob/master/src/portal/azext_portal/tests/latest/dashboard.json)
29-
30-
#### Create a portal dashboard ####
31-
Example:
32-
```
33-
az portal dashboard create \
34-
--location "eastus" \
35-
--name dashboardName \
36-
--resource-group groupName \
37-
--input-path "/path/to/properties/file/directory"
38-
--tags aKey=aValue anotherKey=anotherValue
39-
```
40-
An example propeties JSON file may look like:
41-
[properties.json](https://github.com/Azure/azure-cli-extensions/blob/master/src/portal/azext_portal/tests/latest/properties.json)
42-
43-
#### List all portal dashboards ####
44-
Example:
45-
List all dashboards in a resourceGroup
46-
```
47-
az portal dashboard list \
48-
--resource-group groupName
49-
```
50-
List all dashboards in a subscription
51-
```
52-
az portal dashboard list
53-
```
54-
55-
#### Show a portal dashboard details ####
56-
Example:
57-
```
58-
az portal dashboard show \
59-
--name dashboardName \
60-
--resource-group groupName
61-
```
62-
63-
#### Update an existing dashboard ####
64-
Example:
65-
```
66-
az portal dashboard update \
67-
--name dashboardName \
68-
--resource-group groupName \
69-
--input-path "/src/json/properties.json"
70-
```
71-
72-
#### Delete a dashboard ####
73-
Example:
74-
```
75-
az portal dashboard delete \
76-
--name dashboardName \
77-
--resource-group groupName \
78-
```
79-
80-
If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues.
1+
Microsoft Azure CLI 'portal' Extension
2+
==========================================
3+
4+
This package is for the 'portal' extension.
5+
i.e. 'az portal'
Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,46 @@
1-
# --------------------------------------------------------------------------------------------
2-
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
5-
6-
from azure.cli.core import AzCommandsLoader
7-
from .generated._help import helps # pylint: disable=unused-import
8-
9-
10-
class PortalCommandsLoader(AzCommandsLoader):
11-
12-
def __init__(self, cli_ctx=None):
13-
from azure.cli.core.commands import CliCommandType
14-
from .generated._client_factory import cf_portal
15-
portal_custom = CliCommandType(
16-
operations_tmpl='azext_portal.custom#{}',
17-
client_factory=cf_portal)
18-
super(PortalCommandsLoader, self).__init__(cli_ctx=cli_ctx,
19-
custom_command_type=portal_custom)
20-
21-
def load_command_table(self, args):
22-
from .generated.commands import load_command_table
23-
load_command_table(self, args)
24-
return self.command_table
25-
26-
def load_arguments(self, command):
27-
from .generated._params import load_arguments
28-
load_arguments(self, command)
29-
30-
31-
COMMAND_LOADER_CLS = PortalCommandsLoader
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
from azure.cli.core import AzCommandsLoader
12+
from azext_portal.generated._help import helps # pylint: disable=unused-import
13+
14+
15+
class PortalCommandsLoader(AzCommandsLoader):
16+
17+
def __init__(self, cli_ctx=None):
18+
from azure.cli.core.commands import CliCommandType
19+
from azext_portal.generated._client_factory import cf_portal
20+
portal_custom = CliCommandType(
21+
operations_tmpl='azext_portal.custom#{}',
22+
client_factory=cf_portal)
23+
super(PortalCommandsLoader, self).__init__(cli_ctx=cli_ctx,
24+
custom_command_type=portal_custom)
25+
26+
def load_command_table(self, args):
27+
from azext_portal.generated.commands import load_command_table
28+
load_command_table(self, args)
29+
try:
30+
from azext_portal.manual.commands import load_command_table as load_command_table_manual
31+
load_command_table_manual(self, args)
32+
except ImportError:
33+
pass
34+
return self.command_table
35+
36+
def load_arguments(self, command):
37+
from azext_portal.generated._params import load_arguments
38+
load_arguments(self, command)
39+
try:
40+
from azext_portal.manual._params import load_arguments as load_arguments_manual
41+
load_arguments_manual(self, command)
42+
except ImportError:
43+
pass
44+
45+
46+
COMMAND_LOADER_CLS = PortalCommandsLoader

src/portal/azext_portal/action.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
# --------------------------------------------------------------------------------------------
2-
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
5-
# pylint: disable=wildcard-import
6-
# pylint: disable=unused-wildcard-import
7-
8-
from .generated.action import * # noqa: F403
9-
try:
10-
from .manual.action import * # noqa: F403
11-
except ImportError:
12-
pass
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.action import * # noqa: F403
14+
try:
15+
from .manual.action import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
2-
"azext.isExperimental": true,
3-
"azext.minCliCoreVersion": "2.3.1"
1+
{
2+
"azext.isExperimental": true,
3+
"azext.minCliCoreVersion": "2.3.1"
44
}

src/portal/azext_portal/custom.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
# --------------------------------------------------------------------------------------------
2-
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
5-
# pylint: disable=wildcard-import
6-
# pylint: disable=unused-wildcard-import
7-
8-
from .generated.custom import * # noqa: F403
9-
try:
10-
from .manual.custom import * # noqa: F403
11-
except ImportError:
12-
pass
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.custom import * # noqa: F403
14+
try:
15+
from .manual.custom import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# coding=utf-8
2-
# --------------------------------------------------------------------------
3-
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
7-
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
10-
# --------------------------------------------------------------------------
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
# --------------------------------------------------------------------------------------------
2-
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
5-
6-
7-
def cf_portal(cli_ctx, *_):
8-
from azure.cli.core.commands.client_factory import get_mgmt_service_client
9-
from ..vendored_sdks.portal import Portal
10-
return get_mgmt_service_client(cli_ctx, Portal)
11-
12-
13-
def cf_dashboard(cli_ctx, *_):
14-
return cf_portal(cli_ctx).dashboard
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
12+
def cf_portal(cli_ctx, *_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from ..vendored_sdks.portal import Portal
15+
return get_mgmt_service_client(cli_ctx, Portal)
16+
17+
18+
def cf_dashboard(cli_ctx, *_):
19+
return cf_portal(cli_ctx).dashboard

0 commit comments

Comments
 (0)