Skip to content

Commit

Permalink
[Datadog] Onboard Datadog to CLI (Azure#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
limingu authored Oct 22, 2020
1 parent 2f9e2e9 commit e9e2c99
Show file tree
Hide file tree
Showing 54 changed files with 9,754 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@

/src/databox/ @jsntcy

/src/datadog/ @limingu

/src/hpc-cache/ @zhoxing-ms

/src/timeseriesinsights/ @jiasli
Expand Down
42 changes: 42 additions & 0 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,48 @@ databricks workspace vnet-peering update:
allow_virtual_network_access:
rule_exclusions:
- option_length_too_long
datadog monitor create:
parameters:
datadog_organization_properties:
rule_exclusions:
- option_length_too_long
marketplace_subscription_status:
rule_exclusions:
- option_length_too_long
datadog tag-rule create:
parameters:
log_rules_filtering_tags:
rule_exclusions:
- option_length_too_long
log_rules_send_aad_logs:
rule_exclusions:
- option_length_too_long
log_rules_send_resource_logs:
rule_exclusions:
- option_length_too_long
log_rules_send_subscription_logs:
rule_exclusions:
- option_length_too_long
metric_rules_filtering_tags:
rule_exclusions:
- option_length_too_long
datadog tag-rule update:
parameters:
log_rules_filtering_tags:
rule_exclusions:
- option_length_too_long
log_rules_send_aad_logs:
rule_exclusions:
- option_length_too_long
log_rules_send_resource_logs:
rule_exclusions:
- option_length_too_long
log_rules_send_subscription_logs:
rule_exclusions:
- option_length_too_long
metric_rules_filtering_tags:
rule_exclusions:
- option_length_too_long
datafactory factory configure-factory-repo:
parameters:
factory_git_hub_configuration:
Expand Down
8 changes: 8 additions & 0 deletions src/datadog/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
5 changes: 5 additions & 0 deletions src/datadog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Microsoft Azure CLI 'datadog' Extension
==========================================

This package is for the 'datadog' extension.
i.e. 'az datadog'
50 changes: 50 additions & 0 deletions src/datadog/azext_datadog/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_datadog.generated._help import helps # pylint: disable=unused-import
try:
from azext_datadog.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


class MicrosoftDatadogClientCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_datadog.generated._client_factory import cf_datadog_cl
datadog_custom = CliCommandType(
operations_tmpl='azext_datadog.custom#{}',
client_factory=cf_datadog_cl)
parent = super(MicrosoftDatadogClientCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=datadog_custom)

def load_command_table(self, args):
from azext_datadog.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_datadog.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_datadog.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_datadog.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = MicrosoftDatadogClientCommandsLoader
17 changes: 17 additions & 0 deletions src/datadog/azext_datadog/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
4 changes: 4 additions & 0 deletions src/datadog/azext_datadog/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.11.0"
}
17 changes: 17 additions & 0 deletions src/datadog/azext_datadog/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
12 changes: 12 additions & 0 deletions src/datadog/azext_datadog/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
48 changes: 48 additions & 0 deletions src/datadog/azext_datadog/generated/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_datadog_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from ..vendored_sdks.datadog import MicrosoftDatadogClient
return get_mgmt_service_client(cli_ctx,
MicrosoftDatadogClient)


def cf_api_key(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).api_key


def cf_host(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).host


def cf_linked_resource(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).linked_resource


def cf_monitored_resource(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).monitored_resource


def cf_monitor(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).monitor


def cf_refresh_set_password(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).refresh_set_password


def cf_tag_rule(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).tag_rule


def cf_single_sign_on_configuration(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).single_sign_on_configuration
Loading

0 comments on commit e9e2c99

Please sign in to comment.