Skip to content

Commit 10cc824

Browse files
committed
for-test
1 parent c54b7ce commit 10cc824

File tree

97 files changed

+151090
-0
lines changed

Some content is hidden

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

97 files changed

+151090
-0
lines changed

src/for-test/.pylintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[MASTER]
2+
ignore=vendored_sdks

src/for-test/HISTORY.rst

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0
7+
++++++
8+
* Initial release.
9+
10+
0.1.1
11+
++++++
12+
* `az grafana delete`: automatically remove the default role assignment created for the managed identity
13+
14+
0.1.2
15+
++++++
16+
* `az grafana create`: support guest users
17+
18+
0.2.0
19+
++++++
20+
* `az grafana api-key`: support api keys
21+
22+
0.3.0
23+
++++++
24+
* `az grafana service-account`: support service accounts
25+
26+
1.0
27+
++++++
28+
* Command module GA
29+
30+
1.1
31+
++++++
32+
* `az grafana update`: support email contact point through new SMTP configuration arguments
33+
34+
1.2
35+
++++++
36+
* `az grafana backup`: backup a Grafana workspace
37+
* `az grafana restore`: restore a Grafana workspace
38+
* `az grafana dashboard sync`: sync dashboard between 2 Grafana workspaces
39+
40+
1.2.8
41+
++++++
42+
* `az grafana create`: support deterministic outbound IP argument
43+
44+
1.2.10
45+
++++++
46+
* `az grafana backup`: exclude provisioned dashboards during backup
47+
48+
1.3.0
49+
++++++
50+
* `az grafana update`: support Grafana major version argument
51+
52+
1.3.1
53+
++++++
54+
* `az grafana delete`: bump azure-mgmt-authorization package version
55+
56+
1.3.2
57+
++++++
58+
* Revert to vendored SDK to fix an issue caused by Homebrew dependencies for Mac users
59+
60+
1.3.3
61+
++++++
62+
* `az grafana dashboard sync`: support library panel sync
63+
* `az grafana dashboard create`: use unique id instead of generic id for folder creation
64+
65+
1.3.4
66+
++++++
67+
* `az grafana dashboard sync`: use case-insensitive comparison for library panel folders
68+
69+
1.3.5
70+
++++++
71+
* `az grafana dashboard sync`: fix version mismatch issue for library panel sync
72+
73+
1.3.6
74+
++++++
75+
* `az grafana folder show`: remove folder lookup by id due to deprecated API
76+
* `az grafana folder delete`: remove folder lookup by id due to deprecated API
77+
* `az grafana dashboard import`: update call from deprecated dashboard import API to dashboard create/update API
78+
79+
2.0.0
80+
++++++
81+
* Move existing Grafana CRUD command implementations to AAZ CodeGen
82+
* `az grafana create`: move implementation to AAZDev Tool & implicitly support role assignment principal types
83+
* `az grafana update`: move implementation to AAZDev Tool
84+
* `az grafana list`: move implementation to AAZDev Tool
85+
* `az grafana show`: move implementation to AAZDev Tool
86+
* `az grafana delete`: move implementation to AAZDev Tool
87+
88+
2.1.0
89+
++++++
90+
* `az grafana migrate`: migrate data from a self-hosted Grafana instance to Azure Managed Grafana instance
91+
92+
2.2.0
93+
++++++
94+
* `az grafana list-available-plugin`: list all available plugins available for installation
95+
96+
2.3.0
97+
++++++
98+
* `az grafana private-endpoint-connection`: support private endpoint connection management
99+
* `az grafana mpe`: support managed private endpoint management
100+
101+
2.3.1
102+
++++++
103+
* `az grafana migrate`: fix issue with remapping logic for Grafana datasources with short uids
104+
105+
2.4.0
106+
++++++
107+
* `az grafana sync`: fix issues with syncing empty dashboards from Grafana 9 and syncing dashboards with collapsed rows
108+
* `az grafana backup`: support skipping Grafana folder permissions argument
109+
110+
2.5.0
111+
++++++
112+
* `az grafana integrations monitor`: support Azure Monitor workspace integration
113+
114+
2.5.1
115+
++++++
116+
* `az grafana dashboard import`: validate JSON file content prior to import
117+
118+
2.5.2
119+
++++++
120+
* `az grafana create`: fix issue with principal type implicit selection during role assignment step
121+
122+
2.5.3
123+
++++++
124+
* `az grafana service-account token create`: set token default expiration time to 1 day as stated in the documentation
125+
126+
2.5.4
127+
++++++
128+
* `az grafana dashboard import`: fix issue with JSON file validation
129+
* `az grafana folder update`: fix issue with overwrite setting
130+
131+
2.5.5
132+
++++++
133+
* `az grafana notification-channel test`: fix issue with test output parsing
134+
135+
2.6.0
136+
++++++
137+
* `az grafana integrations monitor add`: support optional subscription id argument for multi-subscription scenarios
138+
* `az grafana integrations monitor delete`: support optional subscription id argument for multi-subscription scenarios
139+
* `az grafana notification-channel`: deprecate command group as part of Grafana legacy alerting deprecation
140+
141+
2.6.1
142+
++++++
143+
* Remove msrestazure dependency
144+
145+
2.7.0
146+
++++++
147+
* `az grafana api-key`: deprecate command group as Grafana Labs is sunsetting API keys
148+
149+
2.8.0
150+
++++++
151+
* `az grafana folder create`: support parent folder argument for nested folder creation
152+
* `az grafana folder list`: support nested folders
153+
* `az grafana folder show`: support nested folders
154+
* `az grafana backup`: include corresponding nested folders when individual folders are specified
155+
156+
2.8.1
157+
++++++
158+
* `az grafana create`: block creation for resources of Essential SKU tier

