Skip to content

Commit 50bd980

Browse files
shivansh257Shivansh Agarwal
andauthored
CLI command description update (#8776)
* update datadog commands description * update dynatrace properties * regenerate datadog extension * add test and remove swagger temporary changes * update examples * update readme * fixed breaking issue * az login * az login issue --------- Co-authored-by: Shivansh Agarwal <agarwalshiv@microsoft.com>
1 parent 6a71c06 commit 50bd980

File tree

83 files changed

+7266
-11917
lines changed

Some content is hidden

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

83 files changed

+7266
-11917
lines changed

src/datadog/HISTORY.rst

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

6+
1.0.0
7+
++++++
8+
* Update description of CLI commands
9+
610
0.1.0
711
++++++
8-
* Initial release.
12+
* Initial release.

src/datadog/README.md

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,88 @@
1-
Microsoft Azure CLI 'datadog' Extension
2-
==========================================
1+
# Azure CLI Datadog Extension #
2+
This is an extension to Azure CLI to manage Datadog resources.
33

4-
This package is for the 'datadog' extension.
5-
i.e. 'az datadog'
4+
## How to use ##
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name datadog
8+
```
9+
10+
### Included Features ###
11+
#### datadog monitor ####
12+
##### Create #####
13+
```
14+
az datadog monitor create --name {monitor} --resource-group {rg} --sku {{name:payg_v3_Monthly@TIDgmz7xq9ge3py}} --identity {{type:SystemAssigned}} --user-info {{name:Alice,email-address:alice@microsoft.com}}
15+
```
16+
```
17+
##### Show #####
18+
```
19+
az datadog monitor show --name {monitor} --resource-group {rg}
20+
```
21+
##### List #####
22+
```
23+
az datadog monitor list --resource-group {rg}
24+
```
25+
##### Update #####
26+
```
27+
az datadog monitor update --name {monitor} --resource-group {rg} --tags Environment="Dev2"
28+
```
29+
##### Get default Keys #####
30+
```
31+
az datadog monitor get-default-keys --name {monitor} --resource-group {rg}
32+
```
33+
##### List Api Keys #####
34+
```
35+
az datadog monitor list-api-keys --name {monitor} --resource-group {rg}
36+
```
37+
##### Set default Keys #####
38+
```
39+
az datadog monitor set-default-keys --name {monitor} --resource-group {rg} --api-key "{name:apiKey}" --key "1111111111111111aaaaaaaaaaaaaaaa"
40+
```
41+
##### List Host #####
42+
```
43+
az datadog monitor list-host --name {monitor} --resource-group {rg}
44+
```
45+
##### List linked resources #####
46+
```
47+
az datadog monitor list-linked-resource --name {monitor} --resource-group {rg}
48+
```
49+
##### List Monitored resources #####
50+
```
51+
az datadog monitor list-monitored-resource --name {monitor} --resource-group {rg}
52+
```
53+
##### refresh set password likn #####
54+
```
55+
az datadog monitor refresh-set-password-link --name {monitor} --resource-group {rg}
56+
```
57+
##### delete #####
58+
```
59+
az datadog monitor delete --name {monitor} --resource-group {rg}
60+
```
61+
##### SSO create #####
62+
```
63+
az datadog sso-config create --configuration-name "default" --monitor-name "{myMonitor}" --properties enterprise-app-id="ac754169-3489-42ae-bd06-8be89db12e58" single-sign-on-state="Enable"
64+
```
65+
##### SSO show #####
66+
```
67+
az datadog datadog sso-config show --configuration-name "default" --monitor-name "{myMonitor}" --resource-group "{rg}"
68+
```
69+
##### SSO list #####
70+
```
71+
az datadog sso-config list --monitor-name "{myMonitor}" --resource-group "{rg}"
72+
```
73+
##### Tag rule create #####
74+
```
75+
az tag-rule create --monitor-name "{myMonitor}" --log-rules-filtering-tags name="Environment" action="Include" value="Prod" --log-rules-filtering-tags name="Environment" action="Exclude" value="Dev" --send-aad-logs false --send-resource-logs true --send-subscription-logs true --resource-group "{rg}"
76+
```
77+
##### Tag rule show #####
78+
```
79+
az datadog tag-rule show --monitor-name "{myMonitor}" --resource-group "{rg}"
80+
```
81+
##### Tag rule list #####
82+
```
83+
az datadog tag-rule list --monitor-name "{myMonitor}" --resource-group "{rg}"
84+
```
85+
##### list terms #####
86+
```
87+
az datadog terms list
88+
```
Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,42 @@
1-
# --------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for
4-
# license information.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
54
#
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-
# --------------------------------------------------------------------------
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
107

118
from azure.cli.core import AzCommandsLoader
12-
from azext_datadog.generated._help import helps # pylint: disable=unused-import
13-
try:
14-
from azext_datadog.manual._help import helps # pylint: disable=reimported
15-
except ImportError:
16-
pass
9+
from azext_datadog._help import helps # pylint: disable=unused-import
1710

1811

19-
class MicrosoftDatadogClientCommandsLoader(AzCommandsLoader):
12+
class DatadogCommandsLoader(AzCommandsLoader):
2013

2114
def __init__(self, cli_ctx=None):
2215
from azure.cli.core.commands import CliCommandType
23-
from azext_datadog.generated._client_factory import cf_datadog_cl
24-
datadog_custom = CliCommandType(
25-
operations_tmpl='azext_datadog.custom#{}',
26-
client_factory=cf_datadog_cl)
27-
parent = super(MicrosoftDatadogClientCommandsLoader, self)
28-
parent.__init__(cli_ctx=cli_ctx, custom_command_type=datadog_custom)
16+
custom_command_type = CliCommandType(
17+
operations_tmpl='azext_datadog.custom#{}')
18+
super().__init__(cli_ctx=cli_ctx,
19+
custom_command_type=custom_command_type)
2920

3021
def load_command_table(self, args):
31-
from azext_datadog.generated.commands import load_command_table
32-
load_command_table(self, args)
22+
from azext_datadog.commands import load_command_table
23+
from azure.cli.core.aaz import load_aaz_command_table
3324
try:
34-
from azext_datadog.manual.commands import load_command_table as load_command_table_manual
35-
load_command_table_manual(self, args)
25+
from . import aaz
3626
except ImportError:
37-
pass
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)
3835
return self.command_table
3936

