Skip to content

Commit 1c09352

Browse files
author
SDK Automation
committed
Generated from 075502bd9fed51245dde7b9915706ec51b2e8a61
1 parent b17f994 commit 1c09352

Some content is hidden

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

44 files changed

+2322
-1119
lines changed

src/portal/HISTORY.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Release History
44
===============
55

6-
0.1.1
6+
0.1.0
77
++++++
88
* Initial release.
Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,50 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
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+
# --------------------------------------------------------------------------
510

611
from azure.cli.core import AzCommandsLoader
7-
from .generated._help import helps # pylint: disable=unused-import
12+
from azext_portal.generated._help import helps # pylint: disable=unused-import
13+
try:
14+
from azext_portal.manual._help import helps # pylint: disable=reimported
15+
except ImportError:
16+
pass
817

918

1019
class PortalCommandsLoader(AzCommandsLoader):
1120

1221
def __init__(self, cli_ctx=None):
1322
from azure.cli.core.commands import CliCommandType
14-
from .generated._client_factory import cf_portal
23+
from azext_portal.generated._client_factory import cf_portal_cl
1524
portal_custom = CliCommandType(
1625
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)
26+
client_factory=cf_portal_cl)
27+
parent = super(PortalCommandsLoader, self)
28+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=portal_custom)
2029

2130
def load_command_table(self, args):
22-
from .generated.commands import load_command_table
31+
from azext_portal.generated.commands import load_command_table
2332
load_command_table(self, args)
33+
try:
34+
from azext_portal.manual.commands import load_command_table as load_command_table_manual
35+
load_command_table_manual(self, args)
36+
except ImportError:
37+
pass
2438
return self.command_table
2539

2640
def load_arguments(self, command):
27-
from .generated._params import load_arguments
41+
from azext_portal.generated._params import load_arguments
2842
load_arguments(self, command)
43+
try:
44+
from azext_portal.manual._params import load_arguments as load_arguments_manual
45+
load_arguments_manual(self, command)
46+
except ImportError:
47+
pass
2948

3049

3150
COMMAND_LOADER_CLS = PortalCommandsLoader

src/portal/azext_portal/action.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
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+
# --------------------------------------------------------------------------
510
# pylint: disable=wildcard-import
611
# pylint: disable=unused-wildcard-import
712

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"azext.isExperimental": true,
3-
"azext.minCliCoreVersion": "2.3.1"
3+
"azext.minCliCoreVersion": "2.11.0"
44
}

src/portal/azext_portal/commands.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/portal/azext_portal/custom.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
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+
# --------------------------------------------------------------------------
510
# pylint: disable=wildcard-import
611
# pylint: disable=unused-wildcard-import
712

src/portal/azext_portal/generated/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11+
12+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for license information.
4-
# --------------------------------------------------------------------------------------------
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+
# --------------------------------------------------------------------------
510

611

7-
def cf_portal(cli_ctx, *_):
12+
def cf_portal_cl(cli_ctx, *_):
813
from azure.cli.core.commands.client_factory import get_mgmt_service_client
914
from ..vendored_sdks.portal import Portal
10-
return get_mgmt_service_client(cli_ctx, Portal)
15+
return get_mgmt_service_client(cli_ctx,
16+
Portal)
1117

1218

1319
def cf_dashboard(cli_ctx, *_):
14-
return cf_portal(cli_ctx).dashboard
20+
return cf_portal_cl(cli_ctx).dashboard
21+
22+
23+
def cf_tenant_configuration(cli_ctx, *_):
24+
return cf_portal_cl(cli_ctx).tenant_configuration
Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# 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=line-too-long
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+
# --------------------------------------------------------------------------
610
# pylint: disable=too-many-lines
711

812
from knack.help_files import helps
913

1014

1115
helps['portal dashboard'] = """
1216
type: group
13-
short-summary: Manage portal dashboards
17+
short-summary: portal dashboard
1418
"""
1519

1620
helps['portal dashboard list'] = """
1721
type: command
18-
short-summary: Lists the dashboards within a subscription or resource group.
22+
short-summary: "Gets all the dashboards within a subscription."
1923
examples:
20-
- name: List all dashboards in a resourceGroup
24+
- name: List all custom resource providers on the resourceGroup
2125
text: |-
2226
az portal dashboard list --resource-group "testRG"
23-
- name: List all dashboards in a subscription
24-
text: |-
25-
az portal dashboard list
2627
"""
2728

