From 8a507a0832d63c9538fa4de137897be950f770f8 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Wed, 13 Dec 2017 22:22:24 -0800 Subject: [PATCH 1/9] [Azure Search] Adding PATCH Services to Swagger Support for PATCH was added to the Azure Search RP. This change adds it to the Swagger spec so it will be documented and included in generated SDK code. --- .../stable/2015-08-19/search.json | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json index ca83be9ddfb3..372102b939fe 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json @@ -425,6 +425,83 @@ }, "x-ms-long-running-operation": true }, + "patch": { + "tags": [ + "Services" + ], + "operationId": "Services_Update", + "description": "Updates an existing Search service in the given resource group.", + "externalDocs": { + "url": "https://aka.ms/search-manage" + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "name": "searchServiceName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Azure Search service to update." + }, + { + "name": "service", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SearchService" + }, + "description": "The definition of the Search service to update." + }, + { + "$ref": "#/parameters/ClientRequestIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The existing service definition was successfully updated. If you changed the number of replicas or partitions, the scale operation will happen asynchronously. You can periodically get your service definition and monitor progress via the provisioningState property.", + "schema": { + "$ref": "#/definitions/SearchService" + }, + "examples": { + "application/json": { + "id": "/subscriptions//resourceGroups/Default-ResourceGroup/providers/Microsoft.Search/searchServices/your-service-name-here", + "name": "your-service-name-here", + "location": "westus", + "type": "Microsoft.Search/searchServices", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "standard" + }, + "properties":{ + "replicaCount": 3, + "partitionCount": 1, + "status": "provisioning", + "statusDetails": "", + "hostingMode": "default", + "provisioningState": "provisioning" + } + } + } + }, + "default": { + "description": "HTTP 400 (Bad Request): The given service definition is invalid or you attempted to change a property that is immutable; See the error code and message in the response for details. HTTP 404 (Not Found): The subscription or resource group could not be found. HTTP 409 (Conflict): The specified subscription is disabled.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + }, "get": { "tags": [ "Services" From 6e4a646a282920f857b3e9c7a6a12325d302b22c Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Thu, 14 Dec 2017 00:53:18 -0800 Subject: [PATCH 2/9] [Azure Search] Adding x-ms-examples to Management plane Swagger spec --- .../examples/SearchCheckNameAvailability.json | 19 ++ .../examples/SearchCreateOrUpdateService.json | 68 ++++++ .../examples/SearchCreateQueryKey.json | 17 ++ .../examples/SearchDeleteQueryKey.json | 14 ++ .../examples/SearchDeleteService.json | 13 + .../examples/SearchGetAdminKeys.json | 16 ++ .../2015-08-19/examples/SearchGetService.json | 32 +++ .../SearchListQueryKeysBySearchService.json | 25 ++ .../SearchListServicesByResourceGroup.json | 55 +++++ .../examples/SearchRegenerateAdminKey.json | 17 ++ .../examples/SearchUpdateService.json | 41 ++++ .../stable/2015-08-19/search.json | 231 +++--------------- 12 files changed, 353 insertions(+), 195 deletions(-) create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCheckNameAvailability.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateOrUpdateService.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateQueryKey.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteService.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetAdminKeys.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetService.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListServicesByResourceGroup.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchRegenerateAdminKey.json create mode 100644 specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchUpdateService.json diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCheckNameAvailability.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCheckNameAvailability.json new file mode 100644 index 000000000000..aafaa0f8a8e8 --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCheckNameAvailability.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2015-08-19", + "subscriptionId": "subid", + "checkNameAvailabilityInput": { + "name": "mysearchservice", + "type": "searchServices" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": false, + "reason": "AlreadyExists", + "message": "" + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateOrUpdateService.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateOrUpdateService.json new file mode 100644 index 000000000000..8a0a9fd5a44e --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateOrUpdateService.json @@ -0,0 +1,68 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "api-version": "2015-08-19", + "subscriptionId": "subid", + "service": { + "location": "westus", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "standard" + }, + "properties": { + "replicaCount": 3, + "partitionCount": 1, + "hostingMode": "default" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice", + "name": "mysearchservice", + "location": "westus", + "type": "Microsoft.Search/searchServices", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "standard" + }, + "properties":{ + "replicaCount": 3, + "partitionCount": 1, + "status": "provisioning", + "statusDetails": "", + "hostingMode": "default", + "provisioningState": "provisioning" + } + } + }, + "201": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice", + "name": "mysearchservice", + "location": "westus", + "type": "Microsoft.Search/searchServices", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "standard" + }, + "properties":{ + "replicaCount": 3, + "partitionCount": 1, + "status": "provisioning", + "statusDetails": "", + "hostingMode": "default", + "provisioningState": "provisioning" + } + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateQueryKey.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateQueryKey.json new file mode 100644 index 000000000000..b010a15e91cc --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchCreateQueryKey.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "name": "Query key for browser-based clients", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "name": "Query key for browser-based clients", + "key": "" + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json new file mode 100644 index 000000000000..e48607e8b068 --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "key": "Query key for browser-based clients", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { }, + "204": { }, + "404": { } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteService.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteService.json new file mode 100644 index 000000000000..585c69cdd512 --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteService.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { }, + "204": { }, + "404": { } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetAdminKeys.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetAdminKeys.json new file mode 100644 index 000000000000..e2f7104c4cee --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetAdminKeys.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "primaryKey": "", + "secondaryKey": "" + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetService.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetService.json new file mode 100644 index 000000000000..d47a0b32f0ed --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchGetService.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice", + "name": "mysearchservice", + "location": "westus", + "type": "Microsoft.Search/searchServices", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "standard" + }, + "properties":{ + "replicaCount": 3, + "partitionCount": 1, + "status": "running", + "statusDetails": "", + "hostingMode": "default", + "provisioningState": "succeeded" + } + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json new file mode 100644 index 000000000000..413146bed3ec --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Query key for browser-based clients", + "key": "" + }, + { + "name": "Query key for mobile clients", + "key": "" + } + ], + "nextLink": null + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListServicesByResourceGroup.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListServicesByResourceGroup.json new file mode 100644 index 000000000000..0c494d8e6ab1 --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListServicesByResourceGroup.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "resourceGroupName": "rg1", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice", + "name": "mysearchservice", + "location": "westus", + "type": "Microsoft.Search/searchServices", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "standard" + }, + "properties":{ + "replicaCount": 3, + "partitionCount": 1, + "status": "running", + "statusDetails": "", + "hostingMode": "default", + "provisioningState": "succeeded" + } + }, + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice2", + "name": "mysearchservice2", + "location": "eastus", + "type": "Microsoft.Search/searchServices", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "basic" + }, + "properties":{ + "replicaCount": 1, + "partitionCount": 1, + "status": "running", + "statusDetails": "", + "hostingMode": "default", + "provisioningState": "succeeded" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchRegenerateAdminKey.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchRegenerateAdminKey.json new file mode 100644 index 000000000000..c7fccba9703e --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchRegenerateAdminKey.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "keyKind": "primary", + "api-version": "2015-08-19", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "primaryKey": "", + "secondaryKey": "" + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchUpdateService.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchUpdateService.json new file mode 100644 index 000000000000..28492fba6b7f --- /dev/null +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchUpdateService.json @@ -0,0 +1,41 @@ +{ + "parameters": { + "searchServiceName": "mysearchservice", + "resourceGroupName": "rg1", + "api-version": "2015-08-19", + "subscriptionId": "subid", + "service": { + "tags": { + "app-name": "My e-commerce app", + "new-tag": "Adding a new tag" + }, + "properties": { + "replicaCount": 2 + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice", + "name": "mysearchservice", + "location": "westus", + "type": "Microsoft.Search/searchServices", + "tags": { + "app-name": "My e-commerce app" + }, + "sku": { + "name": "standard" + }, + "properties":{ + "replicaCount": 3, + "partitionCount": 1, + "status": "provisioning", + "statusDetails": "", + "hostingMode": "default", + "provisioningState": "provisioning" + } + } + } + } +} \ No newline at end of file diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json index 372102b939fe..7327dfe70efb 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json @@ -42,6 +42,9 @@ "AdminKeys" ], "operationId": "AdminKeys_Get", + "x-ms-examples": { + "SearchGetAdminKeys": { "$ref": "./examples/SearchGetAdminKeys.json" } + }, "description": "Gets the primary and secondary admin API keys for the specified Azure Search service.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -68,12 +71,6 @@ "description": "The admin keys were successfully retrieved and are in the response. You can use either the primary or secondary key as the value of the 'api-key' parameter in the Azure Search Service REST API or SDK to perform any operations on your Search service, including privileged operations. Privileged operations include managing resources like indexes and data sources as well as uploading, modifying, or deleting data in your indexes.", "schema": { "$ref": "#/definitions/AdminKeyResult" - }, - "examples": { - "application/json": { - "primaryKey": "", - "secondaryKey": "" - } } }, "default": { @@ -91,6 +88,9 @@ "AdminKeys" ], "operationId": "AdminKeys_Regenerate", + "x-ms-examples": { + "SearchRegenerateAdminKey": { "$ref": "./examples/SearchRegenerateAdminKey.json" } + }, "description": "Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -132,12 +132,6 @@ "description": "The specified admin key was successfully regenerated. Both admin keys are included in the response, including the newly-regenerated key.", "schema": { "$ref": "#/definitions/AdminKeyResult" - }, - "examples": { - "application/json": { - "primaryKey": "", - "secondaryKey": "" - } } }, "default": { @@ -155,6 +149,9 @@ "QueryKeys" ], "operationId": "QueryKeys_Create", + "x-ms-examples": { + "SearchCreateQueryKey": { "$ref": "./examples/SearchCreateQueryKey.json" } + }, "description": "Generates a new query key for the specified Search service. You can create up to 50 query keys per service.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -188,13 +185,7 @@ "description": "The query key was successfully created and is in the response. You can use the query key as the value of the 'api-key' parameter in the Azure Search Service REST API or SDK to perform read-only operations on your Search indexes such as querying and looking up documents by ID.", "schema": { "$ref": "#/definitions/QueryKey" - }, - "examples": { - "application/json": { - "name": "Query key for browser-based clients", - "key": "" - } - } + } }, "default": { "description": "HTTP 404 (Not Found): The subscription, resource group, or Search service could not be found. HTTP 409 (Conflict): The specified subscription is disabled.", @@ -214,6 +205,9 @@ "nextLinkName": null }, "operationId": "QueryKeys_ListBySearchService", + "x-ms-examples": { + "SearchListQueryKeysBySearchService": { "$ref": "./examples/SearchListQueryKeysBySearchService.json" } + }, "description": "Returns the list of query API keys for the given Azure Search service.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -240,21 +234,6 @@ "description": "All query keys for the given Search service were successfully retrieved and are in the response. You can use any of the query keys as the value of the 'api-key' parameter in the Azure Search Service REST API or SDK to perform read-only operations on your Search indexes such as querying and looking up documents by ID.", "schema": { "$ref": "#/definitions/ListQueryKeysResult" - }, - "examples": { - "application/json": { - "value": [ - { - "name": "Query key for browser-based clients", - "key": "" - }, - { - "name": "Query key for mobile clients", - "key": "" - } - ], - "nextLink": null - } } }, "default": { @@ -272,6 +251,9 @@ "QueryKeys" ], "operationId": "QueryKeys_Delete", + "x-ms-examples": { + "SearchDeleteQueryKey": { "$ref": "./examples/SearchDeleteQueryKey.json" } + }, "description": "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.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -325,6 +307,9 @@ "Services" ], "operationId": "Services_CreateOrUpdate", + "x-ms-examples": { + "SearchCreateOrUpdateService": { "$ref": "./examples/SearchCreateOrUpdateService.json" } + }, "description": "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.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -364,56 +349,12 @@ "description": "The existing service definition was successfully updated. If you changed the number of replicas or partitions, the scale operation will happen asynchronously. You can periodically get your service definition and monitor progress via the provisioningState property.", "schema": { "$ref": "#/definitions/SearchService" - }, - "examples": { - "application/json": { - "id": "/subscriptions//resourceGroups/Default-ResourceGroup/providers/Microsoft.Search/searchServices/your-service-name-here", - "name": "your-service-name-here", - "location": "westus", - "type": "Microsoft.Search/searchServices", - "tags": { - "app-name": "My e-commerce app" - }, - "sku": { - "name": "standard" - }, - "properties":{ - "replicaCount": 3, - "partitionCount": 1, - "status": "provisioning", - "statusDetails": "", - "hostingMode": "default", - "provisioningState": "provisioning" - } - } } }, "201": { "description": "If you requested creation of a free Search service, the service is now provisioned and ready to use, subject to DNS propagation delay. For other SKU types, provisioning happens asynchronously. You can periodically get your service definition and monitor progress via the provisioningState property.", "schema": { "$ref": "#/definitions/SearchService" - }, - "examples": { - "application/json": { - "id": "/subscriptions//resourceGroups/Default-ResourceGroup/providers/Microsoft.Search/searchServices/your-service-name-here", - "name": "your-service-name-here", - "location": "westus", - "type": "Microsoft.Search/searchServices", - "tags": { - "app-name": "My e-commerce app" - }, - "sku": { - "name": "standard" - }, - "properties":{ - "replicaCount": 3, - "partitionCount": 1, - "status": "provisioning", - "statusDetails": "", - "hostingMode": "default", - "provisioningState": "provisioning" - } - } } }, "default": { @@ -430,6 +371,9 @@ "Services" ], "operationId": "Services_Update", + "x-ms-examples": { + "SearchUpdateService": { "$ref": "./examples/SearchUpdateService.json" } + }, "description": "Updates an existing Search service in the given resource group.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -469,28 +413,6 @@ "description": "The existing service definition was successfully updated. If you changed the number of replicas or partitions, the scale operation will happen asynchronously. You can periodically get your service definition and monitor progress via the provisioningState property.", "schema": { "$ref": "#/definitions/SearchService" - }, - "examples": { - "application/json": { - "id": "/subscriptions//resourceGroups/Default-ResourceGroup/providers/Microsoft.Search/searchServices/your-service-name-here", - "name": "your-service-name-here", - "location": "westus", - "type": "Microsoft.Search/searchServices", - "tags": { - "app-name": "My e-commerce app" - }, - "sku": { - "name": "standard" - }, - "properties":{ - "replicaCount": 3, - "partitionCount": 1, - "status": "provisioning", - "statusDetails": "", - "hostingMode": "default", - "provisioningState": "provisioning" - } - } } }, "default": { @@ -507,6 +429,9 @@ "Services" ], "operationId": "Services_Get", + "x-ms-examples": { + "SearchGetService": { "$ref": "./examples/SearchGetService.json" } + }, "description": "Gets the Search service with the given name in the given resource group.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -533,28 +458,6 @@ "description": "The Search service definition was successfully retrieved and is in the response. If you are polling for the completion of a provisioning or scale operation, you can check its status via the provisioningState property.", "schema": { "$ref": "#/definitions/SearchService" - }, - "examples": { - "application/json": { - "id": "/subscriptions//resourceGroups/Default-ResourceGroup/providers/Microsoft.Search/searchServices/your-service-name-here", - "name": "your-service-name-here", - "location": "westus", - "type": "Microsoft.Search/searchServices", - "tags": { - "app-name": "My e-commerce app" - }, - "sku": { - "name": "standard" - }, - "properties":{ - "replicaCount": 3, - "partitionCount": 1, - "status": "running", - "statusDetails": "", - "hostingMode": "default", - "provisioningState": "succeeded" - } - } } }, "default": { @@ -570,6 +473,9 @@ "Services" ], "operationId": "Services_Delete", + "x-ms-examples": { + "SearchDeleteService": { "$ref": "./examples/SearchDeleteService.json" } + }, "description": "Deletes a Search service in the given resource group, along with its associated resources.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -619,6 +525,9 @@ "nextLinkName": null }, "operationId": "Services_ListByResourceGroup", + "x-ms-examples": { + "SearchListServicesByResourceGroup": { "$ref": "./examples/SearchListServicesByResourceGroup.json" } + }, "description": "Gets a list of all Search services in the given resource group.", "externalDocs": { "url": "https://aka.ms/search-manage" @@ -642,52 +551,6 @@ "description": "The operation succeeded. The response contains the list of all Search service definitions for the given resource group.", "schema": { "$ref": "#/definitions/SearchServiceListResult" - }, - "examples": { - "application/json": { - "value": [ - { - "id": "/subscriptions//resourceGroups/Default-ResourceGroup/providers/Microsoft.Search/searchServices/your-service-name-here", - "name": "your-service-name-here", - "location": "westus", - "type": "Microsoft.Search/searchServices", - "tags": { - "app-name": "My e-commerce app" - }, - "sku": { - "name": "standard" - }, - "properties":{ - "replicaCount": 3, - "partitionCount": 1, - "status": "running", - "statusDetails": "", - "hostingMode": "default", - "provisioningState": "succeeded" - } - }, - { - "id": "/subscriptions//resourceGroups/Default-ResourceGroup/providers/Microsoft.Search/searchServices/your-second-service-name-here", - "name": "your-second-service-name-here", - "location": "eastus", - "type": "Microsoft.Search/searchServices", - "tags": { - "app-name": "My e-commerce app" - }, - "sku": { - "name": "basic" - }, - "properties":{ - "replicaCount": 1, - "partitionCount": 1, - "status": "running", - "statusDetails": "", - "hostingMode": "default", - "provisioningState": "succeeded" - } - } - ] - } } }, "default": { @@ -709,6 +572,9 @@ "url": "https://aka.ms/search-manage" }, "operationId": "Services_CheckNameAvailability", + "x-ms-examples": { + "SearchCheckNameAvailability": { "$ref": "./examples/SearchCheckNameAvailability.json" } + }, "parameters": [ { "name": "checkNameAvailabilityInput", @@ -735,13 +601,6 @@ "description": "The name check completed. The response contains details of whether the name is valid and available. If the name is invalid, the response also contains a message explaining why not.", "schema": { "$ref": "#/definitions/CheckNameAvailabilityOutput" - }, - "examples": { - "application/json": { - "nameAvailable": false, - "reason": "AlreadyExists", - "message": "" - } } }, "default": { @@ -778,11 +637,7 @@ } } }, - "description": "Input of check name availability API.", - "example": { - "name": "your-service-name-here", - "type": "searchServices" - } + "description": "Input of check name availability API." }, "CheckNameAvailabilityOutput": { "type": "object", @@ -904,21 +759,7 @@ "$ref": "#/definitions/Resource" } ], - "description": "Describes an Azure Search service and its current state.", - "example": { - "location": "westus", - "tags":{ - "app-name": "My e-commerce app" - }, - "sku":{ - "name": "standard" - }, - "properties":{ - "replicaCount": 3, - "partitionCount": 1, - "hostingMode": "default" - } - } + "description": "Describes an Azure Search service and its current state." }, "SearchServiceProperties": { "properties": { From 6cad5e09ec7ee48134fefa9ec10febf0ebe79675 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Thu, 14 Dec 2017 00:58:37 -0800 Subject: [PATCH 3/9] [Azure Search] Removing required properties to resolve PATCH linter errors --- .../Microsoft.Search/stable/2015-08-19/search.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json index 7327dfe70efb..e6b2d634554d 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json @@ -751,9 +751,6 @@ } } }, - "required": [ - "sku" - ], "allOf": [ { "$ref": "#/definitions/Resource" @@ -887,9 +884,6 @@ "description": "Tags to help categorize the resource in the Azure portal." } }, - "required": [ - "location" - ], "description": "Base type for all Azure resources.", "x-ms-azure-resource": true }, From b4ebe232df1d7fcef3a54ca2ad8842c20eadee96 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Thu, 14 Dec 2017 14:22:31 -0800 Subject: [PATCH 4/9] [Azure Search] Removing x-ms-long-running-operation from PATCH It doesn't seem to be supported by the .NET ClientRuntime for resource-based polling. --- .../Microsoft.Search/stable/2015-08-19/search.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json index e6b2d634554d..c747f82d4dfd 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json @@ -421,8 +421,7 @@ "$ref": "#/definitions/CloudError" } } - }, - "x-ms-long-running-operation": true + } }, "get": { "tags": [ From 84385fa1e6ada986582b2381660f737fd6fa9dc8 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Tue, 9 Jan 2018 14:16:10 -0800 Subject: [PATCH 5/9] [Azure Search] Fixing a few Swagger linter warnings --- .../Microsoft.Search/stable/2015-08-19/search.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json index c747f82d4dfd..bc2befb034c8 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json @@ -10,12 +10,10 @@ "https" ], "consumes": [ - "application/json", - "text/json" + "application/json" ], "produces": [ - "application/json", - "text/json" + "application/json" ], "security": [ { @@ -890,7 +888,8 @@ "type": "object", "properties": { "error": { - "$ref": "#/definitions/CloudErrorBody" + "$ref": "#/definitions/CloudErrorBody", + "description": "Describes a particular API error with an error code and a message." } }, "description": "Contains information about an API error.", From 6a31c5b2391c99143fb762d48d4ebc5120df358d Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Tue, 9 Jan 2018 14:22:47 -0800 Subject: [PATCH 6/9] [Azure Search] Adding Operations API to management plane Swagger --- .../stable/2015-08-19/search.json | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json index bc2befb034c8..ecb3591530f6 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json @@ -34,6 +34,31 @@ } }, "paths": { + "/providers/Microsoft.Search/operations": { + "get": { + "tags": [ + "Operations" + ], + "description": "Lists all of the available REST API operations of the Microsoft.Search provider.", + "operationId": "Operations_List", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success. The response describes the list of operations.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listAdminKeys": { "post": { "tags": [ @@ -920,6 +945,61 @@ } }, "x-ms-external": true + }, + "Operation": { + "description": "Describes a REST API operation.", + "type": "object", + "properties": { + "name": { + "description": "The name of the operation. This name is of the form {provider}/{resource}/{operation}.", + "readOnly": true, + "type": "string" + }, + "display": { + "description": "The object that describes the operation.", + "readOnly": true, + "properties": { + "provider": { + "description": "The friendly name of the resource provider.", + "readOnly": true, + "type": "string" + }, + "operation": { + "description": "The operation type: read, write, delete, listKeys/action, etc.", + "readOnly": true, + "type": "string" + }, + "resource": { + "description": "The resource type on which the operation is performed.", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "The friendly name of the operation.", + "readOnly": true, + "type": "string" + } + } + } + } + }, + "OperationListResult": { + "description": "The result of the request to list REST API operations. It contains a list of operations and a URL to get the next set of results.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "readOnly": true, + "description": "The list of operations supported by the resource provider." + }, + "nextLink": { + "type": "string", + "readOnly": true, + "description": "The URL to get the next set of operation list results, if any." + } + } } }, "parameters": { From 57f803b2cc9492eae862588b1c1715dbadd132e6 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Tue, 9 Jan 2018 16:44:25 -0800 Subject: [PATCH 7/9] [Azure Search] Fixing validation error in Management API example --- .../examples/SearchListQueryKeysBySearchService.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json index 413146bed3ec..8b04d5f01bcb 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchListQueryKeysBySearchService.json @@ -17,8 +17,7 @@ "name": "Query key for mobile clients", "key": "" } - ], - "nextLink": null + ] } } } From 9e758b901ebc50f6014609211c1562def0e523e5 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Tue, 9 Jan 2018 18:39:01 -0800 Subject: [PATCH 8/9] [Azure Search] Fixing broken delete query key example --- .../stable/2015-08-19/examples/SearchDeleteQueryKey.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json index e48607e8b068..3416a0f45951 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/examples/SearchDeleteQueryKey.json @@ -2,7 +2,7 @@ "parameters": { "searchServiceName": "mysearchservice", "resourceGroupName": "rg1", - "key": "Query key for browser-based clients", + "key": "", "api-version": "2015-08-19", "subscriptionId": "subid" }, From 5a97895ff762fac7fbeac4183ef3d20062a1dd23 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Wed, 10 Jan 2018 14:42:39 -0800 Subject: [PATCH 9/9] [Azure Search] Clarifying in spec that location and sku are required on Create --- .../Microsoft.Search/stable/2015-08-19/search.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json index ecb3591530f6..517bbe689730 100644 --- a/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json +++ b/specification/search/resource-manager/Microsoft.Search/stable/2015-08-19/search.json @@ -767,7 +767,7 @@ }, "sku": { "$ref": "#/definitions/Sku", - "description": "The SKU of the Search Service, which determines price tier and capacity limits.", + "description": "The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating a new Search Service.", "externalDocs": { "url": "https://azure.microsoft.com/documentation/articles/search-sku-tier/" } @@ -889,7 +889,7 @@ }, "location": { "type": "string", - "description": "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).", + "description": "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). This property is required when creating a new resource.", "externalDocs": { "url": "https://aka.ms/search-rp-info" },