4037
def load_arguments(self, command):
41-
from azext_datadog.generated._params import load_arguments
38+
from azext_datadog._params import load_arguments
4239
load_arguments(self, command)
43-
try:
44-
from azext_datadog.manual._params import load_arguments as load_arguments_manual
45-
load_arguments_manual(self, command)
46-
except ImportError:
47-
pass
4840

4941

50-
COMMAND_LOADER_CLS = MicrosoftDatadogClientCommandsLoader
42+
COMMAND_LOADER_CLS = DatadogCommandsLoader
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# --------------------------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
46
# --------------------------------------------------------------------------------------------
5-
# pylint: disable=too-many-lines
67

7-
from knack.help_files import helps
8+
# pylint: disable=line-too-long
9+
# pylint: disable=too-many-lines
810

9-
helps['datadog'] = """
10-
type: group
11-
short-summary: Manage datadog
12-
"""
11+
from knack.help_files import helps # pylint: disable=unused-import
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: disable=too-many-lines
9+
# pylint: disable=too-many-statements
10+
11+
12+
def load_arguments(self, _): # pylint: disable=unused-argument
13+
pass
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# --------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
3-
# Licensed under the MIT License. See License.txt in the project root for
4-
# license information.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
54
#
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-
# --------------------------------------------------------------------------
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------

src/datadog/azext_datadog/vendored_sdks/datadog/aio/__init__.py renamed to src/datadog/azext_datadog/aaz/latest/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# coding=utf-8
2-
# --------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------------------------
32
# Copyright (c) Microsoft Corporation. All rights reserved.
43
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
6-
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7-
# --------------------------------------------------------------------------
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
810

9-
from ._microsoft_datadog_client import MicrosoftDatadogClient
10-
__all__ = ['MicrosoftDatadogClient']
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command_group(
15+
"datadog",
16+
)
17+
class __CMDGroup(AAZCommandGroup):
18+
"""Manage Datadog
19+
"""
20+
pass
21+
22+
23+
__all__ = ["__CMDGroup"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from .__cmd_group import *
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command_group(
15+
"datadog monitor",
16+
)
17+
class __CMDGroup(AAZCommandGroup):
18+
"""Provides a set of commands to manage Datadog monitor resources in your Azure subscription, enabling integration and observability of your Azure resources through Datadog.
19+
"""
20+
pass
21+
22+
23+
__all__ = ["__CMDGroup"]

0 commit comments

Comments
 (0)