2829
helps['portal dashboard show'] = """
2930
type: command
30-
short-summary: Gets details for a single dashboard.
31+
short-summary: "Gets the Dashboard."
3132
examples:
3233
- name: Get a Dashboard
3334
text: |-
@@ -36,40 +37,73 @@
3637

3738
helps['portal dashboard create'] = """
3839
type: command
39-
short-summary: Creates or updates a dashboard.
40+
short-summary: "Creates or updates a Dashboard."
4041
examples:
4142
- name: Create or update a Dashboard
4243
text: |-
43-
az portal dashboard create --location "eastus" --name "testDashboard" \\
44-
--resource-group "testRG" --input-path "/src/json/properties.json" \\
45-
--tags aKey=aValue anotherKey=anotherValue
44+
az portal dashboard create --location "eastus" --lenses "[{\\"order\\":1,\\"parts\\":[{\\"position\\":{\
45+
\\"colSpan\\":3,\\"rowSpan\\":4,\\"x\\":1,\\"y\\":2}},{\\"position\\":{\\"colSpan\\":6,\\"rowSpan\\":6,\\"x\\":5,\\"y\\\
46+
":5}}]},{\\"order\\":2,\\"parts\\":[]}]" --metadata "{\\"metadata\\":{\\"ColSpan\\":2,\\"RowSpan\\":1,\\"X\\":4,\\"Y\\"\
47+
:3}}" --tags aKey="aValue" anotherKey="anotherValue" --name "testDashboard" --resource-group "testRG"
4648
"""
4749

4850
helps['portal dashboard update'] = """
4951
type: command
50-
short-summary: Updates an existing dashboard.
52+
short-summary: "Updates an existing Dashboard."
5153
examples:
5254
- name: Update a Dashboard
5355
text: |-
54-
az portal dashboard update --name "testDashboard" --resource-group "testRG" \\
55-
--input-path "/src/json/properties.json"
56+
az portal dashboard update --tags aKey="bValue" anotherKey="anotherValue2" --name "testDashboard" \
57+
--resource-group "testRG"
5658
"""
5759

5860
helps['portal dashboard delete'] = """
5961
type: command
60-
short-summary: Deletes a dashboard.
62+
short-summary: "Deletes the Dashboard."
6163
examples:
6264
- name: Delete a Dashboard
6365
text: |-
6466
az portal dashboard delete --name "testDashboard" --resource-group "testRG"
6567
"""
6668

67-
helps['portal dashboard import'] = """
69+
helps['portal tenant-configuration'] = """
70+
type: group
71+
short-summary: portal tenant-configuration
72+
"""
73+
74+
helps['portal tenant-configuration list'] = """
75+
type: command
76+
short-summary: "Gets list of the tenant configurations."
77+
examples:
78+
- name: Get list of Tenant configurations
79+
text: |-
80+
az portal tenant-configuration list
81+
"""
82+
83+
helps['portal tenant-configuration show'] = """
84+
type: command
85+
short-summary: "Gets the tenant configuration."
86+
examples:
87+
- name: Get Tenant configuration
88+
text: |-
89+
az portal tenant-configuration show
90+
"""
91+
92+
helps['portal tenant-configuration create'] = """
93+
type: command
94+
short-summary: "Create the tenant configuration. If configuration already exists - update it. User has to be a \
95+
Tenant Admin for this operation."
96+
examples:
97+
- name: Create or update Tenant configuration
98+
text: |-
99+
az portal tenant-configuration create --enforce-private-markdown-storage true
100+
"""
101+
102+
helps['portal tenant-configuration delete'] = """
68103
type: command
69-
short-summary: Imports a dashboard from a JSON file.
104+
short-summary: "Delete the tenant configuration. User has to be a Tenant Admin for this operation."
70105
examples:
71-
- name: Import a Dashboard
106+
- name: Delete Tenant configuration
72107
text: |-
73-
az portal dashboard import --name "testDashboard" --resource-group "testRG" \\
74-
--input-path "/src/json/dashboard.json"
108+
az portal tenant-configuration delete
75109
"""
Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,65 @@
1-
# --------------------------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------
22
# 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=line-too-long
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+
# --------------------------------------------------------------------------
610
# pylint: disable=too-many-lines
711
# pylint: disable=too-many-statements
812

