Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR datadog] [Datadog] Add terms APIs #2648

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/datadog/azext_datadog/generated/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def cf_datadog_cl(cli_ctx, *_):
MicrosoftDatadogClient)


def cf_marketplace_agreement(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).marketplace_agreement


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

Expand All @@ -36,13 +40,13 @@ def cf_monitor(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).monitor


def cf_refresh_set_password(cli_ctx, *_):
def cf_set_password_link(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, *_):
def cf_sso_config(cli_ctx, *_):
return cf_datadog_cl(cli_ctx).single_sign_on_configuration
128 changes: 75 additions & 53 deletions src/datadog/azext_datadog/generated/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,45 @@
from knack.help_files import helps


helps['datadog marketplace-agreement'] = """
type: group
short-summary: datadog marketplace-agreement
"""

helps['datadog marketplace-agreement list'] = """
type: command
short-summary: "List Datadog marketplace agreements in the subscription."
examples:
- name: MarketplaceAgreements_List
text: |-
az datadog marketplace-agreement list
"""

helps['datadog marketplace-agreement create'] = """
type: command
short-summary: "Create Datadog marketplace agreement in the subscription."
parameters:
- name: --properties
short-summary: "Represents the properties of the resource."
long-summary: |
Usage: --properties publisher=XX product=XX plan=XX license-text-link=XX privacy-policy-link=XX \
retrieve-datetime=XX signature=XX accepted=XX

publisher: Publisher identifier string.
product: Product identifier string.
plan: Plan identifier string.
license-text-link: Link to HTML with Microsoft and Publisher terms.
privacy-policy-link: Link to the privacy policy of the publisher.
retrieve-datetime: Date and time in UTC of when the terms were accepted. This is empty if Accepted is \
false.
signature: Terms signature.
accepted: If any version of the terms have been accepted, otherwise false.
examples:
- name: MarketplaceAgreements_Create
text: |-
az datadog marketplace-agreement create --properties accepted=true
"""

helps['datadog api-key'] = """
type: group
short-summary: datadog api-key
Expand Down Expand Up @@ -94,11 +133,15 @@

helps['datadog monitor list'] = """
type: command
short-summary: "List all monitors under the specified subscription."
short-summary: "List all monitors under the specified resource group. And List all monitors under the specified \
subscription."
examples:
- name: Monitors_ListByResourceGroup
text: |-
az datadog monitor list --resource-group "myResourceGroup"
- name: Monitors_List
text: |-
az datadog monitor list
"""

helps['datadog monitor show'] = """
Expand All @@ -115,13 +158,15 @@
short-summary: "Create a monitor resource."
parameters:
- name: --datadog-organization-properties
short-summary: "Datadog organization properties"
long-summary: |
Usage: --datadog-organization-properties linking-auth-code=XX linking-client-id=XX enterprise-app-id=XX

linking-auth-code: The auth code used to linking to an existing datadog organization.
linking-client-id: The client_id from an existing in exchange for an auth token to link organization.
enterprise-app-id: The Id of the Enterprise App used for Single sign on.
- name: --user-info
short-summary: "User info"
long-summary: |
Usage: --user-info name=XX email-address=XX phone-number=XX

Expand All @@ -131,11 +176,11 @@
examples:
- name: Monitors_Create
text: |-
az datadog monitor create --name "myMonitor" --location "West US 2" \
az datadog monitor create --name "myMonitor" --sku-name "myMonitor" --location "West US" \
--datadog-organization-properties name="myOrg" enterprise-app-id="00000000-0000-0000-0000-000000000000" \
linking-auth-code="someAuthCode" linking-client-id="00000000-0000-0000-0000-000000000000" subscription="pro" \
--monitoring-status "Enabled" --user-info name="Alice" email-address="alice@microsoft.com" phone-number="123-456-7890" \
--sku-name "drawdown_testing_20200904_Monthly" --tags Environment="Dev" --resource-group "myResourceGroup"
--user-info name="Alice" email-address="alice@microsoft.com" phone-number="123-456-7890" --sku-name "free_Monthly" \
--tags Environment="Dev" --resource-group "myResourceGroup"
"""

helps['datadog monitor update'] = """
Expand All @@ -144,8 +189,8 @@
examples:
- name: Monitors_Update
text: |-
az datadog monitor update --name "myMonitor" --monitoring-status "Enabled" --tags Environment="Dev" \
--resource-group "myResourceGroup"
az datadog monitor update --name "myMonitor" --tags Environment="Dev" --resource-group \
"myResourceGroup"
"""

helps['datadog monitor delete'] = """
Expand Down Expand Up @@ -223,26 +268,12 @@
action: Valid actions for a filtering tag. Exclusion takes priority over inclusion.

