From 204e0d19a6401e740dd0fdf7c732eeb562c47914 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 9 Dec 2020 07:30:18 +0000 Subject: [PATCH] CodeGen from PR 11855 in Azure/azure-rest-api-specs Merge 0a9c18cc5ac1ad5e264a206cb8019d016e70cbd6 into 374b0d5b50bac54a51a42cb2aa3666f85d4ed96d --- .../azure/mgmt/datadog/__init__.py | 19 + .../azure/mgmt/datadog/_configuration.py | 48 + .../mgmt/datadog/_microsoft_datadog_client.py | 94 ++ .../azure/mgmt/datadog/models/__init__.py | 137 +++ .../models/_microsoft_datadog_client_enums.py | 63 ++ .../azure/mgmt/datadog/models/_models.py | 897 ++++++++++++++++++ .../azure/mgmt/datadog/models/_models_py3.py | 897 ++++++++++++++++++ .../mgmt/datadog/models/_paged_models.py | 131 +++ .../azure/mgmt/datadog/operations/__init__.py | 34 + .../operations/_api_keys_operations.py | 234 +++++ .../datadog/operations/_hosts_operations.py | 111 +++ .../_linked_resources_operations.py | 112 +++ .../_marketplace_agreements_operations.py | 168 ++++ .../_monitored_resources_operations.py | 112 +++ .../operations/_monitors_operations.py | 496 ++++++++++ .../mgmt/datadog/operations/_operations.py | 101 ++ .../_refresh_set_password_operations.py | 100 ++ ...ingle_sign_on_configurations_operations.py | 292 ++++++ .../operations/_tag_rules_operations.py | 253 +++++ .../azure/mgmt/datadog/version.py | 13 + 20 files changed, 4312 insertions(+) create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/__init__.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_configuration.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_microsoft_datadog_client.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/__init__.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_microsoft_datadog_client_enums.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models_py3.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_paged_models.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/__init__.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_api_keys_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_hosts_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_linked_resources_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_marketplace_agreements_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitored_resources_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitors_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_refresh_set_password_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_single_sign_on_configurations_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_tag_rules_operations.py create mode 100644 sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/version.py diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/__init__.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/__init__.py new file mode 100644 index 000000000000..a82c923768fa --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._configuration import MicrosoftDatadogClientConfiguration +from ._microsoft_datadog_client import MicrosoftDatadogClient +__all__ = ['MicrosoftDatadogClient', 'MicrosoftDatadogClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_configuration.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_configuration.py new file mode 100644 index 000000000000..fdab7930d46e --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_configuration.py @@ -0,0 +1,48 @@ +# 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. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class MicrosoftDatadogClientConfiguration(AzureConfiguration): + """Configuration for MicrosoftDatadogClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(MicrosoftDatadogClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-datadog/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_microsoft_datadog_client.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_microsoft_datadog_client.py new file mode 100644 index 000000000000..e735b748710a --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_microsoft_datadog_client.py @@ -0,0 +1,94 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import MicrosoftDatadogClientConfiguration +from .operations import MarketplaceAgreementsOperations +from .operations import ApiKeysOperations +from .operations import HostsOperations +from .operations import LinkedResourcesOperations +from .operations import MonitoredResourcesOperations +from .operations import Operations +from .operations import MonitorsOperations +from .operations import RefreshSetPasswordOperations +from .operations import TagRulesOperations +from .operations import SingleSignOnConfigurationsOperations +from . import models + + +class MicrosoftDatadogClient(SDKClient): + """MicrosoftDatadogClient + + :ivar config: Configuration for client. + :vartype config: MicrosoftDatadogClientConfiguration + + :ivar marketplace_agreements: MarketplaceAgreements operations + :vartype marketplace_agreements: azure.mgmt.datadog.operations.MarketplaceAgreementsOperations + :ivar api_keys: ApiKeys operations + :vartype api_keys: azure.mgmt.datadog.operations.ApiKeysOperations + :ivar hosts: Hosts operations + :vartype hosts: azure.mgmt.datadog.operations.HostsOperations + :ivar linked_resources: LinkedResources operations + :vartype linked_resources: azure.mgmt.datadog.operations.LinkedResourcesOperations + :ivar monitored_resources: MonitoredResources operations + :vartype monitored_resources: azure.mgmt.datadog.operations.MonitoredResourcesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.datadog.operations.Operations + :ivar monitors: Monitors operations + :vartype monitors: azure.mgmt.datadog.operations.MonitorsOperations + :ivar refresh_set_password: RefreshSetPassword operations + :vartype refresh_set_password: azure.mgmt.datadog.operations.RefreshSetPasswordOperations + :ivar tag_rules: TagRules operations + :vartype tag_rules: azure.mgmt.datadog.operations.TagRulesOperations + :ivar single_sign_on_configurations: SingleSignOnConfigurations operations + :vartype single_sign_on_configurations: azure.mgmt.datadog.operations.SingleSignOnConfigurationsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Microsoft Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MicrosoftDatadogClientConfiguration(credentials, subscription_id, base_url) + super(MicrosoftDatadogClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2020-02-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.marketplace_agreements = MarketplaceAgreementsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_keys = ApiKeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.hosts = HostsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.linked_resources = LinkedResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.monitored_resources = MonitoredResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.monitors = MonitorsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.refresh_set_password = RefreshSetPasswordOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tag_rules = TagRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.single_sign_on_configurations = SingleSignOnConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/__init__.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/__init__.py new file mode 100644 index 000000000000..94154085b961 --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/__init__.py @@ -0,0 +1,137 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import DatadogAgreementProperties + from ._models_py3 import DatadogAgreementResource + from ._models_py3 import DatadogApiKey + from ._models_py3 import DatadogHost + from ._models_py3 import DatadogHostMetadata + from ._models_py3 import DatadogInstallMethod + from ._models_py3 import DatadogLogsAgent + from ._models_py3 import DatadogMonitorResource + from ._models_py3 import DatadogMonitorResourceUpdateParameters + from ._models_py3 import DatadogOrganizationProperties + from ._models_py3 import DatadogSetPasswordLink + from ._models_py3 import DatadogSingleSignOnProperties + from ._models_py3 import DatadogSingleSignOnResource + from ._models_py3 import ErrorResponseBody + from ._models_py3 import FilteringTag + from ._models_py3 import IdentityProperties + from ._models_py3 import LinkedResource + from ._models_py3 import LogRules + from ._models_py3 import MetricRules + from ._models_py3 import MonitoredResource + from ._models_py3 import MonitoringTagRules + from ._models_py3 import MonitoringTagRulesProperties + from ._models_py3 import MonitorProperties + from ._models_py3 import MonitorUpdateProperties + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationResult + from ._models_py3 import ResourceProviderDefaultErrorResponse, ResourceProviderDefaultErrorResponseException + from ._models_py3 import ResourceSku + from ._models_py3 import UserInfo +except (SyntaxError, ImportError): + from ._models import DatadogAgreementProperties + from ._models import DatadogAgreementResource + from ._models import DatadogApiKey + from ._models import DatadogHost + from ._models import DatadogHostMetadata + from ._models import DatadogInstallMethod + from ._models import DatadogLogsAgent + from ._models import DatadogMonitorResource + from ._models import DatadogMonitorResourceUpdateParameters + from ._models import DatadogOrganizationProperties + from ._models import DatadogSetPasswordLink + from ._models import DatadogSingleSignOnProperties + from ._models import DatadogSingleSignOnResource + from ._models import ErrorResponseBody + from ._models import FilteringTag + from ._models import IdentityProperties + from ._models import LinkedResource + from ._models import LogRules + from ._models import MetricRules + from ._models import MonitoredResource + from ._models import MonitoringTagRules + from ._models import MonitoringTagRulesProperties + from ._models import MonitorProperties + from ._models import MonitorUpdateProperties + from ._models import OperationDisplay + from ._models import OperationResult + from ._models import ResourceProviderDefaultErrorResponse, ResourceProviderDefaultErrorResponseException + from ._models import ResourceSku + from ._models import UserInfo +from ._paged_models import DatadogAgreementResourcePaged +from ._paged_models import DatadogApiKeyPaged +from ._paged_models import DatadogHostPaged +from ._paged_models import DatadogMonitorResourcePaged +from ._paged_models import DatadogSingleSignOnResourcePaged +from ._paged_models import LinkedResourcePaged +from ._paged_models import MonitoredResourcePaged +from ._paged_models import MonitoringTagRulesPaged +from ._paged_models import OperationResultPaged +from ._microsoft_datadog_client_enums import ( + ProvisioningState, + MonitoringStatus, + MarketplaceSubscriptionStatus, + LiftrResourceCategories, + ManagedIdentityTypes, + TagAction, + SingleSignOnStates, +) + +__all__ = [ + 'DatadogAgreementProperties', + 'DatadogAgreementResource', + 'DatadogApiKey', + 'DatadogHost', + 'DatadogHostMetadata', + 'DatadogInstallMethod', + 'DatadogLogsAgent', + 'DatadogMonitorResource', + 'DatadogMonitorResourceUpdateParameters', + 'DatadogOrganizationProperties', + 'DatadogSetPasswordLink', + 'DatadogSingleSignOnProperties', + 'DatadogSingleSignOnResource', + 'ErrorResponseBody', + 'FilteringTag', + 'IdentityProperties', + 'LinkedResource', + 'LogRules', + 'MetricRules', + 'MonitoredResource', + 'MonitoringTagRules', + 'MonitoringTagRulesProperties', + 'MonitorProperties', + 'MonitorUpdateProperties', + 'OperationDisplay', + 'OperationResult', + 'ResourceProviderDefaultErrorResponse', 'ResourceProviderDefaultErrorResponseException', + 'ResourceSku', + 'UserInfo', + 'DatadogAgreementResourcePaged', + 'DatadogApiKeyPaged', + 'DatadogHostPaged', + 'LinkedResourcePaged', + 'MonitoredResourcePaged', + 'OperationResultPaged', + 'DatadogMonitorResourcePaged', + 'MonitoringTagRulesPaged', + 'DatadogSingleSignOnResourcePaged', + 'ProvisioningState', + 'MonitoringStatus', + 'MarketplaceSubscriptionStatus', + 'LiftrResourceCategories', + 'ManagedIdentityTypes', + 'TagAction', + 'SingleSignOnStates', +] diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_microsoft_datadog_client_enums.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_microsoft_datadog_client_enums.py new file mode 100644 index 000000000000..c35044d7e78b --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_microsoft_datadog_client_enums.py @@ -0,0 +1,63 @@ +# 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. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + deleted = "Deleted" + not_specified = "NotSpecified" + + +class MonitoringStatus(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class MarketplaceSubscriptionStatus(str, Enum): + + active = "Active" + suspended = "Suspended" + + +class LiftrResourceCategories(str, Enum): + + unknown = "Unknown" + monitor_logs = "MonitorLogs" + + +class ManagedIdentityTypes(str, Enum): + + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + + +class TagAction(str, Enum): + + include = "Include" + exclude = "Exclude" + + +class SingleSignOnStates(str, Enum): + + initial = "Initial" + enable = "Enable" + disable = "Disable" + existing = "Existing" diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models.py new file mode 100644 index 000000000000..665ed6e8b964 --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models.py @@ -0,0 +1,897 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class DatadogAgreementProperties(Model): + """Terms properties. + + :param publisher: Publisher identifier string. + :type publisher: str + :param product: Product identifier string. + :type product: str + :param plan: Plan identifier string. + :type plan: str + :param license_text_link: Link to HTML with Microsoft and Publisher terms. + :type license_text_link: str + :param privacy_policy_link: Link to the privacy policy of the publisher. + :type privacy_policy_link: str + :param retrieve_datetime: Date and time in UTC of when the terms were + accepted. This is empty if Accepted is false. + :type retrieve_datetime: datetime + :param signature: Terms signature. + :type signature: str + :param accepted: If any version of the terms have been accepted, otherwise + false. + :type accepted: bool + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'str'}, + 'license_text_link': {'key': 'licenseTextLink', 'type': 'str'}, + 'privacy_policy_link': {'key': 'privacyPolicyLink', 'type': 'str'}, + 'retrieve_datetime': {'key': 'retrieveDatetime', 'type': 'iso-8601'}, + 'signature': {'key': 'signature', 'type': 'str'}, + 'accepted': {'key': 'accepted', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DatadogAgreementProperties, self).__init__(**kwargs) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.plan = kwargs.get('plan', None) + self.license_text_link = kwargs.get('license_text_link', None) + self.privacy_policy_link = kwargs.get('privacy_policy_link', None) + self.retrieve_datetime = kwargs.get('retrieve_datetime', None) + self.signature = kwargs.get('signature', None) + self.accepted = kwargs.get('accepted', None) + + +class DatadogAgreementResource(Model): + """DatadogAgreementResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ARM id of the resource. + :vartype id: str + :ivar name: Name of the agreement. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Represents the properties of the resource. + :type properties: ~azure.mgmt.datadog.models.DatadogAgreementProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DatadogAgreementProperties'}, + } + + def __init__(self, **kwargs): + super(DatadogAgreementResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class DatadogApiKey(Model): + """DatadogApiKey. + + All required parameters must be populated in order to send to Azure. + + :param created_by: The user that created the API key. + :type created_by: str + :param name: The name of the API key. + :type name: str + :param key: Required. The value of the API key. + :type key: str + :param created: The time of creation of the API key. + :type created: str + """ + + _validation = { + 'key': {'required': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatadogApiKey, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.name = kwargs.get('name', None) + self.key = kwargs.get('key', None) + self.created = kwargs.get('created', None) + + +class DatadogHost(Model): + """DatadogHost. + + :param name: The name of the host. + :type name: str + :param aliases: The aliases for the host. + :type aliases: list[str] + :param apps: The Datadog integrations reporting metrics for the host. + :type apps: list[str] + :param meta: + :type meta: ~azure.mgmt.datadog.models.DatadogHostMetadata + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'aliases': {'key': 'aliases', 'type': '[str]'}, + 'apps': {'key': 'apps', 'type': '[str]'}, + 'meta': {'key': 'meta', 'type': 'DatadogHostMetadata'}, + } + + def __init__(self, **kwargs): + super(DatadogHost, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.aliases = kwargs.get('aliases', None) + self.apps = kwargs.get('apps', None) + self.meta = kwargs.get('meta', None) + + +class DatadogHostMetadata(Model): + """DatadogHostMetadata. + + :param agent_version: The agent version. + :type agent_version: str + :param install_method: + :type install_method: ~azure.mgmt.datadog.models.DatadogInstallMethod + :param logs_agent: + :type logs_agent: ~azure.mgmt.datadog.models.DatadogLogsAgent + """ + + _attribute_map = { + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'install_method': {'key': 'installMethod', 'type': 'DatadogInstallMethod'}, + 'logs_agent': {'key': 'logsAgent', 'type': 'DatadogLogsAgent'}, + } + + def __init__(self, **kwargs): + super(DatadogHostMetadata, self).__init__(**kwargs) + self.agent_version = kwargs.get('agent_version', None) + self.install_method = kwargs.get('install_method', None) + self.logs_agent = kwargs.get('logs_agent', None) + + +class DatadogInstallMethod(Model): + """DatadogInstallMethod. + + :param tool: The tool. + :type tool: str + :param tool_version: The tool version. + :type tool_version: str + :param installer_version: The installer version. + :type installer_version: str + """ + + _attribute_map = { + 'tool': {'key': 'tool', 'type': 'str'}, + 'tool_version': {'key': 'toolVersion', 'type': 'str'}, + 'installer_version': {'key': 'installerVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatadogInstallMethod, self).__init__(**kwargs) + self.tool = kwargs.get('tool', None) + self.tool_version = kwargs.get('tool_version', None) + self.installer_version = kwargs.get('installer_version', None) + + +class DatadogLogsAgent(Model): + """DatadogLogsAgent. + + :param transport: The transport. + :type transport: str + """ + + _attribute_map = { + 'transport': {'key': 'transport', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatadogLogsAgent, self).__init__(**kwargs) + self.transport = kwargs.get('transport', None) + + +class DatadogMonitorResource(Model): + """DatadogMonitorResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: ARM id of the monitor resource. + :vartype id: str + :ivar name: Name of the monitor resource. + :vartype name: str + :ivar type: The type of the monitor resource. + :vartype type: str + :param sku: + :type sku: ~azure.mgmt.datadog.models.ResourceSku + :param properties: + :type properties: ~azure.mgmt.datadog.models.MonitorProperties + :param identity: + :type identity: ~azure.mgmt.datadog.models.IdentityProperties + :param tags: + :type tags: dict[str, str] + :param location: Required. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'MonitorProperties'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatadogMonitorResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.sku = kwargs.get('sku', None) + self.properties = kwargs.get('properties', None) + self.identity = kwargs.get('identity', None) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class DatadogMonitorResourceUpdateParameters(Model): + """The parameters for a PATCH request to a monitor resource. + + :param properties: + :type properties: ~azure.mgmt.datadog.models.MonitorUpdateProperties + :param tags: The new tags of the monitor resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MonitorUpdateProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DatadogMonitorResourceUpdateParameters, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.tags = kwargs.get('tags', None) + + +class DatadogOrganizationProperties(Model): + """Datadog organization properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Datadog organization. + :vartype name: str + :ivar id: Id of the Datadog organization. + :vartype id: str + :param linking_auth_code: The auth code used to linking to an existing + datadog organization. + :type linking_auth_code: str + :param linking_client_id: The client_id from an existing in exchange for + an auth token to link organization. + :type linking_client_id: str + :param enterprise_app_id: The Id of the Enterprise App used for Single + sign on. + :type enterprise_app_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'linking_auth_code': {'key': 'linkingAuthCode', 'type': 'str'}, + 'linking_client_id': {'key': 'linkingClientId', 'type': 'str'}, + 'enterprise_app_id': {'key': 'enterpriseAppId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatadogOrganizationProperties, self).__init__(**kwargs) + self.name = None + self.id = None + self.linking_auth_code = kwargs.get('linking_auth_code', None) + self.linking_client_id = kwargs.get('linking_client_id', None) + self.enterprise_app_id = kwargs.get('enterprise_app_id', None) + + +class DatadogSetPasswordLink(Model): + """DatadogSetPasswordLink. + + :param set_password_link: + :type set_password_link: str + """ + + _attribute_map = { + 'set_password_link': {'key': 'setPasswordLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatadogSetPasswordLink, self).__init__(**kwargs) + self.set_password_link = kwargs.get('set_password_link', None) + + +class DatadogSingleSignOnProperties(Model): + """DatadogSingleSignOnProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param single_sign_on_state: Possible values include: 'Initial', 'Enable', + 'Disable', 'Existing' + :type single_sign_on_state: str or + ~azure.mgmt.datadog.models.SingleSignOnStates + :param enterprise_app_id: The Id of the Enterprise App used for Single + sign-on. + :type enterprise_app_id: str + :ivar single_sign_on_url: The login URL specific to this Datadog + Organization. + :vartype single_sign_on_url: str + """ + + _validation = { + 'single_sign_on_url': {'readonly': True}, + } + + _attribute_map = { + 'single_sign_on_state': {'key': 'singleSignOnState', 'type': 'str'}, + 'enterprise_app_id': {'key': 'enterpriseAppId', 'type': 'str'}, + 'single_sign_on_url': {'key': 'singleSignOnUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DatadogSingleSignOnProperties, self).__init__(**kwargs) + self.single_sign_on_state = kwargs.get('single_sign_on_state', None) + self.enterprise_app_id = kwargs.get('enterprise_app_id', None) + self.single_sign_on_url = None + + +class DatadogSingleSignOnResource(Model): + """DatadogSingleSignOnResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ARM id of the resource. + :vartype id: str + :ivar name: Name of the configuration. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: + :type properties: ~azure.mgmt.datadog.models.DatadogSingleSignOnProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DatadogSingleSignOnProperties'}, + } + + def __init__(self, **kwargs): + super(DatadogSingleSignOnResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class ErrorResponseBody(Model): + """ErrorResponseBody. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.datadog.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class FilteringTag(Model): + """The definition of a filtering tag. Filtering tags are used for capturing + resources and include/exclude them from being monitored. + + :param name: The name (also known as the key) of the tag. + :type name: str + :param value: The value of the tag. + :type value: str + :param action: Possible values include: 'Include', 'Exclude' + :type action: str or ~azure.mgmt.datadog.models.TagAction + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FilteringTag, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + self.action = kwargs.get('action', None) + + +class IdentityProperties(Model): + """IdentityProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The identity ID. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Possible values include: 'SystemAssigned', 'UserAssigned' + :type type: str or ~azure.mgmt.datadog.models.ManagedIdentityTypes + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + +class LinkedResource(Model): + """The definition of a linked resource. + + :param id: The ARM id of the linked resource. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinkedResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class LogRules(Model): + """Set of rules for sending logs for the Monitor resource. + + :param send_aad_logs: Flag specifying if AAD logs should be sent for the + Monitor resource. + :type send_aad_logs: bool + :param send_subscription_logs: Flag specifying if Azure subscription logs + should be sent for the Monitor resource. + :type send_subscription_logs: bool + :param send_resource_logs: Flag specifying if Azure resource logs should + be sent for the Monitor resource. + :type send_resource_logs: bool + :param filtering_tags: 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. + :type filtering_tags: list[~azure.mgmt.datadog.models.FilteringTag] + """ + + _attribute_map = { + 'send_aad_logs': {'key': 'sendAadLogs', 'type': 'bool'}, + 'send_subscription_logs': {'key': 'sendSubscriptionLogs', 'type': 'bool'}, + 'send_resource_logs': {'key': 'sendResourceLogs', 'type': 'bool'}, + 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, + } + + def __init__(self, **kwargs): + super(LogRules, self).__init__(**kwargs) + self.send_aad_logs = kwargs.get('send_aad_logs', None) + self.send_subscription_logs = kwargs.get('send_subscription_logs', None) + self.send_resource_logs = kwargs.get('send_resource_logs', None) + self.filtering_tags = kwargs.get('filtering_tags', None) + + +class MetricRules(Model): + """Set of rules for sending metrics for the Monitor resource. + + :param filtering_tags: List of filtering tags to be used for capturing + metrics. 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. + :type filtering_tags: list[~azure.mgmt.datadog.models.FilteringTag] + """ + + _attribute_map = { + 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, + } + + def __init__(self, **kwargs): + super(MetricRules, self).__init__(**kwargs) + self.filtering_tags = kwargs.get('filtering_tags', None) + + +class MonitoredResource(Model): + """The properties of a resource currently being monitored by the Datadog + monitor resource. + + :param id: The ARM id of the resource. + :type id: str + :param sending_metrics: Flag indicating if resource is sending metrics to + Datadog. + :type sending_metrics: bool + :param reason_for_metrics_status: Reason for why the resource is sending + metrics (or why it is not sending). + :type reason_for_metrics_status: str + :param sending_logs: Flag indicating if resource is sending logs to + Datadog. + :type sending_logs: bool + :param reason_for_logs_status: Reason for why the resource is sending logs + (or why it is not sending). + :type reason_for_logs_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sending_metrics': {'key': 'sendingMetrics', 'type': 'bool'}, + 'reason_for_metrics_status': {'key': 'reasonForMetricsStatus', 'type': 'str'}, + 'sending_logs': {'key': 'sendingLogs', 'type': 'bool'}, + 'reason_for_logs_status': {'key': 'reasonForLogsStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MonitoredResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.sending_metrics = kwargs.get('sending_metrics', None) + self.reason_for_metrics_status = kwargs.get('reason_for_metrics_status', None) + self.sending_logs = kwargs.get('sending_logs', None) + self.reason_for_logs_status = kwargs.get('reason_for_logs_status', None) + + +class MonitoringTagRules(Model): + """Capture logs and metrics of Azure resources based on ARM tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the rule set. + :vartype name: str + :ivar id: The id of the rule set. + :vartype id: str + :ivar type: The type of the rule set. + :vartype type: str + :param properties: + :type properties: ~azure.mgmt.datadog.models.MonitoringTagRulesProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringTagRulesProperties'}, + } + + def __init__(self, **kwargs): + super(MonitoringTagRules, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class MonitoringTagRulesProperties(Model): + """Definition of the properties for a TagRules resource. + + :param log_rules: + :type log_rules: ~azure.mgmt.datadog.models.LogRules + :param metric_rules: + :type metric_rules: ~azure.mgmt.datadog.models.MetricRules + """ + + _attribute_map = { + 'log_rules': {'key': 'logRules', 'type': 'LogRules'}, + 'metric_rules': {'key': 'metricRules', 'type': 'MetricRules'}, + } + + def __init__(self, **kwargs): + super(MonitoringTagRulesProperties, self).__init__(**kwargs) + self.log_rules = kwargs.get('log_rules', None) + self.metric_rules = kwargs.get('metric_rules', None) + + +class MonitorProperties(Model): + """Properties specific to the monitor resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Possible values include: 'Accepted', + 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + 'Deleted', 'NotSpecified' + :type provisioning_state: str or + ~azure.mgmt.datadog.models.ProvisioningState + :param monitoring_status: Possible values include: 'Enabled', 'Disabled' + :type monitoring_status: str or + ~azure.mgmt.datadog.models.MonitoringStatus + :param marketplace_subscription_status: Possible values include: 'Active', + 'Suspended' + :type marketplace_subscription_status: str or + ~azure.mgmt.datadog.models.MarketplaceSubscriptionStatus + :param datadog_organization_properties: + :type datadog_organization_properties: + ~azure.mgmt.datadog.models.DatadogOrganizationProperties + :param user_info: + :type user_info: ~azure.mgmt.datadog.models.UserInfo + :param liftr_resource_category: Possible values include: 'Unknown', + 'MonitorLogs' + :type liftr_resource_category: str or + ~azure.mgmt.datadog.models.LiftrResourceCategories + :ivar liftr_resource_preference: The priority of the resource. + :vartype liftr_resource_preference: int + """ + + _validation = { + 'liftr_resource_preference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, + 'datadog_organization_properties': {'key': 'datadogOrganizationProperties', 'type': 'DatadogOrganizationProperties'}, + 'user_info': {'key': 'userInfo', 'type': 'UserInfo'}, + 'liftr_resource_category': {'key': 'liftrResourceCategory', 'type': 'str'}, + 'liftr_resource_preference': {'key': 'liftrResourcePreference', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(MonitorProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.monitoring_status = kwargs.get('monitoring_status', None) + self.marketplace_subscription_status = kwargs.get('marketplace_subscription_status', None) + self.datadog_organization_properties = kwargs.get('datadog_organization_properties', None) + self.user_info = kwargs.get('user_info', None) + self.liftr_resource_category = kwargs.get('liftr_resource_category', None) + self.liftr_resource_preference = None + + +class MonitorUpdateProperties(Model): + """The set of properties that can be update in a PATCH request to a monitor + resource. + + :param monitoring_status: Possible values include: 'Enabled', 'Disabled' + :type monitoring_status: str or + ~azure.mgmt.datadog.models.MonitoringStatus + """ + + _attribute_map = { + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MonitorUpdateProperties, self).__init__(**kwargs) + self.monitoring_status = kwargs.get('monitoring_status', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider, i.e., Microsoft.Datadog. + :type provider: str + :param resource: Type on which the operation is performed, e.g., + 'monitors'. + :type resource: str + :param operation: Operation type, e.g., read, write, delete, etc. + :type operation: str + :param description: Description of the operation, e.g., 'Write monitors'. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationResult(Model): + """A Microsoft.Datadog REST API operation. + + :param name: Operation name, i.e., {provider}/{resource}/{operation}. + :type name: str + :param display: + :type display: ~azure.mgmt.datadog.models.OperationDisplay + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(OperationResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.is_data_action = kwargs.get('is_data_action', None) + + +class ResourceProviderDefaultErrorResponse(Model): + """ResourceProviderDefaultErrorResponse. + + :param error: + :type error: ~azure.mgmt.datadog.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ResourceProviderDefaultErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ResourceProviderDefaultErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ResourceProviderDefaultErrorResponseException, self).__init__(deserialize, response, 'ResourceProviderDefaultErrorResponse', *args) + + +class ResourceSku(Model): + """ResourceSku. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class UserInfo(Model): + """User info. + + :param name: Name of the user + :type name: str + :param email_address: Email of the user used by Datadog for contacting + them if needed + :type email_address: str + :param phone_number: Phone number of the user used by Datadog for + contacting them if needed + :type phone_number: str + """ + + _validation = { + 'name': {'max_length': 50}, + 'email_address': {'pattern': r'^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}$'}, + 'phone_number': {'max_length': 40}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserInfo, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.email_address = kwargs.get('email_address', None) + self.phone_number = kwargs.get('phone_number', None) diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models_py3.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models_py3.py new file mode 100644 index 000000000000..5874d7451c4e --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_models_py3.py @@ -0,0 +1,897 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class DatadogAgreementProperties(Model): + """Terms properties. + + :param publisher: Publisher identifier string. + :type publisher: str + :param product: Product identifier string. + :type product: str + :param plan: Plan identifier string. + :type plan: str + :param license_text_link: Link to HTML with Microsoft and Publisher terms. + :type license_text_link: str + :param privacy_policy_link: Link to the privacy policy of the publisher. + :type privacy_policy_link: str + :param retrieve_datetime: Date and time in UTC of when the terms were + accepted. This is empty if Accepted is false. + :type retrieve_datetime: datetime + :param signature: Terms signature. + :type signature: str + :param accepted: If any version of the terms have been accepted, otherwise + false. + :type accepted: bool + """ + + _attribute_map = { + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'product': {'key': 'product', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'str'}, + 'license_text_link': {'key': 'licenseTextLink', 'type': 'str'}, + 'privacy_policy_link': {'key': 'privacyPolicyLink', 'type': 'str'}, + 'retrieve_datetime': {'key': 'retrieveDatetime', 'type': 'iso-8601'}, + 'signature': {'key': 'signature', 'type': 'str'}, + 'accepted': {'key': 'accepted', 'type': 'bool'}, + } + + def __init__(self, *, publisher: str=None, product: str=None, plan: str=None, license_text_link: str=None, privacy_policy_link: str=None, retrieve_datetime=None, signature: str=None, accepted: bool=None, **kwargs) -> None: + super(DatadogAgreementProperties, self).__init__(**kwargs) + self.publisher = publisher + self.product = product + self.plan = plan + self.license_text_link = license_text_link + self.privacy_policy_link = privacy_policy_link + self.retrieve_datetime = retrieve_datetime + self.signature = signature + self.accepted = accepted + + +class DatadogAgreementResource(Model): + """DatadogAgreementResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ARM id of the resource. + :vartype id: str + :ivar name: Name of the agreement. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Represents the properties of the resource. + :type properties: ~azure.mgmt.datadog.models.DatadogAgreementProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DatadogAgreementProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DatadogAgreementResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class DatadogApiKey(Model): + """DatadogApiKey. + + All required parameters must be populated in order to send to Azure. + + :param created_by: The user that created the API key. + :type created_by: str + :param name: The name of the API key. + :type name: str + :param key: Required. The value of the API key. + :type key: str + :param created: The time of creation of the API key. + :type created: str + """ + + _validation = { + 'key': {'required': True}, + } + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'created': {'key': 'created', 'type': 'str'}, + } + + def __init__(self, *, key: str, created_by: str=None, name: str=None, created: str=None, **kwargs) -> None: + super(DatadogApiKey, self).__init__(**kwargs) + self.created_by = created_by + self.name = name + self.key = key + self.created = created + + +class DatadogHost(Model): + """DatadogHost. + + :param name: The name of the host. + :type name: str + :param aliases: The aliases for the host. + :type aliases: list[str] + :param apps: The Datadog integrations reporting metrics for the host. + :type apps: list[str] + :param meta: + :type meta: ~azure.mgmt.datadog.models.DatadogHostMetadata + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'aliases': {'key': 'aliases', 'type': '[str]'}, + 'apps': {'key': 'apps', 'type': '[str]'}, + 'meta': {'key': 'meta', 'type': 'DatadogHostMetadata'}, + } + + def __init__(self, *, name: str=None, aliases=None, apps=None, meta=None, **kwargs) -> None: + super(DatadogHost, self).__init__(**kwargs) + self.name = name + self.aliases = aliases + self.apps = apps + self.meta = meta + + +class DatadogHostMetadata(Model): + """DatadogHostMetadata. + + :param agent_version: The agent version. + :type agent_version: str + :param install_method: + :type install_method: ~azure.mgmt.datadog.models.DatadogInstallMethod + :param logs_agent: + :type logs_agent: ~azure.mgmt.datadog.models.DatadogLogsAgent + """ + + _attribute_map = { + 'agent_version': {'key': 'agentVersion', 'type': 'str'}, + 'install_method': {'key': 'installMethod', 'type': 'DatadogInstallMethod'}, + 'logs_agent': {'key': 'logsAgent', 'type': 'DatadogLogsAgent'}, + } + + def __init__(self, *, agent_version: str=None, install_method=None, logs_agent=None, **kwargs) -> None: + super(DatadogHostMetadata, self).__init__(**kwargs) + self.agent_version = agent_version + self.install_method = install_method + self.logs_agent = logs_agent + + +class DatadogInstallMethod(Model): + """DatadogInstallMethod. + + :param tool: The tool. + :type tool: str + :param tool_version: The tool version. + :type tool_version: str + :param installer_version: The installer version. + :type installer_version: str + """ + + _attribute_map = { + 'tool': {'key': 'tool', 'type': 'str'}, + 'tool_version': {'key': 'toolVersion', 'type': 'str'}, + 'installer_version': {'key': 'installerVersion', 'type': 'str'}, + } + + def __init__(self, *, tool: str=None, tool_version: str=None, installer_version: str=None, **kwargs) -> None: + super(DatadogInstallMethod, self).__init__(**kwargs) + self.tool = tool + self.tool_version = tool_version + self.installer_version = installer_version + + +class DatadogLogsAgent(Model): + """DatadogLogsAgent. + + :param transport: The transport. + :type transport: str + """ + + _attribute_map = { + 'transport': {'key': 'transport', 'type': 'str'}, + } + + def __init__(self, *, transport: str=None, **kwargs) -> None: + super(DatadogLogsAgent, self).__init__(**kwargs) + self.transport = transport + + +class DatadogMonitorResource(Model): + """DatadogMonitorResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: ARM id of the monitor resource. + :vartype id: str + :ivar name: Name of the monitor resource. + :vartype name: str + :ivar type: The type of the monitor resource. + :vartype type: str + :param sku: + :type sku: ~azure.mgmt.datadog.models.ResourceSku + :param properties: + :type properties: ~azure.mgmt.datadog.models.MonitorProperties + :param identity: + :type identity: ~azure.mgmt.datadog.models.IdentityProperties + :param tags: + :type tags: dict[str, str] + :param location: Required. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'ResourceSku'}, + 'properties': {'key': 'properties', 'type': 'MonitorProperties'}, + 'identity': {'key': 'identity', 'type': 'IdentityProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, sku=None, properties=None, identity=None, tags=None, **kwargs) -> None: + super(DatadogMonitorResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.sku = sku + self.properties = properties + self.identity = identity + self.tags = tags + self.location = location + + +class DatadogMonitorResourceUpdateParameters(Model): + """The parameters for a PATCH request to a monitor resource. + + :param properties: + :type properties: ~azure.mgmt.datadog.models.MonitorUpdateProperties + :param tags: The new tags of the monitor resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MonitorUpdateProperties'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, properties=None, tags=None, **kwargs) -> None: + super(DatadogMonitorResourceUpdateParameters, self).__init__(**kwargs) + self.properties = properties + self.tags = tags + + +class DatadogOrganizationProperties(Model): + """Datadog organization properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Datadog organization. + :vartype name: str + :ivar id: Id of the Datadog organization. + :vartype id: str + :param linking_auth_code: The auth code used to linking to an existing + datadog organization. + :type linking_auth_code: str + :param linking_client_id: The client_id from an existing in exchange for + an auth token to link organization. + :type linking_client_id: str + :param enterprise_app_id: The Id of the Enterprise App used for Single + sign on. + :type enterprise_app_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'linking_auth_code': {'key': 'linkingAuthCode', 'type': 'str'}, + 'linking_client_id': {'key': 'linkingClientId', 'type': 'str'}, + 'enterprise_app_id': {'key': 'enterpriseAppId', 'type': 'str'}, + } + + def __init__(self, *, linking_auth_code: str=None, linking_client_id: str=None, enterprise_app_id: str=None, **kwargs) -> None: + super(DatadogOrganizationProperties, self).__init__(**kwargs) + self.name = None + self.id = None + self.linking_auth_code = linking_auth_code + self.linking_client_id = linking_client_id + self.enterprise_app_id = enterprise_app_id + + +class DatadogSetPasswordLink(Model): + """DatadogSetPasswordLink. + + :param set_password_link: + :type set_password_link: str + """ + + _attribute_map = { + 'set_password_link': {'key': 'setPasswordLink', 'type': 'str'}, + } + + def __init__(self, *, set_password_link: str=None, **kwargs) -> None: + super(DatadogSetPasswordLink, self).__init__(**kwargs) + self.set_password_link = set_password_link + + +class DatadogSingleSignOnProperties(Model): + """DatadogSingleSignOnProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param single_sign_on_state: Possible values include: 'Initial', 'Enable', + 'Disable', 'Existing' + :type single_sign_on_state: str or + ~azure.mgmt.datadog.models.SingleSignOnStates + :param enterprise_app_id: The Id of the Enterprise App used for Single + sign-on. + :type enterprise_app_id: str + :ivar single_sign_on_url: The login URL specific to this Datadog + Organization. + :vartype single_sign_on_url: str + """ + + _validation = { + 'single_sign_on_url': {'readonly': True}, + } + + _attribute_map = { + 'single_sign_on_state': {'key': 'singleSignOnState', 'type': 'str'}, + 'enterprise_app_id': {'key': 'enterpriseAppId', 'type': 'str'}, + 'single_sign_on_url': {'key': 'singleSignOnUrl', 'type': 'str'}, + } + + def __init__(self, *, single_sign_on_state=None, enterprise_app_id: str=None, **kwargs) -> None: + super(DatadogSingleSignOnProperties, self).__init__(**kwargs) + self.single_sign_on_state = single_sign_on_state + self.enterprise_app_id = enterprise_app_id + self.single_sign_on_url = None + + +class DatadogSingleSignOnResource(Model): + """DatadogSingleSignOnResource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: ARM id of the resource. + :vartype id: str + :ivar name: Name of the configuration. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: + :type properties: ~azure.mgmt.datadog.models.DatadogSingleSignOnProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DatadogSingleSignOnProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DatadogSingleSignOnResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class ErrorResponseBody(Model): + """ErrorResponseBody. + + :param code: + :type code: str + :param message: + :type message: str + :param target: + :type target: str + :param details: + :type details: list[~azure.mgmt.datadog.models.ErrorResponseBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class FilteringTag(Model): + """The definition of a filtering tag. Filtering tags are used for capturing + resources and include/exclude them from being monitored. + + :param name: The name (also known as the key) of the tag. + :type name: str + :param value: The value of the tag. + :type value: str + :param action: Possible values include: 'Include', 'Exclude' + :type action: str or ~azure.mgmt.datadog.models.TagAction + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, action=None, **kwargs) -> None: + super(FilteringTag, self).__init__(**kwargs) + self.name = name + self.value = value + self.action = action + + +class IdentityProperties(Model): + """IdentityProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: The identity ID. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type: Possible values include: 'SystemAssigned', 'UserAssigned' + :type type: str or ~azure.mgmt.datadog.models.ManagedIdentityTypes + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(IdentityProperties, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + + +class LinkedResource(Model): + """The definition of a linked resource. + + :param id: The ARM id of the linked resource. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(LinkedResource, self).__init__(**kwargs) + self.id = id + + +class LogRules(Model): + """Set of rules for sending logs for the Monitor resource. + + :param send_aad_logs: Flag specifying if AAD logs should be sent for the + Monitor resource. + :type send_aad_logs: bool + :param send_subscription_logs: Flag specifying if Azure subscription logs + should be sent for the Monitor resource. + :type send_subscription_logs: bool + :param send_resource_logs: Flag specifying if Azure resource logs should + be sent for the Monitor resource. + :type send_resource_logs: bool + :param filtering_tags: 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. + :type filtering_tags: list[~azure.mgmt.datadog.models.FilteringTag] + """ + + _attribute_map = { + 'send_aad_logs': {'key': 'sendAadLogs', 'type': 'bool'}, + 'send_subscription_logs': {'key': 'sendSubscriptionLogs', 'type': 'bool'}, + 'send_resource_logs': {'key': 'sendResourceLogs', 'type': 'bool'}, + 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, + } + + def __init__(self, *, send_aad_logs: bool=None, send_subscription_logs: bool=None, send_resource_logs: bool=None, filtering_tags=None, **kwargs) -> None: + super(LogRules, self).__init__(**kwargs) + self.send_aad_logs = send_aad_logs + self.send_subscription_logs = send_subscription_logs + self.send_resource_logs = send_resource_logs + self.filtering_tags = filtering_tags + + +class MetricRules(Model): + """Set of rules for sending metrics for the Monitor resource. + + :param filtering_tags: List of filtering tags to be used for capturing + metrics. 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. + :type filtering_tags: list[~azure.mgmt.datadog.models.FilteringTag] + """ + + _attribute_map = { + 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, + } + + def __init__(self, *, filtering_tags=None, **kwargs) -> None: + super(MetricRules, self).__init__(**kwargs) + self.filtering_tags = filtering_tags + + +class MonitoredResource(Model): + """The properties of a resource currently being monitored by the Datadog + monitor resource. + + :param id: The ARM id of the resource. + :type id: str + :param sending_metrics: Flag indicating if resource is sending metrics to + Datadog. + :type sending_metrics: bool + :param reason_for_metrics_status: Reason for why the resource is sending + metrics (or why it is not sending). + :type reason_for_metrics_status: str + :param sending_logs: Flag indicating if resource is sending logs to + Datadog. + :type sending_logs: bool + :param reason_for_logs_status: Reason for why the resource is sending logs + (or why it is not sending). + :type reason_for_logs_status: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'sending_metrics': {'key': 'sendingMetrics', 'type': 'bool'}, + 'reason_for_metrics_status': {'key': 'reasonForMetricsStatus', 'type': 'str'}, + 'sending_logs': {'key': 'sendingLogs', 'type': 'bool'}, + 'reason_for_logs_status': {'key': 'reasonForLogsStatus', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, sending_metrics: bool=None, reason_for_metrics_status: str=None, sending_logs: bool=None, reason_for_logs_status: str=None, **kwargs) -> None: + super(MonitoredResource, self).__init__(**kwargs) + self.id = id + self.sending_metrics = sending_metrics + self.reason_for_metrics_status = reason_for_metrics_status + self.sending_logs = sending_logs + self.reason_for_logs_status = reason_for_logs_status + + +class MonitoringTagRules(Model): + """Capture logs and metrics of Azure resources based on ARM tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the rule set. + :vartype name: str + :ivar id: The id of the rule set. + :vartype id: str + :ivar type: The type of the rule set. + :vartype type: str + :param properties: + :type properties: ~azure.mgmt.datadog.models.MonitoringTagRulesProperties + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringTagRulesProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MonitoringTagRules, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = properties + + +class MonitoringTagRulesProperties(Model): + """Definition of the properties for a TagRules resource. + + :param log_rules: + :type log_rules: ~azure.mgmt.datadog.models.LogRules + :param metric_rules: + :type metric_rules: ~azure.mgmt.datadog.models.MetricRules + """ + + _attribute_map = { + 'log_rules': {'key': 'logRules', 'type': 'LogRules'}, + 'metric_rules': {'key': 'metricRules', 'type': 'MetricRules'}, + } + + def __init__(self, *, log_rules=None, metric_rules=None, **kwargs) -> None: + super(MonitoringTagRulesProperties, self).__init__(**kwargs) + self.log_rules = log_rules + self.metric_rules = metric_rules + + +class MonitorProperties(Model): + """Properties specific to the monitor resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Possible values include: 'Accepted', + 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + 'Deleted', 'NotSpecified' + :type provisioning_state: str or + ~azure.mgmt.datadog.models.ProvisioningState + :param monitoring_status: Possible values include: 'Enabled', 'Disabled' + :type monitoring_status: str or + ~azure.mgmt.datadog.models.MonitoringStatus + :param marketplace_subscription_status: Possible values include: 'Active', + 'Suspended' + :type marketplace_subscription_status: str or + ~azure.mgmt.datadog.models.MarketplaceSubscriptionStatus + :param datadog_organization_properties: + :type datadog_organization_properties: + ~azure.mgmt.datadog.models.DatadogOrganizationProperties + :param user_info: + :type user_info: ~azure.mgmt.datadog.models.UserInfo + :param liftr_resource_category: Possible values include: 'Unknown', + 'MonitorLogs' + :type liftr_resource_category: str or + ~azure.mgmt.datadog.models.LiftrResourceCategories + :ivar liftr_resource_preference: The priority of the resource. + :vartype liftr_resource_preference: int + """ + + _validation = { + 'liftr_resource_preference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, + 'datadog_organization_properties': {'key': 'datadogOrganizationProperties', 'type': 'DatadogOrganizationProperties'}, + 'user_info': {'key': 'userInfo', 'type': 'UserInfo'}, + 'liftr_resource_category': {'key': 'liftrResourceCategory', 'type': 'str'}, + 'liftr_resource_preference': {'key': 'liftrResourcePreference', 'type': 'int'}, + } + + def __init__(self, *, provisioning_state=None, monitoring_status=None, marketplace_subscription_status=None, datadog_organization_properties=None, user_info=None, liftr_resource_category=None, **kwargs) -> None: + super(MonitorProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.monitoring_status = monitoring_status + self.marketplace_subscription_status = marketplace_subscription_status + self.datadog_organization_properties = datadog_organization_properties + self.user_info = user_info + self.liftr_resource_category = liftr_resource_category + self.liftr_resource_preference = None + + +class MonitorUpdateProperties(Model): + """The set of properties that can be update in a PATCH request to a monitor + resource. + + :param monitoring_status: Possible values include: 'Enabled', 'Disabled' + :type monitoring_status: str or + ~azure.mgmt.datadog.models.MonitoringStatus + """ + + _attribute_map = { + 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, + } + + def __init__(self, *, monitoring_status=None, **kwargs) -> None: + super(MonitorUpdateProperties, self).__init__(**kwargs) + self.monitoring_status = monitoring_status + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider, i.e., Microsoft.Datadog. + :type provider: str + :param resource: Type on which the operation is performed, e.g., + 'monitors'. + :type resource: str + :param operation: Operation type, e.g., read, write, delete, etc. + :type operation: str + :param description: Description of the operation, e.g., 'Write monitors'. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationResult(Model): + """A Microsoft.Datadog REST API operation. + + :param name: Operation name, i.e., {provider}/{resource}/{operation}. + :type name: str + :param display: + :type display: ~azure.mgmt.datadog.models.OperationDisplay + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display=None, is_data_action: bool=None, **kwargs) -> None: + super(OperationResult, self).__init__(**kwargs) + self.name = name + self.display = display + self.is_data_action = is_data_action + + +class ResourceProviderDefaultErrorResponse(Model): + """ResourceProviderDefaultErrorResponse. + + :param error: + :type error: ~azure.mgmt.datadog.models.ErrorResponseBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ResourceProviderDefaultErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ResourceProviderDefaultErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ResourceProviderDefaultErrorResponseException, self).__init__(deserialize, response, 'ResourceProviderDefaultErrorResponse', *args) + + +class ResourceSku(Model): + """ResourceSku. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the SKU. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.name = name + + +class UserInfo(Model): + """User info. + + :param name: Name of the user + :type name: str + :param email_address: Email of the user used by Datadog for contacting + them if needed + :type email_address: str + :param phone_number: Phone number of the user used by Datadog for + contacting them if needed + :type phone_number: str + """ + + _validation = { + 'name': {'max_length': 50}, + 'email_address': {'pattern': r'^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}$'}, + 'phone_number': {'max_length': 40}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, email_address: str=None, phone_number: str=None, **kwargs) -> None: + super(UserInfo, self).__init__(**kwargs) + self.name = name + self.email_address = email_address + self.phone_number = phone_number diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_paged_models.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_paged_models.py new file mode 100644 index 000000000000..770e6726bc0e --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/models/_paged_models.py @@ -0,0 +1,131 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DatadogAgreementResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`DatadogAgreementResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatadogAgreementResource]'} + } + + def __init__(self, *args, **kwargs): + + super(DatadogAgreementResourcePaged, self).__init__(*args, **kwargs) +class DatadogApiKeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`DatadogApiKey ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatadogApiKey]'} + } + + def __init__(self, *args, **kwargs): + + super(DatadogApiKeyPaged, self).__init__(*args, **kwargs) +class DatadogHostPaged(Paged): + """ + A paging container for iterating over a list of :class:`DatadogHost ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatadogHost]'} + } + + def __init__(self, *args, **kwargs): + + super(DatadogHostPaged, self).__init__(*args, **kwargs) +class LinkedResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`LinkedResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LinkedResource]'} + } + + def __init__(self, *args, **kwargs): + + super(LinkedResourcePaged, self).__init__(*args, **kwargs) +class MonitoredResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`MonitoredResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MonitoredResource]'} + } + + def __init__(self, *args, **kwargs): + + super(MonitoredResourcePaged, self).__init__(*args, **kwargs) +class OperationResultPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationResult ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationResult]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationResultPaged, self).__init__(*args, **kwargs) +class DatadogMonitorResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`DatadogMonitorResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatadogMonitorResource]'} + } + + def __init__(self, *args, **kwargs): + + super(DatadogMonitorResourcePaged, self).__init__(*args, **kwargs) +class MonitoringTagRulesPaged(Paged): + """ + A paging container for iterating over a list of :class:`MonitoringTagRules ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MonitoringTagRules]'} + } + + def __init__(self, *args, **kwargs): + + super(MonitoringTagRulesPaged, self).__init__(*args, **kwargs) +class DatadogSingleSignOnResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`DatadogSingleSignOnResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatadogSingleSignOnResource]'} + } + + def __init__(self, *args, **kwargs): + + super(DatadogSingleSignOnResourcePaged, self).__init__(*args, **kwargs) diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/__init__.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/__init__.py new file mode 100644 index 000000000000..67eca1a9fadf --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/__init__.py @@ -0,0 +1,34 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._marketplace_agreements_operations import MarketplaceAgreementsOperations +from ._api_keys_operations import ApiKeysOperations +from ._hosts_operations import HostsOperations +from ._linked_resources_operations import LinkedResourcesOperations +from ._monitored_resources_operations import MonitoredResourcesOperations +from ._operations import Operations +from ._monitors_operations import MonitorsOperations +from ._refresh_set_password_operations import RefreshSetPasswordOperations +from ._tag_rules_operations import TagRulesOperations +from ._single_sign_on_configurations_operations import SingleSignOnConfigurationsOperations + +__all__ = [ + 'MarketplaceAgreementsOperations', + 'ApiKeysOperations', + 'HostsOperations', + 'LinkedResourcesOperations', + 'MonitoredResourcesOperations', + 'Operations', + 'MonitorsOperations', + 'RefreshSetPasswordOperations', + 'TagRulesOperations', + 'SingleSignOnConfigurationsOperations', +] diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_api_keys_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_api_keys_operations.py new file mode 100644 index 000000000000..6f4a748c991b --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_api_keys_operations.py @@ -0,0 +1,234 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiKeysOperations(object): + """ApiKeysOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List the api keys for a given monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatadogApiKey + :rtype: + ~azure.mgmt.datadog.models.DatadogApiKeyPaged[~azure.mgmt.datadog.models.DatadogApiKey] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatadogApiKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys'} + + def get_default_key( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """Get the default api key. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatadogApiKey or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.DatadogApiKey or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # Construct URL + url = self.get_default_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatadogApiKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_default_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey'} + + def set_default_key( + self, resource_group_name, monitor_name, body=None, custom_headers=None, raw=False, **operation_config): + """Set the default api key. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param body: + :type body: ~azure.mgmt.datadog.models.DatadogApiKey + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # Construct URL + url = self.set_default_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'DatadogApiKey') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + set_default_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_hosts_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_hosts_operations.py new file mode 100644 index 000000000000..2811d6b24530 --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_hosts_operations.py @@ -0,0 +1,111 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class HostsOperations(object): + """HostsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List the hosts for a given monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatadogHost + :rtype: + ~azure.mgmt.datadog.models.DatadogHostPaged[~azure.mgmt.datadog.models.DatadogHost] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatadogHostPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_linked_resources_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_linked_resources_operations.py new file mode 100644 index 000000000000..22553a797441 --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_linked_resources_operations.py @@ -0,0 +1,112 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class LinkedResourcesOperations(object): + """LinkedResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List all Azure resources associated to the same Datadog organization as + the target resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LinkedResource + :rtype: + ~azure.mgmt.datadog.models.LinkedResourcePaged[~azure.mgmt.datadog.models.LinkedResource] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LinkedResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_marketplace_agreements_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_marketplace_agreements_operations.py new file mode 100644 index 000000000000..67135d6e26be --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_marketplace_agreements_operations.py @@ -0,0 +1,168 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class MarketplaceAgreementsOperations(object): + """MarketplaceAgreementsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List Datadog marketplace agreements in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatadogAgreementResource + :rtype: + ~azure.mgmt.datadog.models.DatadogAgreementResourcePaged[~azure.mgmt.datadog.models.DatadogAgreementResource] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatadogAgreementResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'} + + def create( + self, properties=None, custom_headers=None, raw=False, **operation_config): + """Create Datadog marketplace agreement in the subscription. + + :param properties: Represents the properties of the resource. + :type properties: + ~azure.mgmt.datadog.models.DatadogAgreementProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatadogAgreementResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.DatadogAgreementResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + body = None + if properties is not None: + body = models.DatadogAgreementResource(properties=properties) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'DatadogAgreementResource') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatadogAgreementResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitored_resources_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitored_resources_operations.py new file mode 100644 index 000000000000..483bf7693578 --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitored_resources_operations.py @@ -0,0 +1,112 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class MonitoredResourcesOperations(object): + """MonitoredResourcesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List the resources currently being monitored by the Datadog monitor + resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of MonitoredResource + :rtype: + ~azure.mgmt.datadog.models.MonitoredResourcePaged[~azure.mgmt.datadog.models.MonitoredResource] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.MonitoredResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitors_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitors_operations.py new file mode 100644 index 000000000000..04d64c47de0a --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_monitors_operations.py @@ -0,0 +1,496 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class MonitorsOperations(object): + """MonitorsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all monitors under the specified subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatadogMonitorResource + :rtype: + ~azure.mgmt.datadog.models.DatadogMonitorResourcePaged[~azure.mgmt.datadog.models.DatadogMonitorResource] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatadogMonitorResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List all monitors under the specified resource group. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatadogMonitorResource + :rtype: + ~azure.mgmt.datadog.models.DatadogMonitorResourcePaged[~azure.mgmt.datadog.models.DatadogMonitorResource] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatadogMonitorResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors'} + + def get( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """Get the properties of a specific monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatadogMonitorResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.DatadogMonitorResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatadogMonitorResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} + + + def _create_initial( + self, resource_group_name, monitor_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'DatadogMonitorResource') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatadogMonitorResource', response) + if response.status_code == 201: + deserialized = self._deserialize('DatadogMonitorResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, monitor_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param body: + :type body: ~azure.mgmt.datadog.models.DatadogMonitorResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DatadogMonitorResource + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datadog.models.DatadogMonitorResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datadog.models.DatadogMonitorResource]] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DatadogMonitorResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} + + def update( + self, resource_group_name, monitor_name, properties=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Update a monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param properties: + :type properties: ~azure.mgmt.datadog.models.MonitorUpdateProperties + :param tags: The new tags of the monitor resource. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatadogMonitorResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.DatadogMonitorResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + body = None + if properties is not None or tags is not None: + body = models.DatadogMonitorResourceUpdateParameters(properties=properties, tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'DatadogMonitorResourceUpdateParameters') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatadogMonitorResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} + + + def _delete_initial( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_operations.py new file mode 100644 index 000000000000..78782f0f363b --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_operations.py @@ -0,0 +1,101 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all operations provided by Microsoft.Datadog for the + 2020-02-01-preview api version. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of OperationResult + :rtype: + ~azure.mgmt.datadog.models.OperationResultPaged[~azure.mgmt.datadog.models.OperationResult] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationResultPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Datadog/operations'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_refresh_set_password_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_refresh_set_password_operations.py new file mode 100644 index 000000000000..58834c6d1739 --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_refresh_set_password_operations.py @@ -0,0 +1,100 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class RefreshSetPasswordOperations(object): + """RefreshSetPasswordOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """Refresh the set password link and return a latest one. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatadogSetPasswordLink or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.DatadogSetPasswordLink or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatadogSetPasswordLink', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_single_sign_on_configurations_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_single_sign_on_configurations_operations.py new file mode 100644 index 000000000000..c1155b02537a --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_single_sign_on_configurations_operations.py @@ -0,0 +1,292 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class SingleSignOnConfigurationsOperations(object): + """SingleSignOnConfigurationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List the single sign-on configurations for a given monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatadogSingleSignOnResource + :rtype: + ~azure.mgmt.datadog.models.DatadogSingleSignOnResourcePaged[~azure.mgmt.datadog.models.DatadogSingleSignOnResource] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatadogSingleSignOnResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations'} + + + def _create_or_update_initial( + self, resource_group_name, monitor_name, configuration_name, properties=None, custom_headers=None, raw=False, **operation_config): + body = None + if properties is not None: + body = models.DatadogSingleSignOnResource(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'DatadogSingleSignOnResource') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DatadogSingleSignOnResource', response) + if response.status_code == 201: + deserialized = self._deserialize('DatadogSingleSignOnResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, monitor_name, configuration_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Configures single-sign-on for this resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param configuration_name: Configuration name + :type configuration_name: str + :param properties: + :type properties: + ~azure.mgmt.datadog.models.DatadogSingleSignOnProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + DatadogSingleSignOnResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.datadog.models.DatadogSingleSignOnResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.datadog.models.DatadogSingleSignOnResource]] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + monitor_name=monitor_name, + configuration_name=configuration_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DatadogSingleSignOnResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'} + + def get( + self, resource_group_name, monitor_name, configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets the datadog single sign-on resource for the given Monitor. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param configuration_name: Configuration name + :type configuration_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatadogSingleSignOnResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.DatadogSingleSignOnResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatadogSingleSignOnResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_tag_rules_operations.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_tag_rules_operations.py new file mode 100644 index 000000000000..79da19dde923 --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_tag_rules_operations.py @@ -0,0 +1,253 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TagRulesOperations(object): + """TagRulesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List the tag rules for a given monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of MonitoringTagRules + :rtype: + ~azure.mgmt.datadog.models.MonitoringTagRulesPaged[~azure.mgmt.datadog.models.MonitoringTagRules] + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.MonitoringTagRulesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules'} + + def create_or_update( + self, resource_group_name, monitor_name, rule_set_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Create or update a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param rule_set_name: Rule set name + :type rule_set_name: str + :param properties: + :type properties: + ~azure.mgmt.datadog.models.MonitoringTagRulesProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: MonitoringTagRules or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.MonitoringTagRules or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + body = None + if properties is not None: + body = models.MonitoringTagRules(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'MonitoringTagRules') + else: + body_content = None + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringTagRules', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'} + + def get( + self, resource_group_name, monitor_name, rule_set_name, custom_headers=None, raw=False, **operation_config): + """Get a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which + the Datadog resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param rule_set_name: Rule set name + :type rule_set_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: MonitoringTagRules or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datadog.models.MonitoringTagRules or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), + 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ResourceProviderDefaultErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MonitoringTagRules', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'} diff --git a/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/version.py b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/version.py new file mode 100644 index 000000000000..a39916c162ce --- /dev/null +++ b/sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0" +