diff --git a/azure-mgmt-recoveryservices/HISTORY.rst b/azure-mgmt-recoveryservices/HISTORY.rst index 1623e2673508..e00dea272cf1 100644 --- a/azure-mgmt-recoveryservices/HISTORY.rst +++ b/azure-mgmt-recoveryservices/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +0.4.0 (2019-04-05) +++++++++++++++++++ + +**Features** + +- Added operation recovery_services.check_name_availability + 0.3.0 (2018-05-25) ++++++++++++++++++ @@ -33,7 +40,7 @@ This version uses a next-generation code generator that *might* introduce breaki - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. - - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, the response of the initial call will be returned without polling. diff --git a/azure-mgmt-recoveryservices/MANIFEST.in b/azure-mgmt-recoveryservices/MANIFEST.in index bb37a2723dae..e4884efef41b 100644 --- a/azure-mgmt-recoveryservices/MANIFEST.in +++ b/azure-mgmt-recoveryservices/MANIFEST.in @@ -1 +1,5 @@ +recursive-include tests *.py *.yaml include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-recoveryservices/README.rst b/azure-mgmt-recoveryservices/README.rst index 423dd2168ded..8f770a17e507 100644 --- a/azure-mgmt-recoveryservices/README.rst +++ b/azure-mgmt-recoveryservices/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py index 1e5718e6c81b..3e69c14087ea 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/__init__.py @@ -19,6 +19,9 @@ from .jobs_summary_py3 import JobsSummary from .monitoring_summary_py3 import MonitoringSummary from .replication_usage_py3 import ReplicationUsage + from .check_name_availability_parameters_py3 import CheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .check_name_availability_result_resource_py3 import CheckNameAvailabilityResultResource from .client_discovery_display_py3 import ClientDiscoveryDisplay from .client_discovery_for_log_specification_py3 import ClientDiscoveryForLogSpecification from .client_discovery_for_service_specification_py3 import ClientDiscoveryForServiceSpecification @@ -45,6 +48,9 @@ from .jobs_summary import JobsSummary from .monitoring_summary import MonitoringSummary from .replication_usage import ReplicationUsage + from .check_name_availability_parameters import CheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .check_name_availability_result_resource import CheckNameAvailabilityResultResource from .client_discovery_display import ClientDiscoveryDisplay from .client_discovery_for_log_specification import ClientDiscoveryForLogSpecification from .client_discovery_for_service_specification import ClientDiscoveryForServiceSpecification @@ -83,6 +89,9 @@ 'JobsSummary', 'MonitoringSummary', 'ReplicationUsage', + 'CheckNameAvailabilityParameters', + 'CheckNameAvailabilityResult', + 'CheckNameAvailabilityResultResource', 'ClientDiscoveryDisplay', 'ClientDiscoveryForLogSpecification', 'ClientDiscoveryForServiceSpecification', diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_parameters.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_parameters.py new file mode 100644 index 000000000000..9dc03044fe8d --- /dev/null +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_parameters.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Resource Name availability input parameters - Resource type and resource + name. + + :param type: Describes the Resource type: + Microsoft.RecoveryServices/Vaults + :type type: str + :param name: Resource name for which availability needs to be checked + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_parameters_py3.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_parameters_py3.py new file mode 100644 index 000000000000..2c8a9d9bc51d --- /dev/null +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_parameters_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityParameters(Model): + """Resource Name availability input parameters - Resource type and resource + name. + + :param type: Describes the Resource type: + Microsoft.RecoveryServices/Vaults + :type type: str + :param name: Resource name for which availability needs to be checked + :type name: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, name: str=None, **kwargs) -> None: + super(CheckNameAvailabilityParameters, self).__init__(**kwargs) + self.type = type + self.name = name diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result.py new file mode 100644 index 000000000000..70dccf78ae56 --- /dev/null +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result.py @@ -0,0 +1,37 @@ +# 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 + + +class CheckNameAvailabilityResult(Model): + """Response for check name availability API. Resource provider will set + availability as true | false. + + :param name_available: + :type name_available: bool + :param reason: + :type reason: str + :param message: + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_py3.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_py3.py new file mode 100644 index 000000000000..2b103c715075 --- /dev/null +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_py3.py @@ -0,0 +1,37 @@ +# 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 + + +class CheckNameAvailabilityResult(Model): + """Response for check name availability API. Resource provider will set + availability as true | false. + + :param name_available: + :type name_available: bool + :param reason: + :type reason: str + :param message: + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_resource.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_resource.py new file mode 100644 index 000000000000..9e6e061c0b2d --- /dev/null +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_resource.py @@ -0,0 +1,52 @@ +# 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 .resource import Resource + + +class CheckNameAvailabilityResultResource(Resource): + """Response for check name availability API. Resource provider will set + availability as true | false. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CheckNameAvailabilityResultResource properties + :type properties: + ~azure.mgmt.recoveryservices.models.CheckNameAvailabilityResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CheckNameAvailabilityResult'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResultResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_resource_py3.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_resource_py3.py new file mode 100644 index 000000000000..f0ebc0557d83 --- /dev/null +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/check_name_availability_result_resource_py3.py @@ -0,0 +1,52 @@ +# 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 .resource_py3 import Resource + + +class CheckNameAvailabilityResultResource(Resource): + """Response for check name availability API. Resource provider will set + availability as true | false. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id represents the complete path to the resource. + :vartype id: str + :ivar name: Resource name associated with the resource. + :vartype name: str + :ivar type: Resource type represents the complete path of the form + Namespace/ResourceType/ResourceType/... + :vartype type: str + :param e_tag: Optional ETag. + :type e_tag: str + :param properties: CheckNameAvailabilityResultResource properties + :type properties: + ~azure.mgmt.recoveryservices.models.CheckNameAvailabilityResult + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'e_tag': {'key': 'eTag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CheckNameAvailabilityResult'}, + } + + def __init__(self, *, e_tag: str=None, properties=None, **kwargs) -> None: + super(CheckNameAvailabilityResultResource, self).__init__(e_tag=e_tag, **kwargs) + self.properties = properties diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details.py index 521c0b2ab160..130274fd482b 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details.py @@ -19,7 +19,7 @@ class ResourceCertificateAndAadDetails(ResourceCertificateDetails): :param certificate: The base64 encoded certificate raw data string. :type certificate: bytearray - :param friendly_name: Certificate friendlyname. + :param friendly_name: Certificate friendly name. :type friendly_name: str :param issuer: Certificate issuer. :type issuer: str diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details_py3.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details_py3.py index 591a1d0ba44e..be2ce10e16d7 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details_py3.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_aad_details_py3.py @@ -19,7 +19,7 @@ class ResourceCertificateAndAadDetails(ResourceCertificateDetails): :param certificate: The base64 encoded certificate raw data string. :type certificate: bytearray - :param friendly_name: Certificate friendlyname. + :param friendly_name: Certificate friendly name. :type friendly_name: str :param issuer: Certificate issuer. :type issuer: str diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details.py index 69f3f03a1c6d..00cce4813886 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details.py @@ -19,7 +19,7 @@ class ResourceCertificateAndAcsDetails(ResourceCertificateDetails): :param certificate: The base64 encoded certificate raw data string. :type certificate: bytearray - :param friendly_name: Certificate friendlyname. + :param friendly_name: Certificate friendly name. :type friendly_name: str :param issuer: Certificate issuer. :type issuer: str diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details_py3.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details_py3.py index d53475e6f844..2edfe85d4699 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details_py3.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_and_acs_details_py3.py @@ -19,7 +19,7 @@ class ResourceCertificateAndAcsDetails(ResourceCertificateDetails): :param certificate: The base64 encoded certificate raw data string. :type certificate: bytearray - :param friendly_name: Certificate friendlyname. + :param friendly_name: Certificate friendly name. :type friendly_name: str :param issuer: Certificate issuer. :type issuer: str diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details.py index 8beadb8f04df..664ec6048fed 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details.py @@ -23,7 +23,7 @@ class ResourceCertificateDetails(Model): :param certificate: The base64 encoded certificate raw data string. :type certificate: bytearray - :param friendly_name: Certificate friendlyname. + :param friendly_name: Certificate friendly name. :type friendly_name: str :param issuer: Certificate issuer. :type issuer: str diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details_py3.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details_py3.py index 50799884c1ab..7da7ebf197c7 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details_py3.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/resource_certificate_details_py3.py @@ -23,7 +23,7 @@ class ResourceCertificateDetails(Model): :param certificate: The base64 encoded certificate raw data string. :type certificate: bytearray - :param friendly_name: Certificate friendlyname. + :param friendly_name: Certificate friendly name. :type friendly_name: str :param issuer: Certificate issuer. :type issuer: str diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details.py index d1b79809e3e4..4c54724acb8f 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details.py @@ -34,7 +34,7 @@ class UpgradeDetails(Model): :ivar message: Message to the user containing information about the upgrade operation. :vartype message: str - :ivar trigger_type: The way the vault upgradation was triggered. Possible + :ivar trigger_type: The way the vault upgrade was triggered. Possible values include: 'UserTriggered', 'ForcedUpgrade' :vartype trigger_type: str or ~azure.mgmt.recoveryservices.models.TriggerType diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details_py3.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details_py3.py index fcfc8f1d6cf9..c3c176030cda 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details_py3.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/models/upgrade_details_py3.py @@ -34,7 +34,7 @@ class UpgradeDetails(Model): :ivar message: Message to the user containing information about the upgrade operation. :vartype message: str - :ivar trigger_type: The way the vault upgradation was triggered. Possible + :ivar trigger_type: The way the vault upgrade was triggered. Possible values include: 'UserTriggered', 'ForcedUpgrade' :vartype trigger_type: str or ~azure.mgmt.recoveryservices.models.TriggerType diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/__init__.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/__init__.py index fd4496cfacb0..c1a8596ac781 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/__init__.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/__init__.py @@ -12,6 +12,7 @@ from .vault_certificates_operations import VaultCertificatesOperations from .registered_identities_operations import RegisteredIdentitiesOperations from .replication_usages_operations import ReplicationUsagesOperations +from .recovery_services_operations import RecoveryServicesOperations from .vaults_operations import VaultsOperations from .operations import Operations from .vault_extended_info_operations import VaultExtendedInfoOperations @@ -21,6 +22,7 @@ 'VaultCertificatesOperations', 'RegisteredIdentitiesOperations', 'ReplicationUsagesOperations', + 'RecoveryServicesOperations', 'VaultsOperations', 'Operations', 'VaultExtendedInfoOperations', diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/operations.py index 45dfbe46af48..84c4a236e8e1 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/operations.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/recovery_services_operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/recovery_services_operations.py new file mode 100644 index 000000000000..a4daa4e0bed9 --- /dev/null +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/recovery_services_operations.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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RecoveryServicesOperations(object): + """RecoveryServicesOperations operations. + + :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: Client Api Version. Constant value: "2016-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2016-06-01" + + self.config = config + + def check_name_availability( + self, resource_group_name, location, type=None, name=None, custom_headers=None, raw=False, **operation_config): + """API to check for resource name availability. + A name is available if no other resource exists that has the same + SubscriptionId, Resource Name and Type + or if one or more such resources exist, each of these must be GC'd and + their time of deletion be more than 24 Hours Ago. + + :param resource_group_name: The name of the resource group where the + recovery services vault is present. + :type resource_group_name: str + :param location: Location of the resource + :type location: str + :param type: Describes the Resource type: + Microsoft.RecoveryServices/Vaults + :type type: str + :param name: Resource name for which availability needs to be checked + :type 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: CheckNameAvailabilityResultResource or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.recoveryservices.models.CheckNameAvailabilityResultResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + input = models.CheckNameAvailabilityParameters(type=type, name=name) + + # Construct URL + url = self.check_name_availability.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'), + 'location': self._serialize.url("location", location, '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 + body_content = self._serialize.body(input, 'CheckNameAvailabilityParameters') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResultResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability'} diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/registered_identities_operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/registered_identities_operations.py index cf9f9829ef5e..80f05d799142 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/registered_identities_operations.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/registered_identities_operations.py @@ -73,7 +73,6 @@ def delete( # 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: @@ -82,8 +81,8 @@ def delete( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [204]: exp = CloudError(response) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/replication_usages_operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/replication_usages_operations.py index fbadd6408dce..9139ffb0c385 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/replication_usages_operations.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/replication_usages_operations.py @@ -78,7 +78,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -87,9 +87,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/usages_operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/usages_operations.py index 9ab6c5de79de..8c9b1ce2c7ea 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/usages_operations.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/usages_operations.py @@ -78,7 +78,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -87,9 +87,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_certificates_operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_certificates_operations.py index 8523ff8ecac2..4e8e3d1f162f 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_certificates_operations.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_certificates_operations.py @@ -79,6 +79,7 @@ def create( # 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()) @@ -91,9 +92,8 @@ def create( body_content = self._serialize.body(certificate_request, 'CertificateRequest') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_extended_info_operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_extended_info_operations.py index c672aacb65e2..49f2ffe02a5d 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_extended_info_operations.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vault_extended_info_operations.py @@ -71,7 +71,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -80,8 +80,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -138,6 +138,7 @@ def create_or_update( # 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()) @@ -150,9 +151,8 @@ def create_or_update( body_content = self._serialize.body(resource_resource_extended_info_details, 'VaultExtendedInfoResource') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -209,6 +209,7 @@ def update( # 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()) @@ -221,9 +222,8 @@ def update( body_content = self._serialize.body(resource_resource_extended_info_details, 'VaultExtendedInfoResource') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vaults_operations.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vaults_operations.py index b844fa2f8374..248187627d55 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vaults_operations.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/operations/vaults_operations.py @@ -71,7 +71,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -80,9 +80,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -140,7 +139,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -149,9 +148,8 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -205,7 +203,7 @@ def get( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -214,8 +212,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -270,6 +268,7 @@ def create_or_update( # 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()) @@ -282,9 +281,8 @@ def create_or_update( body_content = self._serialize.body(vault, 'Vault') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -338,7 +336,6 @@ def delete( # 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: @@ -347,8 +344,8 @@ def delete( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -396,6 +393,7 @@ def update( # 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()) @@ -408,9 +406,8 @@ def update( body_content = self._serialize.body(vault, 'PatchVault') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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, 201]: exp = CloudError(response) diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/recovery_services_client.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/recovery_services_client.py index b7119a3cea07..de5f14e862c4 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/recovery_services_client.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/recovery_services_client.py @@ -16,6 +16,7 @@ from .operations.vault_certificates_operations import VaultCertificatesOperations from .operations.registered_identities_operations import RegisteredIdentitiesOperations from .operations.replication_usages_operations import ReplicationUsagesOperations +from .operations.recovery_services_operations import RecoveryServicesOperations from .operations.vaults_operations import VaultsOperations from .operations.operations import Operations from .operations.vault_extended_info_operations import VaultExtendedInfoOperations @@ -67,6 +68,8 @@ class RecoveryServicesClient(SDKClient): :vartype registered_identities: azure.mgmt.recoveryservices.operations.RegisteredIdentitiesOperations :ivar replication_usages: ReplicationUsages operations :vartype replication_usages: azure.mgmt.recoveryservices.operations.ReplicationUsagesOperations + :ivar recovery_services: RecoveryServices operations + :vartype recovery_services: azure.mgmt.recoveryservices.operations.RecoveryServicesOperations :ivar vaults: Vaults operations :vartype vaults: azure.mgmt.recoveryservices.operations.VaultsOperations :ivar operations: Operations operations @@ -101,6 +104,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.replication_usages = ReplicationUsagesOperations( self._client, self.config, self._serialize, self._deserialize) + self.recovery_services = RecoveryServicesOperations( + self._client, self.config, self._serialize, self._deserialize) self.vaults = VaultsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( diff --git a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/version.py b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/version.py index fcb88654af0a..7e15bc578c31 100644 --- a/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/version.py +++ b/azure-mgmt-recoveryservices/azure/mgmt/recoveryservices/version.py @@ -9,4 +9,4 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.0" +VERSION = "0.4.0" diff --git a/azure-mgmt-recoveryservices/setup.py b/azure-mgmt-recoveryservices/setup.py index 6e4d331da6a3..00a1907dbc74 100644 --- a/azure-mgmt-recoveryservices/setup.py +++ b/azure-mgmt-recoveryservices/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',