Multiple actions can be specified by using more than one --metric-rules-filtering-tags argument.
- name: --log-rules-filtering-tags
short-summary: "List of filtering tags to be used for capturing logs. This only takes effect if \
SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the \
rules will apply to the list of all available resources. If Include actions are specified, the rules will only include \
resources with the associated tags."
long-summary: |
Usage: --log-rules-filtering-tags name=XX value=XX action=XX

name: The name (also known as the key) of the tag.
value: The value of the tag.
action: Valid actions for a filtering tag. Exclusion takes priority over inclusion.

Multiple actions can be specified by using more than one --log-rules-filtering-tags argument.
examples:
- name: TagRules_CreateOrUpdate
text: |-
az datadog 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" \
--log-rules-send-aad-logs false --log-rules-send-resource-logs true --log-rules-send-subscription-logs true \
--resource-group "myResourceGroup" --rule-set-name "default"
az datadog tag-rule create --monitor-name "myMonitor" --log-rules-send-aad-logs false \
--log-rules-send-resource-logs true --log-rules-send-subscription-logs true --resource-group "myResourceGroup" \
--rule-set-name "default"
"""

helps['datadog tag-rule update'] = """
Expand All @@ -261,19 +292,6 @@
action: Valid actions for a filtering tag. Exclusion takes priority over inclusion.

Multiple actions can be specified by using more than one --metric-rules-filtering-tags argument.
- name: --log-rules-filtering-tags
short-summary: "List of filtering tags to be used for capturing logs. This only takes effect if \
SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the \
rules will apply to the list of all available resources. If Include actions are specified, the rules will only include \
resources with the associated tags."
long-summary: |
Usage: --log-rules-filtering-tags name=XX value=XX action=XX

name: The name (also known as the key) of the tag.
value: The value of the tag.
action: Valid actions for a filtering tag. Exclusion takes priority over inclusion.

Multiple actions can be specified by using more than one --log-rules-filtering-tags argument.
"""

helps['datadog sso-config'] = """
Expand All @@ -287,8 +305,7 @@
examples:
- name: SingleSignOnConfigurations_List
text: |-
az datadog sso-config list --monitor-name "myMonitor" --resource-group \
"myResourceGroup"
az datadog sso-config list --monitor-name "myMonitor" --resource-group "myResourceGroup"
"""

helps['datadog sso-config show'] = """
Expand All @@ -297,8 +314,8 @@
examples:
- name: SingleSignOnConfigurations_Get
text: |-
az datadog sso-config show --configuration-name "default" --monitor-name "myMonitor" \
--resource-group "myResourceGroup"
az datadog sso-config show --configuration-name "default" --monitor-name "myMonitor" --resource-group \
"myResourceGroup"
"""

helps['datadog sso-config create'] = """
Expand All @@ -315,29 +332,34 @@
examples:
- name: SingleSignOnConfigurations_CreateOrUpdate
text: |-
az datadog sso-config create --configuration-name "default" --monitor-name \
"myMonitor" --properties enterprise-app-id="00000000-0000-0000-0000-000000000000" single-sign-on-state="Enable" \
--resource-group "myResourceGroup"
az datadog sso-config create --configuration-name "default" --monitor-name "myMonitor" --properties \
enterprise-app-id="00000000-0000-0000-0000-000000000000" single-sign-on-state="Enable" --resource-group \
"myResourceGroup"
"""

helps['datadog sso-config update'] = """
type: command
short-summary: "Configures single-sign-on for this resource."
parameters:
- name: --properties
long-summary: |
Usage: --properties single-sign-on-state=XX enterprise-app-id=XX single-sign-on-url=XX

single-sign-on-state: Various states of the SSO resource
enterprise-app-id: The Id of the Enterprise App used for Single sign-on.
single-sign-on-url: The login URL specific to this Datadog Organization.
"""

helps['datadog sso-config wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the datadog sso-config is \
met.
short-summary: Place the CLI in a waiting state until a condition of the datadog sso-config is met.
examples:
- name: Pause executing next line of CLI script until the datadog sso-config is successfully \
created.
- name: Pause executing next line of CLI script until the datadog sso-config is successfully created.
text: |-
az datadog sso-config wait --configuration-name "default" --monitor-name "myMonitor" \
--resource-group "myResourceGroup" --created
- name: Pause executing next line of CLI script until the datadog sso-config is successfully \
updated.
az datadog sso-config wait --configuration-name "default" --monitor-name "myMonitor" --resource-group \
"myResourceGroup" --created
- name: Pause executing next line of CLI script until the datadog sso-config is successfully updated.
text: |-
az datadog sso-config wait --configuration-name "default" --monitor-name "myMonitor" \
--resource-group "myResourceGroup" --updated
az datadog sso-config wait --configuration-name "default" --monitor-name "myMonitor" --resource-group \
"myResourceGroup" --updated
"""
36 changes: 10 additions & 26 deletions src/datadog/azext_datadog/generated/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@
)
from azure.cli.core.commands.validators import get_default_location_from_resource_group
from azext_datadog.action import (
AddMarketplaceagreementsProperties,
AddDatadogOrganizationProperties,
AddUserInfo,
AddMetricRulesFilteringTags,
AddLogRulesFilteringTags,
AddProperties
AddSinglesignonconfigurationsProperties
)


