diff --git a/sdk/elastic/azure-mgmt-elastic/CHANGELOG.md b/sdk/elastic/azure-mgmt-elastic/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/elastic/azure-mgmt-elastic/MANIFEST.in b/sdk/elastic/azure-mgmt-elastic/MANIFEST.in new file mode 100644 index 000000000000..3a9b6517412b --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/MANIFEST.in @@ -0,0 +1,6 @@ +include _meta.json +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/elastic/azure-mgmt-elastic/README.md b/sdk/elastic/azure-mgmt-elastic/README.md new file mode 100644 index 000000000000..429b22a3e5d2 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/README.md @@ -0,0 +1,27 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-elastic%2FREADME.png) diff --git a/sdk/elastic/azure-mgmt-elastic/_meta.json b/sdk/elastic/azure-mgmt-elastic/_meta.json new file mode 100644 index 000000000000..0c353df4e59f --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "56bdb96dcd64e4ba216c3b289a483e26802c6fef", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/elastic/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/elastic/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/elastic/azure-mgmt-elastic/azure/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/__init__.py new file mode 100644 index 000000000000..dd67981dd7b8 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/__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 MicrosoftElasticConfiguration +from ._microsoft_elastic import MicrosoftElastic +__all__ = ['MicrosoftElastic', 'MicrosoftElasticConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_configuration.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_configuration.py new file mode 100644 index 000000000000..1f5e28d4d735 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_configuration.py @@ -0,0 +1,49 @@ +# 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 MicrosoftElasticConfiguration(AzureConfiguration): + """Configuration for MicrosoftElastic + 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 Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :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(MicrosoftElasticConfiguration, 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-elastic/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py new file mode 100644 index 000000000000..824012ad40c4 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py @@ -0,0 +1,85 @@ +# 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 MicrosoftElasticConfiguration +from .operations import Operations +from .operations import MonitorsOperations +from .operations import MonitoredResourcesOperations +from .operations import DeploymentInfoOperations +from .operations import TagRulesOperations +from .operations import VMHostOperations +from .operations import VMIngestionOperations +from .operations import VMCollectionOperations +from . import models + + +class MicrosoftElastic(SDKClient): + """MicrosoftElastic + + :ivar config: Configuration for client. + :vartype config: MicrosoftElasticConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.elastic.operations.Operations + :ivar monitors: Monitors operations + :vartype monitors: azure.mgmt.elastic.operations.MonitorsOperations + :ivar monitored_resources: MonitoredResources operations + :vartype monitored_resources: azure.mgmt.elastic.operations.MonitoredResourcesOperations + :ivar deployment_info: DeploymentInfo operations + :vartype deployment_info: azure.mgmt.elastic.operations.DeploymentInfoOperations + :ivar tag_rules: TagRules operations + :vartype tag_rules: azure.mgmt.elastic.operations.TagRulesOperations + :ivar vm_host: VMHost operations + :vartype vm_host: azure.mgmt.elastic.operations.VMHostOperations + :ivar vm_ingestion: VMIngestion operations + :vartype vm_ingestion: azure.mgmt.elastic.operations.VMIngestionOperations + :ivar vm_collection: VMCollection operations + :vartype vm_collection: azure.mgmt.elastic.operations.VMCollectionOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = MicrosoftElasticConfiguration(credentials, subscription_id, base_url) + super(MicrosoftElastic, 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-07-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.monitors = MonitorsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.monitored_resources = MonitoredResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.deployment_info = DeploymentInfoOperations( + self._client, self.config, self._serialize, self._deserialize) + self.tag_rules = TagRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.vm_host = VMHostOperations( + self._client, self.config, self._serialize, self._deserialize) + self.vm_ingestion = VMIngestionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.vm_collection = VMCollectionOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/__init__.py new file mode 100644 index 000000000000..9499e1939352 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/__init__.py @@ -0,0 +1,118 @@ +# 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 CompanyInfo + from ._models_py3 import DeploymentInfoResponse + from ._models_py3 import ElasticCloudDeployment + from ._models_py3 import ElasticCloudUser + from ._models_py3 import ElasticMonitorResource + from ._models_py3 import ElasticMonitorResourceUpdateParameters + from ._models_py3 import ElasticProperties + from ._models_py3 import ErrorResponseBody + from ._models_py3 import FilteringTag + from ._models_py3 import IdentityProperties + from ._models_py3 import LogRules + from ._models_py3 import MonitoredResource + from ._models_py3 import MonitoringTagRules + from ._models_py3 import MonitoringTagRulesProperties + from ._models_py3 import MonitorProperties + 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 SystemData + from ._models_py3 import UserInfo + from ._models_py3 import VMCollectionUpdate + from ._models_py3 import VMIngestionDetailsResponse + from ._models_py3 import VMResources +except (SyntaxError, ImportError): + from ._models import CompanyInfo + from ._models import DeploymentInfoResponse + from ._models import ElasticCloudDeployment + from ._models import ElasticCloudUser + from ._models import ElasticMonitorResource + from ._models import ElasticMonitorResourceUpdateParameters + from ._models import ElasticProperties + from ._models import ErrorResponseBody + from ._models import FilteringTag + from ._models import IdentityProperties + from ._models import LogRules + from ._models import MonitoredResource + from ._models import MonitoringTagRules + from ._models import MonitoringTagRulesProperties + from ._models import MonitorProperties + from ._models import OperationDisplay + from ._models import OperationResult + from ._models import ResourceProviderDefaultErrorResponse, ResourceProviderDefaultErrorResponseException + from ._models import ResourceSku + from ._models import SystemData + from ._models import UserInfo + from ._models import VMCollectionUpdate + from ._models import VMIngestionDetailsResponse + from ._models import VMResources +from ._paged_models import ElasticMonitorResourcePaged +from ._paged_models import MonitoredResourcePaged +from ._paged_models import MonitoringTagRulesPaged +from ._paged_models import OperationResultPaged +from ._paged_models import VMResourcesPaged +from ._microsoft_elastic_enums import ( + ProvisioningState, + MonitoringStatus, + LiftrResourceCategories, + ManagedIdentityTypes, + CreatedByType, + SendingLogs, + TagAction, + ElasticDeploymentStatus, + OperationName, +) + +__all__ = [ + 'CompanyInfo', + 'DeploymentInfoResponse', + 'ElasticCloudDeployment', + 'ElasticCloudUser', + 'ElasticMonitorResource', + 'ElasticMonitorResourceUpdateParameters', + 'ElasticProperties', + 'ErrorResponseBody', + 'FilteringTag', + 'IdentityProperties', + 'LogRules', + 'MonitoredResource', + 'MonitoringTagRules', + 'MonitoringTagRulesProperties', + 'MonitorProperties', + 'OperationDisplay', + 'OperationResult', + 'ResourceProviderDefaultErrorResponse', 'ResourceProviderDefaultErrorResponseException', + 'ResourceSku', + 'SystemData', + 'UserInfo', + 'VMCollectionUpdate', + 'VMIngestionDetailsResponse', + 'VMResources', + 'OperationResultPaged', + 'ElasticMonitorResourcePaged', + 'MonitoredResourcePaged', + 'MonitoringTagRulesPaged', + 'VMResourcesPaged', + 'ProvisioningState', + 'MonitoringStatus', + 'LiftrResourceCategories', + 'ManagedIdentityTypes', + 'CreatedByType', + 'SendingLogs', + 'TagAction', + 'ElasticDeploymentStatus', + 'OperationName', +] diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_microsoft_elastic_enums.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_microsoft_elastic_enums.py new file mode 100644 index 000000000000..4d61890cd7b7 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_microsoft_elastic_enums.py @@ -0,0 +1,74 @@ +# 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 LiftrResourceCategories(str, Enum): + + unknown = "Unknown" + monitor_logs = "MonitorLogs" + + +class ManagedIdentityTypes(str, Enum): + + system_assigned = "SystemAssigned" + + +class CreatedByType(str, Enum): + + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class SendingLogs(str, Enum): + + true = "True" + false = "False" + + +class TagAction(str, Enum): + + include = "Include" + exclude = "Exclude" + + +class ElasticDeploymentStatus(str, Enum): + + healthy = "Healthy" + unhealthy = "Unhealthy" + + +class OperationName(str, Enum): + + add = "Add" + delete = "Delete" diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models.py new file mode 100644 index 000000000000..42fef8d93b10 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models.py @@ -0,0 +1,813 @@ +# 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 CompanyInfo(Model): + """Company information of the user to be passed to partners. + + :param domain: Domain of the company + :type domain: str + :param business: Business of the company + :type business: str + :param employees_number: Number of employees in the company + :type employees_number: str + :param state: State of the company location. + :type state: str + :param country: Country of the company location. + :type country: str + """ + + _validation = { + 'domain': {'max_length': 250}, + 'business': {'max_length': 50}, + 'employees_number': {'max_length': 20}, + 'state': {'max_length': 50}, + 'country': {'max_length': 50}, + } + + _attribute_map = { + 'domain': {'key': 'domain', 'type': 'str'}, + 'business': {'key': 'business', 'type': 'str'}, + 'employees_number': {'key': 'employeesNumber', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CompanyInfo, self).__init__(**kwargs) + self.domain = kwargs.get('domain', None) + self.business = kwargs.get('business', None) + self.employees_number = kwargs.get('employees_number', None) + self.state = kwargs.get('state', None) + self.country = kwargs.get('country', None) + + +class DeploymentInfoResponse(Model): + """The properties of deployment in Elastic cloud corresponding to the Elastic + monitor resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The Elastic deployment status. Possible values include: + 'Healthy', 'Unhealthy' + :vartype status: str or ~azure.mgmt.elastic.models.ElasticDeploymentStatus + :ivar version: Version of the elasticsearch in Elastic cloud deployment. + :vartype version: str + :ivar memory_capacity: RAM capacity of the elasticsearch in Elastic cloud + deployment. + :vartype memory_capacity: str + :ivar disk_capacity: Disk capacity of the elasticsearch in Elastic cloud + deployment. + :vartype disk_capacity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'version': {'readonly': True}, + 'memory_capacity': {'readonly': True}, + 'disk_capacity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'memory_capacity': {'key': 'memoryCapacity', 'type': 'str'}, + 'disk_capacity': {'key': 'diskCapacity', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentInfoResponse, self).__init__(**kwargs) + self.status = None + self.version = None + self.memory_capacity = None + self.disk_capacity = None + + +class ElasticCloudDeployment(Model): + """Details of the user's elastic deployment associated with the monitor + resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Elastic deployment name + :vartype name: str + :ivar deployment_id: Elastic deployment Id + :vartype deployment_id: str + :ivar azure_subscription_id: Associated Azure subscription Id for the + elastic deployment. + :vartype azure_subscription_id: str + :ivar elasticsearch_region: Region where Deployment at Elastic side took + place. + :vartype elasticsearch_region: str + :ivar elasticsearch_service_url: Elasticsearch ingestion endpoint of the + Elastic deployment. + :vartype elasticsearch_service_url: str + :ivar kibana_service_url: Kibana endpoint of the Elastic deployment. + :vartype kibana_service_url: str + :ivar kibana_sso_url: Kibana dashboard sso URL of the Elastic deployment. + :vartype kibana_sso_url: str + """ + + _validation = { + 'name': {'readonly': True}, + 'deployment_id': {'readonly': True}, + 'azure_subscription_id': {'readonly': True}, + 'elasticsearch_region': {'readonly': True}, + 'elasticsearch_service_url': {'readonly': True}, + 'kibana_service_url': {'readonly': True}, + 'kibana_sso_url': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, + 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, + 'elasticsearch_region': {'key': 'elasticsearchRegion', 'type': 'str'}, + 'elasticsearch_service_url': {'key': 'elasticsearchServiceUrl', 'type': 'str'}, + 'kibana_service_url': {'key': 'kibanaServiceUrl', 'type': 'str'}, + 'kibana_sso_url': {'key': 'kibanaSsoUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ElasticCloudDeployment, self).__init__(**kwargs) + self.name = None + self.deployment_id = None + self.azure_subscription_id = None + self.elasticsearch_region = None + self.elasticsearch_service_url = None + self.kibana_service_url = None + self.kibana_sso_url = None + + +class ElasticCloudUser(Model): + """Details of the user's elastic account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar email_address: Email of the Elastic User Account. + :vartype email_address: str + :ivar id: User Id of the elastic account of the User. + :vartype id: str + :ivar elastic_cloud_sso_default_url: Elastic cloud default dashboard sso + URL of the Elastic user account. + :vartype elastic_cloud_sso_default_url: str + """ + + _validation = { + 'email_address': {'readonly': True}, + 'id': {'readonly': True}, + 'elastic_cloud_sso_default_url': {'readonly': True}, + } + + _attribute_map = { + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'elastic_cloud_sso_default_url': {'key': 'elasticCloudSsoDefaultUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ElasticCloudUser, self).__init__(**kwargs) + self.email_address = None + self.id = None + self.elastic_cloud_sso_default_url = None + + +class ElasticMonitorResource(Model): + """Monitor resource. + + 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: SKU of the monitor resource. + :type sku: ~azure.mgmt.elastic.models.ResourceSku + :param properties: Properties of the monitor resource. + :type properties: ~azure.mgmt.elastic.models.MonitorProperties + :param identity: Identity properties of the monitor resource. + :type identity: ~azure.mgmt.elastic.models.IdentityProperties + :param tags: The tags of the monitor resource. + :type tags: dict[str, str] + :param location: Required. The location of the monitor resource + :type location: str + :ivar system_data: The system metadata relating to this resource + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': 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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(ElasticMonitorResource, 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) + self.system_data = None + + +class ElasticMonitorResourceUpdateParameters(Model): + """Monitor resource update parameters. + + :param tags: elastic monitor resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ElasticMonitorResourceUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ElasticProperties(Model): + """Elastic Resource Properties. + + :param elastic_cloud_user: Details of the user's elastic account. + :type elastic_cloud_user: ~azure.mgmt.elastic.models.ElasticCloudUser + :param elastic_cloud_deployment: Details of the elastic cloud deployment. + :type elastic_cloud_deployment: + ~azure.mgmt.elastic.models.ElasticCloudDeployment + """ + + _attribute_map = { + 'elastic_cloud_user': {'key': 'elasticCloudUser', 'type': 'ElasticCloudUser'}, + 'elastic_cloud_deployment': {'key': 'elasticCloudDeployment', 'type': 'ElasticCloudDeployment'}, + } + + def __init__(self, **kwargs): + super(ElasticProperties, self).__init__(**kwargs) + self.elastic_cloud_user = kwargs.get('elastic_cloud_user', None) + self.elastic_cloud_deployment = kwargs.get('elastic_cloud_deployment', None) + + +class ErrorResponseBody(Model): + """ErrorResponseBody. + + Error response body. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :param target: Error target. + :type target: str + :param details: Error details. + :type details: list[~azure.mgmt.elastic.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: Valid actions for a filtering tag. Possible values include: + 'Include', 'Exclude' + :type action: str or ~azure.mgmt.elastic.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): + """Identity properties. + + 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: Managed identity type. Possible values include: + 'SystemAssigned' + :type type: str or ~azure.mgmt.elastic.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 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 subscription logs should + be sent for the Monitor resource. + :type send_subscription_logs: bool + :param send_activity_logs: Flag specifying if activity logs from Azure + resources should be sent for the Monitor resource. + :type send_activity_logs: bool + :param filtering_tags: List of filtering tags to be used for capturing + logs. This only takes effect if SendActivityLogs 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.elastic.models.FilteringTag] + """ + + _attribute_map = { + 'send_aad_logs': {'key': 'sendAadLogs', 'type': 'bool'}, + 'send_subscription_logs': {'key': 'sendSubscriptionLogs', 'type': 'bool'}, + 'send_activity_logs': {'key': 'sendActivityLogs', '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_activity_logs = kwargs.get('send_activity_logs', None) + self.filtering_tags = kwargs.get('filtering_tags', None) + + +class MonitoredResource(Model): + """The properties of a resource currently being monitored by the Elastic + monitor resource. + + :param id: The ARM id of the resource. + :type id: str + :param sending_logs: Flag indicating the status of the resource for + sending logs operation to Elastic. Possible values include: 'True', + 'False' + :type sending_logs: str or ~azure.mgmt.elastic.models.SendingLogs + :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_logs': {'key': 'sendingLogs', 'type': 'str'}, + '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_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: Properties of the monitoring tag rules. + :type properties: ~azure.mgmt.elastic.models.MonitoringTagRulesProperties + :ivar system_data: The system metadata relating to this resource + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringTagRulesProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, **kwargs): + super(MonitoringTagRules, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = kwargs.get('properties', None) + self.system_data = None + + +class MonitoringTagRulesProperties(Model): + """Definition of the properties for a TagRules resource. + + :param provisioning_state: Provisioning state of the monitoring tag rules. + Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + :type provisioning_state: str or + ~azure.mgmt.elastic.models.ProvisioningState + :param log_rules: Rules for sending logs. + :type log_rules: ~azure.mgmt.elastic.models.LogRules + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'log_rules': {'key': 'logRules', 'type': 'LogRules'}, + } + + def __init__(self, **kwargs): + super(MonitoringTagRulesProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.log_rules = kwargs.get('log_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: Provisioning state of the monitor resource. + Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + :type provisioning_state: str or + ~azure.mgmt.elastic.models.ProvisioningState + :param monitoring_status: Flag specifying if the resource monitoring is + enabled or disabled. Possible values include: 'Enabled', 'Disabled' + :type monitoring_status: str or + ~azure.mgmt.elastic.models.MonitoringStatus + :param elastic_properties: Elastic cloud properties. + :type elastic_properties: ~azure.mgmt.elastic.models.ElasticProperties + :param user_info: User information. + :type user_info: ~azure.mgmt.elastic.models.UserInfo + :param liftr_resource_category: Possible values include: 'Unknown', + 'MonitorLogs' + :type liftr_resource_category: str or + ~azure.mgmt.elastic.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'}, + 'elastic_properties': {'key': 'elasticProperties', 'type': 'ElasticProperties'}, + '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.elastic_properties = kwargs.get('elastic_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 OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider, i.e., Microsoft.Elastic. + :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.Elastic REST API operation. + + :param name: Operation name, i.e., {provider}/{resource}/{operation}. + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: The object that represents the operation. + :type display: ~azure.mgmt.elastic.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationResult, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + + +class ResourceProviderDefaultErrorResponse(Model): + """RP default error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: Response body of Error + :vartype error: ~azure.mgmt.elastic.models.ErrorResponseBody + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.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): + """Microsoft.Elastic SKU. + + 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 SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.elastic.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.elastic.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class UserInfo(Model): + """User Information to be passed to partners. + + :param first_name: First name of the user + :type first_name: str + :param last_name: Last name of the user + :type last_name: str + :param company_name: Company name of the user + :type company_name: str + :param email_address: Email of the user used by Elastic for contacting + them if needed + :type email_address: str + :param company_info: Company information of the user to be passed to + partners. + :type company_info: ~azure.mgmt.elastic.models.CompanyInfo + """ + + _validation = { + 'first_name': {'max_length': 50}, + 'last_name': {'max_length': 50}, + 'company_name': {'max_length': 50}, + 'email_address': {'pattern': r'^([^<>()\[\]\.,;:\s@"]+(\.[^<>()\[\]\.,;:\s@"]+)*)@(([a-zA-Z-_0-9]+\.)+[a-zA-Z]{2,})$'}, + } + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'company_info': {'key': 'companyInfo', 'type': 'CompanyInfo'}, + } + + def __init__(self, **kwargs): + super(UserInfo, self).__init__(**kwargs) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.company_name = kwargs.get('company_name', None) + self.email_address = kwargs.get('email_address', None) + self.company_info = kwargs.get('company_info', None) + + +class VMCollectionUpdate(Model): + """Update VM resource collection. + + :param vm_resource_id: ARM id of the VM resource. + :type vm_resource_id: str + :param operation_name: Operation to be performed for given VM. Possible + values include: 'Add', 'Delete' + :type operation_name: str or ~azure.mgmt.elastic.models.OperationName + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VMCollectionUpdate, self).__init__(**kwargs) + self.vm_resource_id = kwargs.get('vm_resource_id', None) + self.operation_name = kwargs.get('operation_name', None) + + +class VMIngestionDetailsResponse(Model): + """The vm ingestion details to install an agent. + + :param cloud_id: The cloudId of given Elastic monitor resource. + :type cloud_id: str + :param ingestion_key: Ingestion details to install agent on given VM. + :type ingestion_key: str + """ + + _attribute_map = { + 'cloud_id': {'key': 'cloudId', 'type': 'str'}, + 'ingestion_key': {'key': 'ingestionKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VMIngestionDetailsResponse, self).__init__(**kwargs) + self.cloud_id = kwargs.get('cloud_id', None) + self.ingestion_key = kwargs.get('ingestion_key', None) + + +class VMResources(Model): + """The vm resource properties that is currently being monitored by the Elastic + monitor resource. + + :param vm_resource_id: The ARM id of the VM resource. + :type vm_resource_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VMResources, self).__init__(**kwargs) + self.vm_resource_id = kwargs.get('vm_resource_id', None) diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models_py3.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models_py3.py new file mode 100644 index 000000000000..1494117c93f1 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_models_py3.py @@ -0,0 +1,813 @@ +# 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 CompanyInfo(Model): + """Company information of the user to be passed to partners. + + :param domain: Domain of the company + :type domain: str + :param business: Business of the company + :type business: str + :param employees_number: Number of employees in the company + :type employees_number: str + :param state: State of the company location. + :type state: str + :param country: Country of the company location. + :type country: str + """ + + _validation = { + 'domain': {'max_length': 250}, + 'business': {'max_length': 50}, + 'employees_number': {'max_length': 20}, + 'state': {'max_length': 50}, + 'country': {'max_length': 50}, + } + + _attribute_map = { + 'domain': {'key': 'domain', 'type': 'str'}, + 'business': {'key': 'business', 'type': 'str'}, + 'employees_number': {'key': 'employeesNumber', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'country': {'key': 'country', 'type': 'str'}, + } + + def __init__(self, *, domain: str=None, business: str=None, employees_number: str=None, state: str=None, country: str=None, **kwargs) -> None: + super(CompanyInfo, self).__init__(**kwargs) + self.domain = domain + self.business = business + self.employees_number = employees_number + self.state = state + self.country = country + + +class DeploymentInfoResponse(Model): + """The properties of deployment in Elastic cloud corresponding to the Elastic + monitor resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The Elastic deployment status. Possible values include: + 'Healthy', 'Unhealthy' + :vartype status: str or ~azure.mgmt.elastic.models.ElasticDeploymentStatus + :ivar version: Version of the elasticsearch in Elastic cloud deployment. + :vartype version: str + :ivar memory_capacity: RAM capacity of the elasticsearch in Elastic cloud + deployment. + :vartype memory_capacity: str + :ivar disk_capacity: Disk capacity of the elasticsearch in Elastic cloud + deployment. + :vartype disk_capacity: str + """ + + _validation = { + 'status': {'readonly': True}, + 'version': {'readonly': True}, + 'memory_capacity': {'readonly': True}, + 'disk_capacity': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'memory_capacity': {'key': 'memoryCapacity', 'type': 'str'}, + 'disk_capacity': {'key': 'diskCapacity', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentInfoResponse, self).__init__(**kwargs) + self.status = None + self.version = None + self.memory_capacity = None + self.disk_capacity = None + + +class ElasticCloudDeployment(Model): + """Details of the user's elastic deployment associated with the monitor + resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Elastic deployment name + :vartype name: str + :ivar deployment_id: Elastic deployment Id + :vartype deployment_id: str + :ivar azure_subscription_id: Associated Azure subscription Id for the + elastic deployment. + :vartype azure_subscription_id: str + :ivar elasticsearch_region: Region where Deployment at Elastic side took + place. + :vartype elasticsearch_region: str + :ivar elasticsearch_service_url: Elasticsearch ingestion endpoint of the + Elastic deployment. + :vartype elasticsearch_service_url: str + :ivar kibana_service_url: Kibana endpoint of the Elastic deployment. + :vartype kibana_service_url: str + :ivar kibana_sso_url: Kibana dashboard sso URL of the Elastic deployment. + :vartype kibana_sso_url: str + """ + + _validation = { + 'name': {'readonly': True}, + 'deployment_id': {'readonly': True}, + 'azure_subscription_id': {'readonly': True}, + 'elasticsearch_region': {'readonly': True}, + 'elasticsearch_service_url': {'readonly': True}, + 'kibana_service_url': {'readonly': True}, + 'kibana_sso_url': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, + 'azure_subscription_id': {'key': 'azureSubscriptionId', 'type': 'str'}, + 'elasticsearch_region': {'key': 'elasticsearchRegion', 'type': 'str'}, + 'elasticsearch_service_url': {'key': 'elasticsearchServiceUrl', 'type': 'str'}, + 'kibana_service_url': {'key': 'kibanaServiceUrl', 'type': 'str'}, + 'kibana_sso_url': {'key': 'kibanaSsoUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ElasticCloudDeployment, self).__init__(**kwargs) + self.name = None + self.deployment_id = None + self.azure_subscription_id = None + self.elasticsearch_region = None + self.elasticsearch_service_url = None + self.kibana_service_url = None + self.kibana_sso_url = None + + +class ElasticCloudUser(Model): + """Details of the user's elastic account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar email_address: Email of the Elastic User Account. + :vartype email_address: str + :ivar id: User Id of the elastic account of the User. + :vartype id: str + :ivar elastic_cloud_sso_default_url: Elastic cloud default dashboard sso + URL of the Elastic user account. + :vartype elastic_cloud_sso_default_url: str + """ + + _validation = { + 'email_address': {'readonly': True}, + 'id': {'readonly': True}, + 'elastic_cloud_sso_default_url': {'readonly': True}, + } + + _attribute_map = { + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'elastic_cloud_sso_default_url': {'key': 'elasticCloudSsoDefaultUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ElasticCloudUser, self).__init__(**kwargs) + self.email_address = None + self.id = None + self.elastic_cloud_sso_default_url = None + + +class ElasticMonitorResource(Model): + """Monitor resource. + + 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: SKU of the monitor resource. + :type sku: ~azure.mgmt.elastic.models.ResourceSku + :param properties: Properties of the monitor resource. + :type properties: ~azure.mgmt.elastic.models.MonitorProperties + :param identity: Identity properties of the monitor resource. + :type identity: ~azure.mgmt.elastic.models.IdentityProperties + :param tags: The tags of the monitor resource. + :type tags: dict[str, str] + :param location: Required. The location of the monitor resource + :type location: str + :ivar system_data: The system metadata relating to this resource + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': 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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, *, location: str, sku=None, properties=None, identity=None, tags=None, **kwargs) -> None: + super(ElasticMonitorResource, 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 + self.system_data = None + + +class ElasticMonitorResourceUpdateParameters(Model): + """Monitor resource update parameters. + + :param tags: elastic monitor resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ElasticMonitorResourceUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class ElasticProperties(Model): + """Elastic Resource Properties. + + :param elastic_cloud_user: Details of the user's elastic account. + :type elastic_cloud_user: ~azure.mgmt.elastic.models.ElasticCloudUser + :param elastic_cloud_deployment: Details of the elastic cloud deployment. + :type elastic_cloud_deployment: + ~azure.mgmt.elastic.models.ElasticCloudDeployment + """ + + _attribute_map = { + 'elastic_cloud_user': {'key': 'elasticCloudUser', 'type': 'ElasticCloudUser'}, + 'elastic_cloud_deployment': {'key': 'elasticCloudDeployment', 'type': 'ElasticCloudDeployment'}, + } + + def __init__(self, *, elastic_cloud_user=None, elastic_cloud_deployment=None, **kwargs) -> None: + super(ElasticProperties, self).__init__(**kwargs) + self.elastic_cloud_user = elastic_cloud_user + self.elastic_cloud_deployment = elastic_cloud_deployment + + +class ErrorResponseBody(Model): + """ErrorResponseBody. + + Error response body. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + :param target: Error target. + :type target: str + :param details: Error details. + :type details: list[~azure.mgmt.elastic.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: Valid actions for a filtering tag. Possible values include: + 'Include', 'Exclude' + :type action: str or ~azure.mgmt.elastic.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): + """Identity properties. + + 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: Managed identity type. Possible values include: + 'SystemAssigned' + :type type: str or ~azure.mgmt.elastic.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 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 subscription logs should + be sent for the Monitor resource. + :type send_subscription_logs: bool + :param send_activity_logs: Flag specifying if activity logs from Azure + resources should be sent for the Monitor resource. + :type send_activity_logs: bool + :param filtering_tags: List of filtering tags to be used for capturing + logs. This only takes effect if SendActivityLogs 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.elastic.models.FilteringTag] + """ + + _attribute_map = { + 'send_aad_logs': {'key': 'sendAadLogs', 'type': 'bool'}, + 'send_subscription_logs': {'key': 'sendSubscriptionLogs', 'type': 'bool'}, + 'send_activity_logs': {'key': 'sendActivityLogs', 'type': 'bool'}, + 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, + } + + def __init__(self, *, send_aad_logs: bool=None, send_subscription_logs: bool=None, send_activity_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_activity_logs = send_activity_logs + self.filtering_tags = filtering_tags + + +class MonitoredResource(Model): + """The properties of a resource currently being monitored by the Elastic + monitor resource. + + :param id: The ARM id of the resource. + :type id: str + :param sending_logs: Flag indicating the status of the resource for + sending logs operation to Elastic. Possible values include: 'True', + 'False' + :type sending_logs: str or ~azure.mgmt.elastic.models.SendingLogs + :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_logs': {'key': 'sendingLogs', 'type': 'str'}, + 'reason_for_logs_status': {'key': 'reasonForLogsStatus', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, sending_logs=None, reason_for_logs_status: str=None, **kwargs) -> None: + super(MonitoredResource, self).__init__(**kwargs) + self.id = id + 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: Properties of the monitoring tag rules. + :type properties: ~azure.mgmt.elastic.models.MonitoringTagRulesProperties + :ivar system_data: The system metadata relating to this resource + :vartype system_data: ~azure.mgmt.elastic.models.SystemData + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MonitoringTagRulesProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MonitoringTagRules, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + self.properties = properties + self.system_data = None + + +class MonitoringTagRulesProperties(Model): + """Definition of the properties for a TagRules resource. + + :param provisioning_state: Provisioning state of the monitoring tag rules. + Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + :type provisioning_state: str or + ~azure.mgmt.elastic.models.ProvisioningState + :param log_rules: Rules for sending logs. + :type log_rules: ~azure.mgmt.elastic.models.LogRules + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'log_rules': {'key': 'logRules', 'type': 'LogRules'}, + } + + def __init__(self, *, provisioning_state=None, log_rules=None, **kwargs) -> None: + super(MonitoringTagRulesProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.log_rules = log_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: Provisioning state of the monitor resource. + Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', + 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' + :type provisioning_state: str or + ~azure.mgmt.elastic.models.ProvisioningState + :param monitoring_status: Flag specifying if the resource monitoring is + enabled or disabled. Possible values include: 'Enabled', 'Disabled' + :type monitoring_status: str or + ~azure.mgmt.elastic.models.MonitoringStatus + :param elastic_properties: Elastic cloud properties. + :type elastic_properties: ~azure.mgmt.elastic.models.ElasticProperties + :param user_info: User information. + :type user_info: ~azure.mgmt.elastic.models.UserInfo + :param liftr_resource_category: Possible values include: 'Unknown', + 'MonitorLogs' + :type liftr_resource_category: str or + ~azure.mgmt.elastic.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'}, + 'elastic_properties': {'key': 'elasticProperties', 'type': 'ElasticProperties'}, + '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, elastic_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.elastic_properties = elastic_properties + self.user_info = user_info + self.liftr_resource_category = liftr_resource_category + self.liftr_resource_preference = None + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider, i.e., Microsoft.Elastic. + :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.Elastic REST API operation. + + :param name: Operation name, i.e., {provider}/{resource}/{operation}. + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: The object that represents the operation. + :type display: ~azure.mgmt.elastic.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, **kwargs) -> None: + super(OperationResult, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + + +class ResourceProviderDefaultErrorResponse(Model): + """RP default error response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: Response body of Error + :vartype error: ~azure.mgmt.elastic.models.ErrorResponseBody + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.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): + """Microsoft.Elastic SKU. + + 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 SystemData(Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.elastic.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or + ~azure.mgmt.elastic.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class UserInfo(Model): + """User Information to be passed to partners. + + :param first_name: First name of the user + :type first_name: str + :param last_name: Last name of the user + :type last_name: str + :param company_name: Company name of the user + :type company_name: str + :param email_address: Email of the user used by Elastic for contacting + them if needed + :type email_address: str + :param company_info: Company information of the user to be passed to + partners. + :type company_info: ~azure.mgmt.elastic.models.CompanyInfo + """ + + _validation = { + 'first_name': {'max_length': 50}, + 'last_name': {'max_length': 50}, + 'company_name': {'max_length': 50}, + 'email_address': {'pattern': r'^([^<>()\[\]\.,;:\s@"]+(\.[^<>()\[\]\.,;:\s@"]+)*)@(([a-zA-Z-_0-9]+\.)+[a-zA-Z]{2,})$'}, + } + + _attribute_map = { + 'first_name': {'key': 'firstName', 'type': 'str'}, + 'last_name': {'key': 'lastName', 'type': 'str'}, + 'company_name': {'key': 'companyName', 'type': 'str'}, + 'email_address': {'key': 'emailAddress', 'type': 'str'}, + 'company_info': {'key': 'companyInfo', 'type': 'CompanyInfo'}, + } + + def __init__(self, *, first_name: str=None, last_name: str=None, company_name: str=None, email_address: str=None, company_info=None, **kwargs) -> None: + super(UserInfo, self).__init__(**kwargs) + self.first_name = first_name + self.last_name = last_name + self.company_name = company_name + self.email_address = email_address + self.company_info = company_info + + +class VMCollectionUpdate(Model): + """Update VM resource collection. + + :param vm_resource_id: ARM id of the VM resource. + :type vm_resource_id: str + :param operation_name: Operation to be performed for given VM. Possible + values include: 'Add', 'Delete' + :type operation_name: str or ~azure.mgmt.elastic.models.OperationName + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + 'operation_name': {'key': 'operationName', 'type': 'str'}, + } + + def __init__(self, *, vm_resource_id: str=None, operation_name=None, **kwargs) -> None: + super(VMCollectionUpdate, self).__init__(**kwargs) + self.vm_resource_id = vm_resource_id + self.operation_name = operation_name + + +class VMIngestionDetailsResponse(Model): + """The vm ingestion details to install an agent. + + :param cloud_id: The cloudId of given Elastic monitor resource. + :type cloud_id: str + :param ingestion_key: Ingestion details to install agent on given VM. + :type ingestion_key: str + """ + + _attribute_map = { + 'cloud_id': {'key': 'cloudId', 'type': 'str'}, + 'ingestion_key': {'key': 'ingestionKey', 'type': 'str'}, + } + + def __init__(self, *, cloud_id: str=None, ingestion_key: str=None, **kwargs) -> None: + super(VMIngestionDetailsResponse, self).__init__(**kwargs) + self.cloud_id = cloud_id + self.ingestion_key = ingestion_key + + +class VMResources(Model): + """The vm resource properties that is currently being monitored by the Elastic + monitor resource. + + :param vm_resource_id: The ARM id of the VM resource. + :type vm_resource_id: str + """ + + _attribute_map = { + 'vm_resource_id': {'key': 'vmResourceId', 'type': 'str'}, + } + + def __init__(self, *, vm_resource_id: str=None, **kwargs) -> None: + super(VMResources, self).__init__(**kwargs) + self.vm_resource_id = vm_resource_id diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_paged_models.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_paged_models.py new file mode 100644 index 000000000000..44dfa2c5caab --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/models/_paged_models.py @@ -0,0 +1,79 @@ +# 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 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 ElasticMonitorResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ElasticMonitorResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ElasticMonitorResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ElasticMonitorResourcePaged, 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 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 VMResourcesPaged(Paged): + """ + A paging container for iterating over a list of :class:`VMResources ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[VMResources]'} + } + + def __init__(self, *args, **kwargs): + + super(VMResourcesPaged, self).__init__(*args, **kwargs) diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/__init__.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/__init__.py new file mode 100644 index 000000000000..41f1d952d130 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/__init__.py @@ -0,0 +1,30 @@ +# 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 ._operations import Operations +from ._monitors_operations import MonitorsOperations +from ._monitored_resources_operations import MonitoredResourcesOperations +from ._deployment_info_operations import DeploymentInfoOperations +from ._tag_rules_operations import TagRulesOperations +from ._vm_host_operations import VMHostOperations +from ._vm_ingestion_operations import VMIngestionOperations +from ._vm_collection_operations import VMCollectionOperations + +__all__ = [ + 'Operations', + 'MonitorsOperations', + 'MonitoredResourcesOperations', + 'DeploymentInfoOperations', + 'TagRulesOperations', + 'VMHostOperations', + 'VMIngestionOperations', + 'VMCollectionOperations', +] diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_deployment_info_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_deployment_info_operations.py new file mode 100644 index 000000000000..ac5c14b45119 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_deployment_info_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 DeploymentInfoOperations(object): + """DeploymentInfoOperations 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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """Fetch information regarding Elastic cloud deployment corresponding to + the Elastic monitor resource. + + :param resource_group_name: The name of the resource group to which + the Elastic 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: DeploymentInfoResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.elastic.models.DeploymentInfoResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # 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') + + # 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('DeploymentInfoResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listDeploymentInfo'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitored_resources_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitored_resources_operations.py new file mode 100644 index 000000000000..57e2ed43dfb7 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-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 Elastic monitor + resource. + + :param resource_group_name: The name of the resource group to which + the Elastic 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.elastic.models.MonitoredResourcePaged[~azure.mgmt.elastic.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') + + 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.Elastic/monitors/{monitorName}/listMonitoredResources'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitors_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitors_operations.py new file mode 100644 index 000000000000..74f418a10e2c --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_monitors_operations.py @@ -0,0 +1,491 @@ +# 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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-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 ElasticMonitorResource + :rtype: + ~azure.mgmt.elastic.models.ElasticMonitorResourcePaged[~azure.mgmt.elastic.models.ElasticMonitorResource] + :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') + + 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.ElasticMonitorResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Elastic/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 Elastic 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 ElasticMonitorResource + :rtype: + ~azure.mgmt.elastic.models.ElasticMonitorResourcePaged[~azure.mgmt.elastic.models.ElasticMonitorResource] + :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') + + 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.ElasticMonitorResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/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 Elastic 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: ElasticMonitorResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.elastic.models.ElasticMonitorResource 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') + + # 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('ElasticMonitorResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/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') + + # 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, 'ElasticMonitorResource') + 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('ElasticMonitorResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ElasticMonitorResource', 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 Elastic resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param body: Elastic monitor resource model + :type body: ~azure.mgmt.elastic.models.ElasticMonitorResource + :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 ElasticMonitorResource + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.elastic.models.ElasticMonitorResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.elastic.models.ElasticMonitorResource]] + :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('ElasticMonitorResource', 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.Elastic/monitors/{monitorName}'} + + def update( + self, resource_group_name, monitor_name, body=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 Elastic resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param body: Elastic resource model update parameters. + :type body: + ~azure.mgmt.elastic.models.ElasticMonitorResourceUpdateParameters + :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: ElasticMonitorResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.elastic.models.ElasticMonitorResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # 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') + + # 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, 'ElasticMonitorResourceUpdateParameters') + 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('ElasticMonitorResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/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') + + # 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 Elastic 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.Elastic/monitors/{monitorName}'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_operations.py new file mode 100644 index 000000000000..c25d4f2b303d --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_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 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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all operations provided by Microsoft.Elastic. + + :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.elastic.models.OperationResultPaged[~azure.mgmt.elastic.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') + + 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.Elastic/operations'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_tag_rules_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_tag_rules_operations.py new file mode 100644 index 000000000000..0de9d25a0600 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_tag_rules_operations.py @@ -0,0 +1,333 @@ +# 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 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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-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 Elastic 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.elastic.models.MonitoringTagRulesPaged[~azure.mgmt.elastic.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') + + 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.Elastic/monitors/{monitorName}/tagRules'} + + def create_or_update( + self, resource_group_name, monitor_name, rule_set_name, body=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 Elastic resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name + :type rule_set_name: str + :param body: request body of MonitoringTagRules + :type body: ~azure.mgmt.elastic.models.MonitoringTagRules + :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.elastic.models.MonitoringTagRules or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # 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') + + # 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.Elastic/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 Elastic resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource 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.elastic.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') + + # 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.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} + + + def _delete_initial( + self, resource_group_name, monitor_name, rule_set_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'), + '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') + + # 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, rule_set_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a tag rule set for a given monitor resource. + + :param resource_group_name: The name of the resource group to which + the Elastic resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param rule_set_name: Tag Rule Set resource name + :type rule_set_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, + rule_set_name=rule_set_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.Elastic/monitors/{monitorName}/tagRules/{ruleSetName}'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_collection_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_collection_operations.py new file mode 100644 index 000000000000..91b14aadbd65 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_collection_operations.py @@ -0,0 +1,102 @@ +# 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 VMCollectionOperations(object): + """VMCollectionOperations 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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01-preview" + + self.config = config + + def update( + self, resource_group_name, monitor_name, body=None, custom_headers=None, raw=False, **operation_config): + """Update the vm details that will be monitored by the Elastic monitor + resource. + + :param resource_group_name: The name of the resource group to which + the Elastic resource belongs. + :type resource_group_name: str + :param monitor_name: Monitor resource name + :type monitor_name: str + :param body: VM resource Id + :type body: ~azure.mgmt.elastic.models.VMCollectionUpdate + :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.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') + + # 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, 'VMCollectionUpdate') + 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 + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmCollectionUpdate'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_host_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_host_operations.py new file mode 100644 index 000000000000..25fd12908a3d --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_host_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 VMHostOperations(object): + """VMHostOperations 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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01-preview" + + self.config = config + + def list( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List the vm resources currently being monitored by the Elastic monitor + resource. + + :param resource_group_name: The name of the resource group to which + the Elastic 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 VMResources + :rtype: + ~azure.mgmt.elastic.models.VMResourcesPaged[~azure.mgmt.elastic.models.VMResources] + :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') + + 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.VMResourcesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/listVMHost'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_ingestion_operations.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_ingestion_operations.py new file mode 100644 index 000000000000..6c5118a9e1f5 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/operations/_vm_ingestion_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 VMIngestionOperations(object): + """VMIngestionOperations 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 be used with the HTTP request. Constant value: "2020-07-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01-preview" + + self.config = config + + def details( + self, resource_group_name, monitor_name, custom_headers=None, raw=False, **operation_config): + """List the vm ingestion details that will be monitored by the Elastic + monitor resource. + + :param resource_group_name: The name of the resource group to which + the Elastic 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: VMIngestionDetailsResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.elastic.models.VMIngestionDetailsResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ResourceProviderDefaultErrorResponseException` + """ + # Construct URL + url = self.details.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') + + # 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('VMIngestionDetailsResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Elastic/monitors/{monitorName}/vmIngestionDetails'} diff --git a/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/version.py b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/version.py new file mode 100644 index 000000000000..5b5c01b4cf55 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/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 = "2020-07-01-preview" + diff --git a/sdk/elastic/azure-mgmt-elastic/sdk_packaging.toml b/sdk/elastic/azure-mgmt-elastic/sdk_packaging.toml new file mode 100644 index 000000000000..43246a994595 --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-elastic" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/elastic/azure-mgmt-elastic/setup.cfg b/sdk/elastic/azure-mgmt-elastic/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/elastic/azure-mgmt-elastic/setup.py b/sdk/elastic/azure-mgmt-elastic/setup.py new file mode 100644 index 000000000000..adca19ffab4f --- /dev/null +++ b/sdk/elastic/azure-mgmt-elastic/setup.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-elastic" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.6.21', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +) diff --git a/sdk/elastic/ci.yml b/sdk/elastic/ci.yml new file mode 100644 index 000000000000..8618141b3ddc --- /dev/null +++ b/sdk/elastic/ci.yml @@ -0,0 +1,35 @@ +# DO NOT EDIT THIS FILE +# This file is generated automatically and any changes will be lost. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/elastic/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + - restapi* + paths: + include: + - sdk/elastic/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: elastic + Artifacts: + - name: azure-mgmt-elastic + safeName: azuremgmtelastic