Skip to content

Commit 259ca1c

Browse files
committed
update custom.py
1 parent c09eaab commit 259ca1c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/portal/azext_portal/custom.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# --------------------------------------------------------------------------------------------
55
# pylint: disable=wildcard-import
66
# pylint: disable=unused-wildcard-import
7-
# pylint: disable=line-too-long, unsupported-assignment-operation, protected-access
7+
# pylint: disable=line-too-long, protected-access
88

99
import json
1010

11-
from azure.cli.core.aaz import AAZFileArg, has_value
11+
from azure.cli.core.aaz import AAZFileArg, has_value, register_command
1212
from azure.cli.core.util import CLIError
1313
from azure.cli.core.azclierror import ArgumentUsageError
1414

@@ -91,12 +91,15 @@ def pre_operations(self):
9191
_parse_properties(self)
9292

9393

94+
@register_command(
95+
"portal dashboard import",
96+
)
9497
class Import(_Create):
98+
"""Import a Dashboard from a JSON file.
9599
96-
def __init__(self, loader=None, cli_ctx=None, callbacks=None, **kwargs):
97-
super().__init__(loader, cli_ctx, callbacks, **kwargs)
98-
self.help['short-summary'] = 'Import a dashboard from a JSON file.'
99-
self.help['examples'] = ''
100+
:example: Import a Dashboard
101+
az portal dashboard import -n myDashboard -g myResourceGroup --input-path /src/json/dashboard.json
102+
"""
100103

101104
@classmethod
102105
def _build_arguments_schema(cls, *args, **kwargs):
@@ -109,6 +112,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
109112
args_schema.lenses._registered = False
110113
args_schema.metadata._registered = False
111114
args_schema.location._registered = False
115+
args_schema.tags._registered = False
116+
args_schema.input_path._required = True
112117

113118
return args_schema
114119

0 commit comments

Comments
 (0)