9-
from argcomplete.completers import FilesCompleter
1013
from azure.cli.core.commands.parameters import (
1114
tags_type,
15+
get_three_state_flag,
1216
resource_group_name_type,
13-
get_location_type,
14-
file_type
17+
get_location_type
18+
)
19+
from azure.cli.core.commands.validators import (
20+
get_default_location_from_resource_group,
21+
validate_file_or_dict
1522
)
16-
from azure.cli.core.commands.validators import get_default_location_from_resource_group
1723

1824

1925
def load_arguments(self, _):
2026

2127
with self.argument_context('portal dashboard list') as c:
22-
c.argument('resource_group_name', resource_group_name_type,
23-
help='The name of the resource group.')
28+
c.argument('resource_group_name', resource_group_name_type)
2429

2530
with self.argument_context('portal dashboard show') as c:
2631
c.argument('resource_group_name', resource_group_name_type)
27-
c.argument('name', options_list=[
28-
'--name', '-n'], help='The name of the dashboard.')
32+
c.argument('dashboard_name', options_list=['--name', '-n', '--dashboard-name'], type=str, help='The name of '
33+
'the dashboard.', id_part='name')
2934

3035
with self.argument_context('portal dashboard create') as c:
31-
c.argument('resource_group_name', resource_group_name_type,
32-
help='The name of the resource group.')
33-
c.argument('name', options_list=[
34-
'--name', '-n'], help='The name of the dashboard.')
36+
c.argument('resource_group_name', resource_group_name_type)
37+
c.argument('dashboard_name', options_list=['--name', '-n', '--dashboard-name'], type=str, help='The name of '
38+
'the dashboard.')
3539
c.argument('location', arg_type=get_location_type(self.cli_ctx),
3640
validator=get_default_location_from_resource_group)
3741
c.argument('tags', tags_type)
38-
c.argument('input_path', type=file_type,
39-
help='The path to the dashboard properties JSON file.', completer=FilesCompleter())
42+
c.argument('lenses', type=validate_file_or_dict, help='The dashboard lenses. Expected value: '
43+
'json-string/@json-file.')
44+
c.argument('metadata', type=validate_file_or_dict, help='The dashboard metadata. Expected value: '
45+
'json-string/@json-file.')
4046

4147
with self.argument_context('portal dashboard update') as c:
42-
c.argument('resource_group_name', resource_group_name_type,
43-
help='The name of the resource group.')
44-
c.argument('name', options_list=[
45-
'--name', '-n'], help='The name of the dashboard.')
46-
c.argument('input_path', type=file_type,
47-
help='The path to the dashboard properties JSON file.', completer=FilesCompleter())
48+
c.argument('resource_group_name', resource_group_name_type)
49+
c.argument('dashboard_name', options_list=['--name', '-n', '--dashboard-name'], type=str, help='The name of '
50+
'the dashboard.', id_part='name')
51+
c.argument('tags', tags_type)
52+
c.argument('lenses', type=validate_file_or_dict, help='The dashboard lenses. Expected value: '
53+
'json-string/@json-file.')
54+
c.argument('metadata', type=validate_file_or_dict, help='The dashboard metadata. Expected value: '
55+
'json-string/@json-file.')
4856

4957
with self.argument_context('portal dashboard delete') as c:
50-
c.argument('resource_group_name', resource_group_name_type,
51-
help='The name of the resource group.')
52-
c.argument('name', options_list=[
53-
'--name', '-n'], help='The name of the dashboard.')
54-
55-
with self.argument_context('portal dashboard import') as c:
56-
c.argument('resource_group_name', resource_group_name_type,
57-
help='The name of the resource group.')
58-
c.argument('name', options_list=[
59-
'--name', '-n'], help='The name of the dashboard.')
60-
c.argument('input_path', type=file_type,
61-
help='The path to the dashboard json file.', completer=FilesCompleter())
58+
c.argument('resource_group_name', resource_group_name_type)
59+
c.argument('dashboard_name', options_list=['--name', '-n', '--dashboard-name'], type=str, help='The name of '
60+
'the dashboard.', id_part='name')
61+
62+
with self.argument_context('portal tenant-configuration create') as c:
63+
c.argument('enforce_private_markdown_storage', arg_type=get_three_state_flag(), help='When flag is set to true '
64+
'Markdown tile will require external storage configuration (URI). The inline content configuration '
65+
'will be prohibited.')

0 commit comments

Comments
 (0)