From 510c53dcad9944a40f09507c25c6d020eb718891 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 22 Dec 2016 12:12:11 -0800 Subject: [PATCH 1/4] Move azure-mgmt-search out of unreleased --- .../azure-mgmt-search => azure-mgmt-search}/MANIFEST.in | 0 .../azure-mgmt-search => azure-mgmt-search}/README.rst | 0 .../azure/__init__.py | 0 .../azure/mgmt/__init__.py | 0 .../azure/mgmt/search/__init__.py | 0 .../azure/mgmt/search/models/__init__.py | 0 .../azure/mgmt/search/models/admin_key_result.py | 0 .../mgmt/search/models/check_name_availability_input.py | 0 .../mgmt/search/models/check_name_availability_output.py | 0 .../azure/mgmt/search/models/query_key.py | 0 .../azure/mgmt/search/models/query_key_paged.py | 0 .../azure/mgmt/search/models/resource.py | 0 .../mgmt/search/models/search_management_client_enums.py | 0 .../mgmt/search/models/search_management_request_options.py | 0 .../azure/mgmt/search/models/search_service.py | 0 .../azure/mgmt/search/models/search_service_paged.py | 0 .../azure/mgmt/search/models/sku.py | 0 .../azure/mgmt/search/operations/__init__.py | 0 .../azure/mgmt/search/operations/admin_keys_operations.py | 0 .../azure/mgmt/search/operations/query_keys_operations.py | 0 .../azure/mgmt/search/operations/services_operations.py | 0 .../azure/mgmt/search/search_management_client.py | 0 .../azure/mgmt/search/version.py | 0 .../azure-mgmt-search => azure-mgmt-search}/setup.cfg | 0 {unreleased/azure-mgmt-search => azure-mgmt-search}/setup.py | 0 swagger_to_sdk_config.json | 5 +++-- 26 files changed, 3 insertions(+), 2 deletions(-) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/MANIFEST.in (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/README.rst (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/__init__.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/__init__.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/__init__.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/__init__.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/admin_key_result.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/check_name_availability_input.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/check_name_availability_output.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/query_key.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/query_key_paged.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/resource.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/search_management_client_enums.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/search_management_request_options.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/search_service.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/search_service_paged.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/models/sku.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/operations/__init__.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/operations/admin_keys_operations.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/operations/query_keys_operations.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/operations/services_operations.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/search_management_client.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/azure/mgmt/search/version.py (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/setup.cfg (100%) rename {unreleased/azure-mgmt-search => azure-mgmt-search}/setup.py (100%) diff --git a/unreleased/azure-mgmt-search/MANIFEST.in b/azure-mgmt-search/MANIFEST.in similarity index 100% rename from unreleased/azure-mgmt-search/MANIFEST.in rename to azure-mgmt-search/MANIFEST.in diff --git a/unreleased/azure-mgmt-search/README.rst b/azure-mgmt-search/README.rst similarity index 100% rename from unreleased/azure-mgmt-search/README.rst rename to azure-mgmt-search/README.rst diff --git a/unreleased/azure-mgmt-search/azure/__init__.py b/azure-mgmt-search/azure/__init__.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/__init__.py rename to azure-mgmt-search/azure/__init__.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/__init__.py b/azure-mgmt-search/azure/mgmt/__init__.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/__init__.py rename to azure-mgmt-search/azure/mgmt/__init__.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/__init__.py b/azure-mgmt-search/azure/mgmt/search/__init__.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/__init__.py rename to azure-mgmt-search/azure/mgmt/search/__init__.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/__init__.py b/azure-mgmt-search/azure/mgmt/search/models/__init__.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/__init__.py rename to azure-mgmt-search/azure/mgmt/search/models/__init__.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py b/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py rename to azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py b/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py rename to azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py b/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py rename to azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/query_key.py b/azure-mgmt-search/azure/mgmt/search/models/query_key.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/query_key.py rename to azure-mgmt-search/azure/mgmt/search/models/query_key.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py b/azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py rename to azure-mgmt-search/azure/mgmt/search/models/query_key_paged.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/resource.py b/azure-mgmt-search/azure/mgmt/search/models/resource.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/resource.py rename to azure-mgmt-search/azure/mgmt/search/models/resource.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/search_management_client_enums.py b/azure-mgmt-search/azure/mgmt/search/models/search_management_client_enums.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/search_management_client_enums.py rename to azure-mgmt-search/azure/mgmt/search/models/search_management_client_enums.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py b/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py rename to azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/search_service.py b/azure-mgmt-search/azure/mgmt/search/models/search_service.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/search_service.py rename to azure-mgmt-search/azure/mgmt/search/models/search_service.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py b/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py rename to azure-mgmt-search/azure/mgmt/search/models/search_service_paged.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/models/sku.py b/azure-mgmt-search/azure/mgmt/search/models/sku.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/models/sku.py rename to azure-mgmt-search/azure/mgmt/search/models/sku.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/operations/__init__.py b/azure-mgmt-search/azure/mgmt/search/operations/__init__.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/operations/__init__.py rename to azure-mgmt-search/azure/mgmt/search/operations/__init__.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py b/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py rename to azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py b/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py rename to azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py b/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py rename to azure-mgmt-search/azure/mgmt/search/operations/services_operations.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/search_management_client.py b/azure-mgmt-search/azure/mgmt/search/search_management_client.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/search_management_client.py rename to azure-mgmt-search/azure/mgmt/search/search_management_client.py diff --git a/unreleased/azure-mgmt-search/azure/mgmt/search/version.py b/azure-mgmt-search/azure/mgmt/search/version.py similarity index 100% rename from unreleased/azure-mgmt-search/azure/mgmt/search/version.py rename to azure-mgmt-search/azure/mgmt/search/version.py diff --git a/unreleased/azure-mgmt-search/setup.cfg b/azure-mgmt-search/setup.cfg similarity index 100% rename from unreleased/azure-mgmt-search/setup.cfg rename to azure-mgmt-search/setup.cfg diff --git a/unreleased/azure-mgmt-search/setup.py b/azure-mgmt-search/setup.py similarity index 100% rename from unreleased/azure-mgmt-search/setup.py rename to azure-mgmt-search/setup.py diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index d13effe82aec..fffc9966cc8e 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -260,9 +260,10 @@ "search": { "swagger": "arm-search/2015-08-19/swagger/search.json", "autorest_options": { - "Namespace": "azure.mgmt.search" + "Namespace": "azure.mgmt.search", + "PackageVersion": "0.11.0" }, - "output_dir": "unreleased/azure-mgmt-search/azure/mgmt/search" + "output_dir": "azure-mgmt-search/azure/mgmt/search" }, "servermanager": { "swagger": "arm-servermanagement/2016-07-01-preview/swagger/servermanagement.json", From f2d07a8103c5bd95499315a94e2d71772e352ea4 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 22 Dec 2016 20:13:13 +0000 Subject: [PATCH 2/4] Generated from 813c8e8b8b12f3d541daeb45bb2298d223845d37 --- .../azure/mgmt/search/models/__init__.py | 4 +- .../mgmt/search/models/admin_key_result.py | 2 +- .../models/check_name_availability_input.py | 8 +-- .../models/check_name_availability_output.py | 2 +- .../azure/mgmt/search/models/query_key.py | 2 +- .../azure/mgmt/search/models/resource.py | 12 ++-- .../search_management_request_options.py | 6 +- .../mgmt/search/models/search_service.py | 71 +++++++++---------- .../azure/mgmt/search/models/sku.py | 14 ++-- .../operations/admin_keys_operations.py | 8 +-- .../operations/query_keys_operations.py | 4 +- .../search/operations/services_operations.py | 21 +++--- .../azure/mgmt/search/version.py | 2 +- 13 files changed, 76 insertions(+), 80 deletions(-) diff --git a/azure-mgmt-search/azure/mgmt/search/models/__init__.py b/azure-mgmt-search/azure/mgmt/search/models/__init__.py index 32f93cb53938..1340fcd9c62f 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/__init__.py +++ b/azure-mgmt-search/azure/mgmt/search/models/__init__.py @@ -15,8 +15,8 @@ from .query_key import QueryKey from .sku import Sku from .search_service import SearchService -from .search_management_request_options import SearchManagementRequestOptions from .resource import Resource +from .search_management_request_options import SearchManagementRequestOptions from .query_key_paged import QueryKeyPaged from .search_service_paged import SearchServicePaged from .search_management_client_enums import ( @@ -35,8 +35,8 @@ 'QueryKey', 'Sku', 'SearchService', - 'SearchManagementRequestOptions', 'Resource', + 'SearchManagementRequestOptions', 'QueryKeyPaged', 'SearchServicePaged', 'UnavailableNameReason', diff --git a/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py b/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py index 849750272447..95bb2f4fabae 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py +++ b/azure-mgmt-search/azure/mgmt/search/models/admin_key_result.py @@ -23,7 +23,7 @@ class AdminKeyResult(Model): :vartype primary_key: str :ivar secondary_key: The secondary admin API key of the Search service. :vartype secondary_key: str - """ + """ _validation = { 'primary_key': {'readonly': True}, diff --git a/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py b/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py index 581958b5b333..71cfa509b513 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py +++ b/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py @@ -19,14 +19,14 @@ class CheckNameAvailabilityInput(Model): sending a request. :param name: The Search service name to validate. Search service names - must only contain lowercase letters, digits or dashes, cannot use dash - as the first two or last one characters, cannot contain consecutive - dashes, and must be between 2 and 60 characters in length. + must only contain lowercase letters, digits or dashes, cannot use dash as + the first two or last one characters, cannot contain consecutive dashes, + and must be between 2 and 60 characters in length. :type name: str :ivar type: The type of the resource whose name is to be validated. This value must always be 'searchServices'. Default value: "searchServices" . :vartype type: str - """ + """ _validation = { 'name': {'required': True}, diff --git a/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py b/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py index 1c97a44a94cc..925a5790b122 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py +++ b/azure-mgmt-search/azure/mgmt/search/models/check_name_availability_output.py @@ -31,7 +31,7 @@ class CheckNameAvailabilityOutput(Model): provides resource naming requirements. Available only if 'Invalid' is returned in the 'reason' property. :vartype message: str - """ + """ _validation = { 'is_name_available': {'readonly': True}, diff --git a/azure-mgmt-search/azure/mgmt/search/models/query_key.py b/azure-mgmt-search/azure/mgmt/search/models/query_key.py index 50d96706a2db..ff7ebbe082ec 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/query_key.py +++ b/azure-mgmt-search/azure/mgmt/search/models/query_key.py @@ -23,7 +23,7 @@ class QueryKey(Model): :vartype name: str :ivar key: The value of the query API key. :vartype key: str - """ + """ _validation = { 'name': {'readonly': True}, diff --git a/azure-mgmt-search/azure/mgmt/search/models/resource.py b/azure-mgmt-search/azure/mgmt/search/models/resource.py index 528f0418c85c..e61399919a21 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/resource.py +++ b/azure-mgmt-search/azure/mgmt/search/models/resource.py @@ -18,20 +18,20 @@ class Resource(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The ID of the resource. This can be used with the Azure - Resource Manager to link resources together. + :ivar id: The ID of the resource. This can be used with the Azure Resource + Manager to link resources together. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The resource type. :vartype type: str - :param location: The geographic location of the resource. This must be - one of the supported and registered Azure Geo Regions (for example, West - US, East US, Southeast Asia, and so forth). + :param location: The geographic location of the resource. This must be one + of the supported and registered Azure Geo Regions (for example, West US, + East US, Southeast Asia, and so forth). :type location: str :param tags: Tags to help categorize the resource in the Azure portal. :type tags: dict - """ + """ _validation = { 'id': {'readonly': True}, diff --git a/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py b/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py index 84ab0969e00d..2c7f3cc90871 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py +++ b/azure-mgmt-search/azure/mgmt/search/models/search_management_request_options.py @@ -16,10 +16,10 @@ class SearchManagementRequestOptions(Model): """Additional parameters for a set of operations. :param client_request_id: A client-generated GUID value that identifies - this request. If specified, this will be included in response - information as a way to track the request. + this request. If specified, this will be included in response information + as a way to track the request. :type client_request_id: str - """ + """ def __init__(self, client_request_id=None): self.client_request_id = client_request_id diff --git a/azure-mgmt-search/azure/mgmt/search/models/search_service.py b/azure-mgmt-search/azure/mgmt/search/models/search_service.py index 9f63b5f3cd27..eae4bf6192b7 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/search_service.py +++ b/azure-mgmt-search/azure/mgmt/search/models/search_service.py @@ -18,36 +18,34 @@ class SearchService(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The ID of the resource. This can be used with the Azure - Resource Manager to link resources together. + :ivar id: The ID of the resource. This can be used with the Azure Resource + Manager to link resources together. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The resource type. :vartype type: str - :param location: The geographic location of the resource. This must be - one of the supported and registered Azure Geo Regions (for example, West - US, East US, Southeast Asia, and so forth). + :param location: The geographic location of the resource. This must be one + of the supported and registered Azure Geo Regions (for example, West US, + East US, Southeast Asia, and so forth). :type location: str :param tags: Tags to help categorize the resource in the Azure portal. :type tags: dict :param replica_count: The number of replicas in the Search service. If - specified, it must be a value between 1 and 12 inclusive for standard - SKUs or between 1 and 3 inclusive for basic SKU. Default value: 1 . + specified, it must be a value between 1 and 12 inclusive for standard SKUs + or between 1 and 3 inclusive for basic SKU. Default value: 1 . :type replica_count: int - :param partition_count: The number of partitions in the Search service; - if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are - only valid for standard SKUs. For 'standard3' services with hostingMode - set to 'highDensity', the allowed values are between 1 and 3. Default - value: 1 . + :param partition_count: The number of partitions in the Search service; if + specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only + valid for standard SKUs. For 'standard3' services with hostingMode set to + 'highDensity', the allowed values are between 1 and 3. Default value: 1 . :type partition_count: int :param hosting_mode: Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or - 'highDensity'. For all other SKUs, this value must be 'default'. - Possible values include: 'default', 'highDensity'. Default value: - "default" . + 'highDensity'. For all other SKUs, this value must be 'default'. Possible + values include: 'default', 'highDensity'. Default value: "default" . :type hosting_mode: str or :class:`HostingMode ` :ivar status: The status of the Search service. Possible values include: @@ -55,37 +53,36 @@ class SearchService(Resource): are underway. 'provisioning': The Search service is being provisioned or scaled up or down. 'deleting': The Search service is being deleted. 'degraded': The Search service is degraded. This can occur when the - underlying search units are not healthy. The Search service is most - likely operational, but performance might be slow and some requests - might be dropped. 'disabled': The Search service is disabled. In this - state, the service will reject all API requests. 'error': The Search - service is in an error state. If your service is in the degraded, - disabled, or error states, it means the Azure Search team is actively - investigating the underlying issue. Dedicated services in these states - are still chargeable based on the number of search units provisioned. - Possible values include: 'running', 'provisioning', 'deleting', - 'degraded', 'disabled', 'error' + underlying search units are not healthy. The Search service is most likely + operational, but performance might be slow and some requests might be + dropped. 'disabled': The Search service is disabled. In this state, the + service will reject all API requests. 'error': The Search service is in an + error state. If your service is in the degraded, disabled, or error + states, it means the Azure Search team is actively investigating the + underlying issue. Dedicated services in these states are still chargeable + based on the number of search units provisioned. Possible values include: + 'running', 'provisioning', 'deleting', 'degraded', 'disabled', 'error' :vartype status: str or :class:`SearchServiceStatus ` :ivar status_details: The details of the Search service status. :vartype status_details: str :ivar provisioning_state: The state of the last provisioning operation performed on the Search service. Provisioning is an intermediate state - that occurs while service capacity is being established. After capacity - is set up, provisioningState changes to either 'succeeded' or 'failed'. - Client applications can poll provisioning status (the recommended - polling interval is from 30 seconds to one minute) by using the Get - Search Service operation to see when an operation is completed. If you - are using the free service, this value tends to come back as 'succeeded' - directly in the call to Create Search service. This is because the free - service uses capacity that is already set up. Possible values include: - 'succeeded', 'provisioning', 'failed' + that occurs while service capacity is being established. After capacity is + set up, provisioningState changes to either 'succeeded' or 'failed'. + Client applications can poll provisioning status (the recommended polling + interval is from 30 seconds to one minute) by using the Get Search Service + operation to see when an operation is completed. If you are using the free + service, this value tends to come back as 'succeeded' directly in the call + to Create Search service. This is because the free service uses capacity + that is already set up. Possible values include: 'succeeded', + 'provisioning', 'failed' :vartype provisioning_state: str or :class:`ProvisioningState ` - :param sku: The SKU of the Search Service, which determines price tier - and capacity limits. + :param sku: The SKU of the Search Service, which determines price tier and + capacity limits. :type sku: :class:`Sku ` - """ + """ _validation = { 'id': {'readonly': True}, diff --git a/azure-mgmt-search/azure/mgmt/search/models/sku.py b/azure-mgmt-search/azure/mgmt/search/models/sku.py index 93f709a3c521..4ba0d067f2f4 100644 --- a/azure-mgmt-search/azure/mgmt/search/models/sku.py +++ b/azure-mgmt-search/azure/mgmt/search/models/sku.py @@ -13,19 +13,19 @@ class Sku(Model): - """Defines the SKU of an Azure Search Service, which determines price tier - and capacity limits. + """Defines the SKU of an Azure Search Service, which determines price tier and + capacity limits. :param name: The SKU of the Search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas. 'standard': Dedicated service with up to 12 partitions and 12 replicas. - 'standard2': Similar to standard, but with more capacity per search - unit. 'standard3': Offers maximum capacity per search unit with up to 12 - partitions and 12 replicas (or up to 3 partitions with more indexes if - you also set the hostingMode property to 'highDensity'). Possible values + 'standard2': Similar to standard, but with more capacity per search unit. + 'standard3': Offers maximum capacity per search unit with up to 12 + partitions and 12 replicas (or up to 3 partitions with more indexes if you + also set the hostingMode property to 'highDensity'). Possible values include: 'free', 'basic', 'standard', 'standard2', 'standard3' :type name: str or :class:`SkuName ` - """ + """ _attribute_map = { 'name': {'key': 'name', 'type': 'SkuName'}, diff --git a/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py b/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py index 893dc1cb9ed1..65c842e38114 100644 --- a/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py +++ b/azure-mgmt-search/azure/mgmt/search/operations/admin_keys_operations.py @@ -112,8 +112,8 @@ def get( def regenerate( self, resource_group_name, search_service_name, key_kind, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): - """Regenerates either the primary or secondary admin API key. You can - only regenerate one key at a time. + """Regenerates either the primary or secondary admin API key. You can only + regenerate one key at a time. :param resource_group_name: The name of the resource group within the current subscription. You can obtain this value from the Azure @@ -123,8 +123,8 @@ def regenerate( associated with the specified resource group. :type search_service_name: str :param key_kind: Specifies which key to regenerate. Valid values - include 'primary' and 'secondary'. Possible values include: - 'primary', 'secondary' + include 'primary' and 'secondary'. Possible values include: 'primary', + 'secondary' :type key_kind: str or :class:`AdminKeyKind ` :param search_management_request_options: Additional parameters for diff --git a/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py b/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py index 49f22d38808a..9a40a95360b7 100644 --- a/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py +++ b/azure-mgmt-search/azure/mgmt/search/operations/query_keys_operations.py @@ -198,8 +198,8 @@ def internal_paging(next_link=None, raw=False): def delete( self, resource_group_name, search_service_name, key, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): """Deletes the specified query key. Unlike admin keys, query keys are not - regenerated. The process for regenerating a query key is to delete - and then recreate it. + regenerated. The process for regenerating a query key is to delete and + then recreate it. :param resource_group_name: The name of the resource group within the current subscription. You can obtain this value from the Azure diff --git a/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py b/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py index d0fc24a076fb..705893feb5d9 100644 --- a/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py +++ b/azure-mgmt-search/azure/mgmt/search/operations/services_operations.py @@ -35,9 +35,9 @@ def __init__(self, client, config, serializer, deserializer): def create_or_update( self, resource_group_name, search_service_name, service, search_management_request_options=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates a Search service in the given resource group. If - the Search service already exists, all properties will be updated - with the given values. + """Creates or updates a Search service in the given resource group. If the + Search service already exists, all properties will be updated with the + given values. :param resource_group_name: The name of the resource group within the current subscription. You can obtain this value from the Azure @@ -46,9 +46,9 @@ def create_or_update( :param search_service_name: The name of the Azure Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last - one characters, cannot contain consecutive dashes, and must be - between 2 and 60 characters in length. Search service names must be - globally unique since they are part of the service URI + one characters, cannot contain consecutive dashes, and must be between + 2 and 60 characters in length. Search service names must be globally + unique since they are part of the service URI (https://.search.windows.net). You cannot change the service name after the service is created. :type search_service_name: str @@ -358,11 +358,10 @@ def check_name_availability( use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). - :param name: The Search service name to validate. Search service - names must only contain lowercase letters, digits or dashes, cannot - use dash as the first two or last one characters, cannot contain - consecutive dashes, and must be between 2 and 60 characters in - length. + :param name: The Search service name to validate. Search service names + must only contain lowercase letters, digits or dashes, cannot use dash + as the first two or last one characters, cannot contain consecutive + dashes, and must be between 2 and 60 characters in length. :type name: str :param search_management_request_options: Additional parameters for the operation diff --git a/azure-mgmt-search/azure/mgmt/search/version.py b/azure-mgmt-search/azure/mgmt/search/version.py index b422e566783c..afa3d545c718 100644 --- a/azure-mgmt-search/azure/mgmt/search/version.py +++ b/azure-mgmt-search/azure/mgmt/search/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.30.0rc6" +VERSION = "0.11.0" From 182f95d2a981ab8f94aa8e611b2c312d9a926b1c Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 22 Dec 2016 16:27:05 -0800 Subject: [PATCH 3/4] Add azure-mgmt-search tests --- ...st_mgmt_search.test_search_admin_keys.yaml | 105 +++++++++ ...st_mgmt_search.test_search_query_keys.yaml | 138 ++++++++++++ ...test_mgmt_search.test_search_services.yaml | 205 ++++++++++++++++++ azure-mgmt/tests/test_mgmt_search.py | 141 ++++++++++++ azure.pyproj | 1 + 5 files changed, 590 insertions(+) create mode 100644 azure-mgmt/tests/recordings/test_mgmt_search.test_search_admin_keys.yaml create mode 100644 azure-mgmt/tests/recordings/test_mgmt_search.test_search_query_keys.yaml create mode 100644 azure-mgmt/tests/recordings/test_mgmt_search.test_search_services.yaml create mode 100644 azure-mgmt/tests/test_mgmt_search.py diff --git a/azure-mgmt/tests/recordings/test_mgmt_search.test_search_admin_keys.yaml b/azure-mgmt/tests/recordings/test_mgmt_search.test_search_admin_keys.yaml new file mode 100644 index 000000000000..cca43b3b5b89 --- /dev/null +++ b/azure-mgmt/tests/recordings/test_mgmt_search.test_search_admin_keys.yaml @@ -0,0 +1,105 @@ +interactions: +- request: + body: '{"location": "westus", "sku": {"name": "free"}, "properties": {"hostingMode": + "default", "replicaCount": 1, "partitionCount": 1}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['129'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [fa2a4500-c8a5-11e6-a051-ecb1d756380e] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_admin_keys3f6f0ff0/providers/Microsoft.Search/searchServices/ptvstestquerykeys?api-version=2015-08-19 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_admin_keys3f6f0ff0/providers/Microsoft.Search/searchServices/ptvstestquerykeys","name":"ptvstestquerykeys","type":"Microsoft.Search/searchServices","location":"West + US","properties":{"replicaCount":1,"partitionCount":1,"status":"running","statusDetails":null,"provisioningState":"succeeded","hostingMode":"default"},"sku":{"name":"free"}}'} + headers: + Cache-Control: [no-cache] + Content-Length: ['441'] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:23:09 GMT'] + ETag: [W/"datetime'2016-12-23T00%3A23%3A10.2711849Z'"] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + X-AspNet-Version: [4.0.30319] + elapsed-time: ['1163'] + request-id: [fa2a4500-c8a5-11e6-a051-ecb1d756380e] + x-ms-correlation-request-id: [e73772be-9a67-42b3-92b9-84c65a78f6c2] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-ms-request-id: [fa2a4500-c8a5-11e6-a051-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T002310Z:e73772be-9a67-42b3-92b9-84c65a78f6c2'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [fc037518-c8a5-11e6-ad6e-ecb1d756380e] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_admin_keys3f6f0ff0/providers/Microsoft.Search/searchServices/ptvstestquerykeys/listAdminKeys?api-version=2015-08-19 + response: + body: {string: '{"primaryKey":"01BF7405A5901538C4F0F3DB31B07B73","secondaryKey":"228E0DA6EC5A817DB1A0BB592BF22723"}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:23:11 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['99'] + elapsed-time: ['176'] + request-id: [fc037518-c8a5-11e6-ad6e-ecb1d756380e] + x-ms-correlation-request-id: [d6976bc0-8325-4384-8a80-ff87cba59312] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-request-id: [fc037518-c8a5-11e6-ad6e-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T002311Z:d6976bc0-8325-4384-8a80-ff87cba59312'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [fca6bd10-c8a5-11e6-a35e-ecb1d756380e] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_admin_keys3f6f0ff0/providers/Microsoft.Search/searchServices/ptvstestquerykeys/regenerateAdminKey/primary?api-version=2015-08-19 + response: + body: {string: '{"primaryKey":"160C118CFA43D8555F3171B6D69F2F25","secondaryKey":"228E0DA6EC5A817DB1A0BB592BF22723"}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:23:11 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['99'] + elapsed-time: ['378'] + request-id: [fca6bd10-c8a5-11e6-a35e-ecb1d756380e] + x-ms-correlation-request-id: [de432fee-cbd9-45d7-997e-1c5ed37f477f] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-request-id: [fca6bd10-c8a5-11e6-a35e-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T002312Z:de432fee-cbd9-45d7-997e-1c5ed37f477f'] + status: {code: 200, message: OK} +version: 1 diff --git a/azure-mgmt/tests/recordings/test_mgmt_search.test_search_query_keys.yaml b/azure-mgmt/tests/recordings/test_mgmt_search.test_search_query_keys.yaml new file mode 100644 index 000000000000..b5b7c5deb7db --- /dev/null +++ b/azure-mgmt/tests/recordings/test_mgmt_search.test_search_query_keys.yaml @@ -0,0 +1,138 @@ +interactions: +- request: + body: '{"properties": {"hostingMode": "default", "replicaCount": 1, "partitionCount": + 1}, "sku": {"name": "free"}, "location": "westus"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['129'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [8b43ff7e-c8a5-11e6-8570-ecb1d756380e] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_query_keys40e9101d/providers/Microsoft.Search/searchServices/ptvstestquerykeys?api-version=2015-08-19 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_query_keys40e9101d/providers/Microsoft.Search/searchServices/ptvstestquerykeys","name":"ptvstestquerykeys","type":"Microsoft.Search/searchServices","location":"West + US","properties":{"replicaCount":1,"partitionCount":1,"status":"running","statusDetails":null,"provisioningState":"succeeded","hostingMode":"default"},"sku":{"name":"free"}}'} + headers: + Cache-Control: [no-cache] + Content-Length: ['441'] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:20:03 GMT'] + ETag: [W/"datetime'2016-12-23T00%3A20%3A03.7237675Z'"] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + X-AspNet-Version: [4.0.30319] + elapsed-time: ['1299'] + request-id: [8b43ff7e-c8a5-11e6-8570-ecb1d756380e] + x-ms-correlation-request-id: [ee4f17f1-9aff-4b09-8652-dc297666f9d3] + x-ms-ratelimit-remaining-subscription-writes: ['1196'] + x-ms-request-id: [8b43ff7e-c8a5-11e6-8570-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T002004Z:ee4f17f1-9aff-4b09-8652-dc297666f9d3'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [8cfe2f86-c8a5-11e6-9100-ecb1d756380e] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_query_keys40e9101d/providers/Microsoft.Search/searchServices/ptvstestquerykeys/createQueryKey/testkey?api-version=2015-08-19 + response: + body: {string: '{"name":"testkey","key":"AF89A03FF9A6182B6C4BA88E91D1D5EA"}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:20:04 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['59'] + elapsed-time: ['349'] + request-id: [8cfe2f86-c8a5-11e6-9100-ecb1d756380e] + x-ms-correlation-request-id: [a4820bf9-12f0-4498-bee3-3b40781ac29b] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-ms-request-id: [8cfe2f86-c8a5-11e6-9100-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T002005Z:a4820bf9-12f0-4498-bee3-3b40781ac29b'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [8da5f0f4-c8a5-11e6-a582-ecb1d756380e] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_query_keys40e9101d/providers/Microsoft.Search/searchServices/ptvstestquerykeys/listQueryKeys?api-version=2015-08-19 + response: + body: {string: '{"value":[{"name":null,"key":"F67EDCEFE7EAFC8ADE86A8AE40236A81"},{"name":"testkey","key":"AF89A03FF9A6182B6C4BA88E91D1D5EA"}],"nextLink":null}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:20:06 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['142'] + elapsed-time: ['152'] + request-id: [8da5f0f4-c8a5-11e6-a582-ecb1d756380e] + x-ms-correlation-request-id: [65bacbd1-d6b5-48d2-a07a-22ac84b4790e] + x-ms-ratelimit-remaining-subscription-reads: ['14998'] + x-ms-request-id: [8da5f0f4-c8a5-11e6-a582-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T002006Z:65bacbd1-d6b5-48d2-a07a-22ac84b4790e'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [8e2a3d62-c8a5-11e6-bdf9-ecb1d756380e] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_query_keys40e9101d/providers/Microsoft.Search/searchServices/ptvstestquerykeys/deleteQueryKey/testkey?api-version=2015-08-19 + response: + body: {string: '{"error":{"code":"Unknown","message":"This API key does not exist + for service ''ptvstestquerykeys''. RequestId: 8e2a3d62-c8a5-11e6-bdf9-ecb1d756380e","target":null,"details":null}}'} + headers: + Cache-Control: [no-cache] + Content-Language: [en] + Content-Length: ['178'] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:20:06 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + X-AspNet-Version: [4.0.30319] + elapsed-time: ['199'] + request-id: [8e2a3d62-c8a5-11e6-bdf9-ecb1d756380e] + x-ms-correlation-request-id: [b1665ad3-672b-4b19-beec-a7992634d4c4] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-ms-request-id: [8e2a3d62-c8a5-11e6-bdf9-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T002007Z:b1665ad3-672b-4b19-beec-a7992634d4c4'] + status: {code: 404, message: Not Found} +version: 1 diff --git a/azure-mgmt/tests/recordings/test_mgmt_search.test_search_services.yaml b/azure-mgmt/tests/recordings/test_mgmt_search.test_search_services.yaml new file mode 100644 index 000000000000..3bfdeb8dc2bc --- /dev/null +++ b/azure-mgmt/tests/recordings/test_mgmt_search.test_search_services.yaml @@ -0,0 +1,205 @@ +interactions: +- request: + body: '{"name": "ptvstestsearch", "type": "searchServices"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['52'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [2511dcd8-c8a4-11e6-a7ba-ecb1d756380e] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Search/checkNameAvailability?api-version=2015-08-19 + response: + body: {string: '{"nameAvailable":true,"reason":null,"message":null}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:10:00 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['51'] + elapsed-time: ['8'] + request-id: [2511dcd8-c8a4-11e6-a7ba-ecb1d756380e] + x-ms-correlation-request-id: [b2ebca8b-5c06-4a2b-9139-a3116cec7b16] + x-ms-ratelimit-remaining-subscription-writes: ['1196'] + x-ms-request-id: [2511dcd8-c8a4-11e6-a7ba-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T001000Z:b2ebca8b-5c06-4a2b-9139-a3116cec7b16'] + status: {code: 200, message: OK} +- request: + body: '{"sku": {"name": "free"}, "location": "westus", "properties": {"replicaCount": + 1, "hostingMode": "default", "partitionCount": 1}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['129'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [25679dda-c8a4-11e6-bf37-ecb1d756380e] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_services20f20f30/providers/Microsoft.Search/searchServices/ptvstestsearch?api-version=2015-08-19 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_services20f20f30/providers/Microsoft.Search/searchServices/ptvstestsearch","name":"ptvstestsearch","type":"Microsoft.Search/searchServices","location":"West + US","properties":{"replicaCount":1,"partitionCount":1,"status":"running","statusDetails":null,"provisioningState":"succeeded","hostingMode":"default"},"sku":{"name":"free"}}'} + headers: + Cache-Control: [no-cache] + Content-Length: ['433'] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:10:03 GMT'] + ETag: [W/"datetime'2016-12-23T00%3A10%3A03.8006148Z'"] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + X-AspNet-Version: [4.0.30319] + elapsed-time: ['1540'] + request-id: [25679dda-c8a4-11e6-bf37-ecb1d756380e] + x-ms-correlation-request-id: [14245062-ac08-464b-a702-5fdee9449cde] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-request-id: [25679dda-c8a4-11e6-bf37-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T001003Z:14245062-ac08-464b-a702-5fdee9449cde'] + status: {code: 201, message: Created} +- request: + body: '{"name": "ptvstestsearch", "type": "searchServices"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['52'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [2742297e-c8a4-11e6-8276-ecb1d756380e] + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Search/checkNameAvailability?api-version=2015-08-19 + response: + body: {string: '{"nameAvailable":false,"reason":"AlreadyExists","message":null}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:10:04 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['63'] + elapsed-time: ['10'] + request-id: [2742297e-c8a4-11e6-8276-ecb1d756380e] + x-ms-correlation-request-id: [ef856114-9972-4396-a409-d6eee39b2e68] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-ms-request-id: [2742297e-c8a4-11e6-8276-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T001004Z:ef856114-9972-4396-a409-d6eee39b2e68'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [279d68e2-c8a4-11e6-84fb-ecb1d756380e] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_services20f20f30/providers/Microsoft.Search/searchServices/ptvstestsearch?api-version=2015-08-19 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_services20f20f30/providers/Microsoft.Search/searchServices/ptvstestsearch","name":"ptvstestsearch","type":"Microsoft.Search/searchServices","location":"West + US","properties":{"replicaCount":1,"partitionCount":1,"status":"running","statusDetails":null,"provisioningState":"succeeded","hostingMode":"default"},"sku":{"name":"free"}}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:10:04 GMT'] + ETag: [W/"datetime'2016-12-23T00%3A10%3A03.8006148Z'"] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['433'] + elapsed-time: ['143'] + request-id: [279d68e2-c8a4-11e6-84fb-ecb1d756380e] + x-ms-correlation-request-id: [4def32c7-e087-4cdc-9756-39d882490106] + x-ms-ratelimit-remaining-subscription-reads: ['14999'] + x-ms-request-id: [279d68e2-c8a4-11e6-84fb-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T001005Z:4def32c7-e087-4cdc-9756-39d882490106'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [281557ae-c8a4-11e6-a504-ecb1d756380e] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_services20f20f30/providers/Microsoft.Search/searchServices?api-version=2015-08-19 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_services20f20f30/providers/Microsoft.Search/searchServices/ptvstestsearch","name":"ptvstestsearch","type":"Microsoft.Search/searchServices","location":"West + US","properties":{"replicaCount":1,"partitionCount":1,"status":"running","statusDetails":null,"provisioningState":"succeeded","hostingMode":"default","ETag":"W/\"datetime''2016-12-23T00%3A10%3A03.8006148Z''\""},"sku":{"name":"free"}}],"nextLink":null}'} + headers: + Cache-Control: [no-cache] + Content-Type: [application/json; charset=utf-8] + Date: ['Fri, 23 Dec 2016 00:10:06 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + Transfer-Encoding: [chunked] + Vary: ['Accept-Encoding,Accept-Encoding'] + X-AspNet-Version: [4.0.30319] + content-length: ['519'] + elapsed-time: ['96'] + request-id: [281557ae-c8a4-11e6-a504-ecb1d756380e] + x-ms-correlation-request-id: [50a32d8a-d220-4ca3-b171-65a1bdd0b990] + x-ms-ratelimit-remaining-subscription-reads: ['14999'] + x-ms-request-id: [281557ae-c8a4-11e6-a504-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T001006Z:50a32d8a-d220-4ca3-b171-65a1bdd0b990'] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.1 (Windows-10-10.0.14393-SP0) requests/2.12.1 msrest/0.4.4 + msrest_azure/0.4.6 searchmanagementclient/0.11.0 Azure-SDK-For-Python] + accept-language: [en-US] + x-ms-client-request-id: [28802758-c8a4-11e6-8db3-ecb1d756380e] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_search_test_search_services20f20f30/providers/Microsoft.Search/searchServices/ptvstestsearch?api-version=2015-08-19 + response: + body: {string: ''} + headers: + Cache-Control: [no-cache] + Content-Length: ['0'] + Date: ['Fri, 23 Dec 2016 00:10:06 GMT'] + Expires: ['-1'] + Pragma: [no-cache] + Strict-Transport-Security: [max-age=31536000; includeSubDomains] + X-AspNet-Version: [4.0.30319] + elapsed-time: ['310'] + request-id: [28802758-c8a4-11e6-8db3-ecb1d756380e] + x-ms-correlation-request-id: [b9f61e51-53cc-4ebc-9e9c-ff5b845e0c74] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-ms-request-id: [28802758-c8a4-11e6-8db3-ecb1d756380e] + x-ms-routing-request-id: ['CENTRALUS:20161223T001007Z:b9f61e51-53cc-4ebc-9e9c-ff5b845e0c74'] + status: {code: 200, message: OK} +version: 1 diff --git a/azure-mgmt/tests/test_mgmt_search.py b/azure-mgmt/tests/test_mgmt_search.py new file mode 100644 index 000000000000..5e6a032e1a7c --- /dev/null +++ b/azure-mgmt/tests/test_mgmt_search.py @@ -0,0 +1,141 @@ +# 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. +#-------------------------------------------------------------------------- +import unittest + +import azure.mgmt.search +from datetime import date, timedelta +from testutils.common_recordingtestcase import record +from tests.mgmt_testcase import HttpStatusCode, AzureMgmtTestCase + + +class MgmtSearchTest(AzureMgmtTestCase): + + def setUp(self): + super(MgmtSearchTest, self).setUp() + self.client = self.create_mgmt_client( + azure.mgmt.search.SearchManagementClient + ) + if not self.is_playback(): + self.create_resource_group() + + @record + def test_search_services(self): + account_name = 'ptvstestsearch' + + availability = self.client.services.check_name_availability(account_name) + self.assertTrue(availability.is_name_available) + + service = self.client.services.create_or_update( + self.group_name, + account_name, + { + 'location': self.region, + 'replica_count': 1, + 'partition_count': 1, + 'hosting_mode': 'Default', + 'sku': { + 'name': 'free' + } + } + ) + + availability = self.client.services.check_name_availability(account_name) + self.assertFalse(availability.is_name_available) + self.assertEquals(availability.reason, "AlreadyExists") + + service = self.client.services.get( + self.group_name, + service.name + ) + self.assertEquals(service.name, account_name) + + services = list(self.client.services.list_by_resource_group(self.group_name)) + self.assertEquals(len(services), 1) + self.assertEquals(services[0].name, account_name) + + self.client.services.delete( + self.group_name, + service.name + ) + + @record + def test_search_query_keys(self): + account_name = 'ptvstestquerykeys' + key_name = 'testkey' + + service = self.client.services.create_or_update( + self.group_name, + account_name, + { + 'location': self.region, + 'replica_count': 1, + 'partition_count': 1, + 'hosting_mode': 'Default', + 'sku': { + 'name': 'free' + } + } + ) + + key = self.client.query_keys.create( + self.group_name, + account_name, + key_name, + ) + self.assertEquals(key.name, key_name) + + keys = list(self.client.query_keys.list_by_search_service( + self.group_name, + account_name + )) + self.assertEquals(len(keys), 2) # default key and mine + self.assertIsNone(keys[0].name) + self.assertEquals(keys[1].name, key_name) + + self.client.query_keys.delete( + self.group_name, + account_name, + key_name + ) + + @record + def test_search_admin_keys(self): + account_name = 'ptvstestquerykeys' + + service = self.client.services.create_or_update( + self.group_name, + account_name, + { + 'location': self.region, + 'replica_count': 1, + 'partition_count': 1, + 'hosting_mode': 'Default', + 'sku': { + 'name': 'free' + } + } + ) + + admin_keys = self.client.admin_keys.get( + self.group_name, + account_name + ) + self.assertIsNotNone(admin_keys.primary_key) + self.assertIsNotNone(admin_keys.secondary_key) + + regenerated_admin_keys = self.client.admin_keys.regenerate( + self.group_name, + account_name, + 'primary' + ) + self.assertIsNotNone(regenerated_admin_keys.primary_key) + self.assertEquals(admin_keys.secondary_key, regenerated_admin_keys.secondary_key) + +#------------------------------------------------------------------------------ +if __name__ == '__main__': + unittest.main() diff --git a/azure.pyproj b/azure.pyproj index 00eccf52d68f..63e2a8cdfb59 100644 --- a/azure.pyproj +++ b/azure.pyproj @@ -1508,6 +1508,7 @@ + From e4438725a879cb50e246a7940a141ec334ef902a Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 22 Dec 2016 16:35:39 -0800 Subject: [PATCH 4/4] azure-mgmt-search 0.1.0 --- README.rst | 1 + azure-mgmt-search/HISTORY.rst | 9 ++++++++ .../azure/mgmt/search/version.py | 2 +- azure-mgmt-search/setup.py | 21 ++++++++++--------- doc/autorest_generated_packages.rst | 1 + doc/installation.rst | 1 + doc/ref/azure.mgmt.search.models.rst | 7 +++++++ doc/ref/azure.mgmt.search.operations.rst | 7 +++++++ doc/ref/azure.mgmt.search.rst | 18 ++++++++++++++++ swagger_to_sdk_config.json | 2 +- 10 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 azure-mgmt-search/HISTORY.rst create mode 100644 doc/ref/azure.mgmt.search.models.rst create mode 100644 doc/ref/azure.mgmt.search.operations.rst create mode 100644 doc/ref/azure.mgmt.search.rst diff --git a/README.rst b/README.rst index 92f49a8ec2d8..cb794a9724a9 100644 --- a/README.rst +++ b/README.rst @@ -95,6 +95,7 @@ listed before. - azure-mgmt-media 0.1.1 - azure-mgmt-notificationhubs 0.30.0 - azure-mgmt-powerbiembedded 0.30.0rc6 +- azure-mgmt-search 0.1.0 - azure-mgmt-servicebus 0.1.0 - azure-mgmt-sql 0.2.0 - azure-mgmt-trafficmanager 0.30.0rc6 diff --git a/azure-mgmt-search/HISTORY.rst b/azure-mgmt-search/HISTORY.rst new file mode 100644 index 000000000000..e2346b2755e1 --- /dev/null +++ b/azure-mgmt-search/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0 (2016-08-09) +++++++++++++++++++ + +* Initial Release diff --git a/azure-mgmt-search/azure/mgmt/search/version.py b/azure-mgmt-search/azure/mgmt/search/version.py index afa3d545c718..e0ec669828cb 100644 --- a/azure-mgmt-search/azure/mgmt/search/version.py +++ b/azure-mgmt-search/azure/mgmt/search/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.11.0" +VERSION = "0.1.0" diff --git a/azure-mgmt-search/setup.py b/azure-mgmt-search/setup.py index 79ae54b4e4f3..9b447a8cb943 100644 --- a/azure-mgmt-search/setup.py +++ b/azure-mgmt-search/setup.py @@ -6,7 +6,8 @@ # license information. #-------------------------------------------------------------------------- -from setuptools import setup +from setuptools import find_packages, setup +from io import open import re # azure v0.x is not compatible with this package @@ -32,11 +33,16 @@ if not version: raise RuntimeError('Cannot find version information') +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + setup( name='azure-mgmt-search', version=version, description='Microsoft Azure Search Management Client Library for Python', - long_description=open('README.rst', 'r').read(), + long_description=readme + '\n\n' + history, license='MIT License', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', @@ -53,15 +59,10 @@ 'License :: OSI Approved :: MIT License', ], zip_safe=False, - packages=[ - 'azure', - 'azure.mgmt', - 'azure.mgmt.search', - 'azure.mgmt.search.models', - 'azure.mgmt.search.operations', - ], + packages=find_packages(), install_requires=[ - 'azure-common[autorest]==1.1.4', + 'msrestazure~=0.4.6', + 'azure-common~=1.1.4', 'azure-mgmt-nspkg', ], ) diff --git a/doc/autorest_generated_packages.rst b/doc/autorest_generated_packages.rst index 8c8da2189338..97468026a634 100644 --- a/doc/autorest_generated_packages.rst +++ b/doc/autorest_generated_packages.rst @@ -36,6 +36,7 @@ ./ref/azure.mgmt.resource.resources.rst ./ref/azure.mgmt.resource.subscriptions.rst ./ref/azure.mgmt.scheduler.rst + ./ref/azure.mgmt.search.rst ./ref/azure.mgmt.servermanager.rst ./ref/azure.mgmt.servicebus.rst ./ref/azure.mgmt.sql.rst diff --git a/doc/installation.rst b/doc/installation.rst index bf9426e0d567..683203b5b929 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -85,6 +85,7 @@ azure-mgmt-iothub 0.2.1 azure-mgmt-media 0.1.1 azure-mgmt-notificationhubs 0.30.0 azure-mgmt-powerbiembedded 0.30.0rc6 +azure-mgmt-search 0.1.0 azure-mgmt-servicebus 0.1.0 azure-mgmt-sql 0.2.0 azure-mgmt-trafficmanager 0.30.0rc6 diff --git a/doc/ref/azure.mgmt.search.models.rst b/doc/ref/azure.mgmt.search.models.rst new file mode 100644 index 000000000000..8b4d21ba0c29 --- /dev/null +++ b/doc/ref/azure.mgmt.search.models.rst @@ -0,0 +1,7 @@ +azure.mgmt.search.models module +=========================================== + +.. automodule:: azure.mgmt.search.models + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/ref/azure.mgmt.search.operations.rst b/doc/ref/azure.mgmt.search.operations.rst new file mode 100644 index 000000000000..364421c8e29c --- /dev/null +++ b/doc/ref/azure.mgmt.search.operations.rst @@ -0,0 +1,7 @@ +azure.mgmt.search.operations module +=========================================== + +.. automodule:: azure.mgmt.search.operations + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/ref/azure.mgmt.search.rst b/doc/ref/azure.mgmt.search.rst new file mode 100644 index 000000000000..d8de30572043 --- /dev/null +++ b/doc/ref/azure.mgmt.search.rst @@ -0,0 +1,18 @@ +azure.mgmt.search package +========================== + +Submodules +---------- + +.. toctree:: + + azure.mgmt.search.models + azure.mgmt.search.operations + +Module contents +--------------- + +.. automodule:: azure.mgmt.search + :members: + :undoc-members: + :show-inheritance: diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index fffc9966cc8e..65d221375f9d 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -261,7 +261,7 @@ "swagger": "arm-search/2015-08-19/swagger/search.json", "autorest_options": { "Namespace": "azure.mgmt.search", - "PackageVersion": "0.11.0" + "PackageVersion": "0.1.0" }, "output_dir": "azure-mgmt-search/azure/mgmt/search" },