def load_arguments(self, _):

with self.argument_context('datadog marketplace-agreement create') as c:
c.argument('properties', action=AddMarketplaceagreementsProperties, nargs='*', help='Represents the properties '
'of the resource.')

with self.argument_context('datadog api-key list') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('monitor_name', type=str, help='Monitor resource name')
Expand Down Expand Up @@ -73,16 +77,8 @@ def load_arguments(self, _):
c.argument('location', arg_type=get_location_type(self.cli_ctx),
validator=get_default_location_from_resource_group)
c.argument('identity_type', arg_type=get_enum_type(['SystemAssigned', 'UserAssigned']), help='Identity type')
c.argument('provisioning_state', arg_type=get_enum_type(['Accepted', 'Creating', 'Updating', 'Deleting',
'Succeeded', 'Failed', 'Canceled', 'Deleted',
'NotSpecified']), help='Provisioning state')
c.argument('monitoring_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Flag specifying if the '
'resource monitoring is enabled or disabled.')
c.argument('marketplace_subscription_status', arg_type=get_enum_type(['Active', 'Suspended']), help='Flag '
'specifying the Marketplace Subscription Status of the resource. If payment is not made in time, '
'the resource will go in Suspended state.')
c.argument('datadog_organization_properties', action=AddDatadogOrganizationProperties, nargs='*',
help='Datadog organization properties')
c.argument('datadog_organization_properties', action=AddDatadogOrganizationProperties, nargs='*', help=''
'Datadog organization properties')
c.argument('user_info', action=AddUserInfo, nargs='*', help='User info')
c.argument('sku_name', type=str, help='Name of the SKU.')

Expand All @@ -91,8 +87,6 @@ def load_arguments(self, _):
c.argument('monitor_name', options_list=['--name', '-n', '--monitor-name'], type=str, help='Monitor resource '
'name', id_part='name')
c.argument('tags', tags_type)
c.argument('monitoring_status', arg_type=get_enum_type(['Enabled', 'Disabled']), help='Flag specifying if the '
'resource monitoring is enabled or disabled.')

with self.argument_context('datadog monitor delete') as c:
c.argument('resource_group_name', resource_group_name_type)
Expand Down Expand Up @@ -131,11 +125,6 @@ def load_arguments(self, _):
'subscription logs should be sent for the Monitor resource.')
c.argument('log_rules_send_resource_logs', arg_type=get_three_state_flag(), help='Flag specifying if Azure '
'resource logs should be sent for the Monitor resource.')
c.argument('log_rules_filtering_tags', action=AddLogRulesFilteringTags, nargs='*', help='List of filtering '
'tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If '
'empty, all resources will be captured. If only Exclude action is specified, the rules will apply '
'to the list of all available resources. If Include actions are specified, the rules will only '
'include resources with the associated tags.')

with self.argument_context('datadog tag-rule update') as c:
c.argument('resource_group_name', resource_group_name_type)
Expand All @@ -151,11 +140,6 @@ def load_arguments(self, _):
'subscription logs should be sent for the Monitor resource.')
c.argument('log_rules_send_resource_logs', arg_type=get_three_state_flag(), help='Flag specifying if Azure '
'resource logs should be sent for the Monitor resource.')
c.argument('log_rules_filtering_tags', action=AddLogRulesFilteringTags, nargs='*', help='List of filtering '
'tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If '
'empty, all resources will be captured. If only Exclude action is specified, the rules will apply '
'to the list of all available resources. If Include actions are specified, the rules will only '
'include resources with the associated tags.')

with self.argument_context('datadog sso-config list') as c:
c.argument('resource_group_name', resource_group_name_type)
Expand All @@ -170,13 +154,13 @@ def load_arguments(self, _):
c.argument('resource_group_name', resource_group_name_type)
c.argument('monitor_name', type=str, help='Monitor resource name')
c.argument('configuration_name', type=str, help='Configuration name')
c.argument('properties', action=AddProperties, nargs='*', help='')
c.argument('properties', action=AddSinglesignonconfigurationsProperties, nargs='*', help='')

with self.argument_context('datadog sso-config update') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('monitor_name', type=str, help='Monitor resource name', id_part='name')
c.argument('configuration_name', type=str, help='Configuration name', id_part='child_name_1')
c.argument('properties', action=AddProperties, nargs='*', help='')
c.argument('properties', action=AddSinglesignonconfigurationsProperties, nargs='*', help='')

with self.argument_context('datadog sso-config wait') as c:
c.argument('resource_group_name', resource_group_name_type)
Expand Down
Loading