src/for-test/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Microsoft Azure CLI 'amg' Extension
2+
This is an extension to manage Azure Managed Grafana instances
3+
4+
## How to use ##
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name amg
8+
```
9+
10+
## Included Features
11+
### Create, show, and delete instances
12+
13+
#### create an instance
14+
*Examples:*
15+
```
16+
az grafana create \
17+
-g MyResourceGroup \
18+
-n MyGrafanaInstance \
19+
--tags department=financial
20+
```
21+
22+
#### delete an instance
23+
*Examples:*
24+
```
25+
az grafana delete \
26+
-n MyGrafanaInstance
27+
```
28+
29+
### Configure folders, data sources, notification channels and dashboards
30+
31+
#### create a folder
32+
*Examples:*
33+
```
34+
az grafana folder create \
35+
-n MyGrafanaInstance \
36+
--title "Health KPI"
37+
```
38+
39+
#### configure a data source
40+
*Examples:*
41+
```
42+
az grafana data-source create \
43+
-n MyGrafanaInstance \
44+
--definition ~/data-source-sql.json
45+
```
46+
47+
#### configure a notification channel
48+
*Examples:*
49+
```
50+
az grafana notification-channel create \
51+
-n MyGrafanaInstance \
52+
--definition ~/notification-channel-teams.json
53+
```
54+
55+
#### Create a dashboard
56+
*Examples:*
57+
```
58+
az grafana dashboard create \
59+
-n MyGrafanaInstance \
60+
--folder "Health KPI" \
61+
--title "SQL status" \
62+
--definition ~/dashboard-sql.json
63+
```

src/for-test/azext_amg/__init__.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
8+
from azext_amg._help import helps # pylint: disable=unused-import
9+
10+
11+
class AmgCommandsLoader(AzCommandsLoader):
12+
13+
def __init__(self, cli_ctx=None):
14+
from azure.cli.core.commands import CliCommandType
15+
amg_custom = CliCommandType(
16+
operations_tmpl='azext_amg.custom#{}')
17+
# pylint: disable=super-with-arguments
18+
super(AmgCommandsLoader, self).__init__(cli_ctx=cli_ctx,
19+
custom_command_type=amg_custom)
20+
21+
def load_command_table(self, args):
22+
from azext_amg.commands import load_command_table
23+
from azure.cli.core.aaz import load_aaz_command_table
24+
try:
25+
from . import aaz
26+
except ImportError:
27+
aaz = None
28+
if aaz:
29+
load_aaz_command_table(
30+
loader=self,
31+
aaz_pkg_name=aaz.__name__,
32+
args=args
33+
)
34+
load_command_table(self, args)
35+
return self.command_table
36+
37+
def load_arguments(self, command):
38+
from azext_amg._params import load_arguments
39+
load_arguments(self, command)
40+
41+
42+
COMMAND_LOADER_CLS = AmgCommandsLoader
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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.commands.client_factory import get_mgmt_service_client
7+
8+
9+
def cf_amg(cli_ctx, subscription, *_):
10+
# pylint: disable=unused-argument
11+
from azext_amg.vendored_sdks import DashboardManagementClient
12+
return get_mgmt_service_client(cli_ctx, DashboardManagementClient, subscription_id=subscription)

0 commit comments

Comments
 (0)