From 32a68020f6dfc53139ab5fe616c938c4e506ca01 Mon Sep 17 00:00:00 2001 From: Yuan Yang Date: Mon, 5 Nov 2018 12:08:57 -0800 Subject: [PATCH] [CognitiveServices] enable Bing Search/CustomSearch products to specify Endpoint --- .../AutoSuggest/stable/v1.0/AutoSuggest.json | 11 ++++++- .../data-plane/Common/Parameters.json | 10 +++++++ .../stable/v1.0/CustomImageSearch.json | 9 ++++++ .../stable/v1.0/CustomSearch.json | 9 ++++++ .../stable/v1.0/EntitySearch.json | 17 ++++++++--- .../ImageSearch/stable/v1.0/ImageSearch.json | 11 ++++++- .../NewsSearch/stable/v1.0/NewsSearch.json | 29 ++++++++++++------- .../SpellCheck/stable/v1.0/SpellCheck.json | 9 ++++++ .../VideoSearch/stable/v1.0/VideoSearch.json | 11 ++++++- .../preview/v1.0/VisualSearch.json | 11 ++++++- .../WebSearch/stable/v1.0/WebSearch.json | 17 ++++++++--- 11 files changed, 122 insertions(+), 22 deletions(-) diff --git a/specification/cognitiveservices/data-plane/AutoSuggest/stable/v1.0/AutoSuggest.json b/specification/cognitiveservices/data-plane/AutoSuggest/stable/v1.0/AutoSuggest.json index 4bb38df98c1d..a07198e64b18 100644 --- a/specification/cognitiveservices/data-plane/AutoSuggest/stable/v1.0/AutoSuggest.json +++ b/specification/cognitiveservices/data-plane/AutoSuggest/stable/v1.0/AutoSuggest.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "AutoSuggest Search API", + "title": "AutoSuggest Client", "description": "The AutoSuggest Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference).", "version": "1.0" }, @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bing/v7.0", "schemes": [ diff --git a/specification/cognitiveservices/data-plane/Common/Parameters.json b/specification/cognitiveservices/data-plane/Common/Parameters.json index 8831df933942..7fc6dc8d2ec4 100644 --- a/specification/cognitiveservices/data-plane/Common/Parameters.json +++ b/specification/cognitiveservices/data-plane/Common/Parameters.json @@ -7,6 +7,16 @@ }, "paths": {}, "parameters": { + "GlobalEndpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: \"https://westus.api.cognitive.microsoft.com\", \"https://api.cognitive.microsoft.com\").", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true, + "default": "https://api.cognitive.microsoft.com" + }, "ImageStream": { "name": "Image", "in": "body", diff --git a/specification/cognitiveservices/data-plane/CustomImageSearch/stable/v1.0/CustomImageSearch.json b/specification/cognitiveservices/data-plane/CustomImageSearch/stable/v1.0/CustomImageSearch.json index 3c36dc32d746..4dcf77236a81 100644 --- a/specification/cognitiveservices/data-plane/CustomImageSearch/stable/v1.0/CustomImageSearch.json +++ b/specification/cognitiveservices/data-plane/CustomImageSearch/stable/v1.0/CustomImageSearch.json @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bingcustomsearch/v7.0", "schemes": [ diff --git a/specification/cognitiveservices/data-plane/CustomWebSearch/stable/v1.0/CustomSearch.json b/specification/cognitiveservices/data-plane/CustomWebSearch/stable/v1.0/CustomSearch.json index b6b00e58cb35..0188ef254c99 100644 --- a/specification/cognitiveservices/data-plane/CustomWebSearch/stable/v1.0/CustomSearch.json +++ b/specification/cognitiveservices/data-plane/CustomWebSearch/stable/v1.0/CustomSearch.json @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "schemes": [ "https" diff --git a/specification/cognitiveservices/data-plane/EntitySearch/stable/v1.0/EntitySearch.json b/specification/cognitiveservices/data-plane/EntitySearch/stable/v1.0/EntitySearch.json index 25a08fad632b..4aed0801caa5 100644 --- a/specification/cognitiveservices/data-plane/EntitySearch/stable/v1.0/EntitySearch.json +++ b/specification/cognitiveservices/data-plane/EntitySearch/stable/v1.0/EntitySearch.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "Entity Search API", + "title": "Entity Search Client", "description": "The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc.", "version": "1.0" }, @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "schemes": [ "https" @@ -210,9 +219,9 @@ } }, "x-ms-examples": { - "Successful query": { - "$ref": "./examples//SuccessfulQueryRequest.json" - } + "Successful query": { + "$ref": "./examples//SuccessfulQueryRequest.json" + } } } } diff --git a/specification/cognitiveservices/data-plane/ImageSearch/stable/v1.0/ImageSearch.json b/specification/cognitiveservices/data-plane/ImageSearch/stable/v1.0/ImageSearch.json index 2a6773c47853..274f0940dc51 100644 --- a/specification/cognitiveservices/data-plane/ImageSearch/stable/v1.0/ImageSearch.json +++ b/specification/cognitiveservices/data-plane/ImageSearch/stable/v1.0/ImageSearch.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "Image Search API", + "title": "Image Search Client", "description": "The Image Search API lets you send a search query to Bing and get back a list of relevant images. This section provides technical details about the query parameters and headers that you use to request images and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the Web for Images](https://docs.microsoft.com/azure/cognitive-services/bing-image-search/search-the-web).", "version": "1.0" }, @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bing/v7.0", "schemes": [ diff --git a/specification/cognitiveservices/data-plane/NewsSearch/stable/v1.0/NewsSearch.json b/specification/cognitiveservices/data-plane/NewsSearch/stable/v1.0/NewsSearch.json index f05cfc1aba66..298d58342305 100644 --- a/specification/cognitiveservices/data-plane/NewsSearch/stable/v1.0/NewsSearch.json +++ b/specification/cognitiveservices/data-plane/NewsSearch/stable/v1.0/NewsSearch.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "News Search API", + "title": "News Search Client", "description": "The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).", "version": "1.0" }, @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bing/v7.0", "schemes": [ @@ -241,9 +250,9 @@ } }, "x-ms-examples": { - "Successful query": { - "$ref": "./examples//SuccessfulNewsSearchRequest.json" - } + "Successful query": { + "$ref": "./examples//SuccessfulNewsSearchRequest.json" + } } } }, @@ -429,9 +438,9 @@ } }, "x-ms-examples": { - "Successful query": { - "$ref": "./examples//SuccessfulNewsCategoryRequest.json" - } + "Successful query": { + "$ref": "./examples//SuccessfulNewsCategoryRequest.json" + } } } }, @@ -609,9 +618,9 @@ } }, "x-ms-examples": { - "Successful query": { - "$ref": "./examples//SuccessfulNewsTrendingRequest.json" - } + "Successful query": { + "$ref": "./examples//SuccessfulNewsTrendingRequest.json" + } } } } diff --git a/specification/cognitiveservices/data-plane/SpellCheck/stable/v1.0/SpellCheck.json b/specification/cognitiveservices/data-plane/SpellCheck/stable/v1.0/SpellCheck.json index d1e2d1822c30..2c5b85f9bd9d 100644 --- a/specification/cognitiveservices/data-plane/SpellCheck/stable/v1.0/SpellCheck.json +++ b/specification/cognitiveservices/data-plane/SpellCheck/stable/v1.0/SpellCheck.json @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bing/v7.0", "schemes": [ diff --git a/specification/cognitiveservices/data-plane/VideoSearch/stable/v1.0/VideoSearch.json b/specification/cognitiveservices/data-plane/VideoSearch/stable/v1.0/VideoSearch.json index 3d87a12b7a91..98ae1125b4e6 100644 --- a/specification/cognitiveservices/data-plane/VideoSearch/stable/v1.0/VideoSearch.json +++ b/specification/cognitiveservices/data-plane/VideoSearch/stable/v1.0/VideoSearch.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "Video Search API", + "title": "Video Search Client", "description": "The Video Search API lets you search on Bing for video that are relevant to the user's search query, for insights about a video or for videos that are trending based on search requests made by others. This section provides technical details about the query parameters and headers that you use to request videos and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the Web for Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/search-the-web).", "version": "1.0" }, @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bing/v7.0", "schemes": [ diff --git a/specification/cognitiveservices/data-plane/VisualSearch/preview/v1.0/VisualSearch.json b/specification/cognitiveservices/data-plane/VisualSearch/preview/v1.0/VisualSearch.json index e25d36c02a3d..8c89311b367b 100644 --- a/specification/cognitiveservices/data-plane/VisualSearch/preview/v1.0/VisualSearch.json +++ b/specification/cognitiveservices/data-plane/VisualSearch/preview/v1.0/VisualSearch.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "Visual Search API", + "title": "Visual Search Client", "description": "Visual Search API lets you discover insights about an image such as visually similar images, shopping sources, and related searches. The API can also perform text recognition, identify entities (people, places, things), return other topical content for the user to explore, and more. For more information, see [Visual Search Overview](https://docs.microsoft.com/azure/cognitive-services/bing-visual-search/overview).", "version": "1.0" }, @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bing/v7.0", "schemes": [ diff --git a/specification/cognitiveservices/data-plane/WebSearch/stable/v1.0/WebSearch.json b/specification/cognitiveservices/data-plane/WebSearch/stable/v1.0/WebSearch.json index 98ee8cecc62c..2ee854933472 100644 --- a/specification/cognitiveservices/data-plane/WebSearch/stable/v1.0/WebSearch.json +++ b/specification/cognitiveservices/data-plane/WebSearch/stable/v1.0/WebSearch.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "Web Search API", + "title": "Web Search Client", "description": "The Web Search API lets you send a search query to Bing and get back search results that include links to webpages, images, and more.", "version": "1.0" }, @@ -22,6 +22,15 @@ ] } }, + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "../../../Common/Parameters.json#/parameters/GlobalEndpoint" + } + ] + }, "host": "api.cognitive.microsoft.com", "basePath": "/bing/v7.0", "schemes": [ @@ -294,9 +303,9 @@ } }, "x-ms-examples": { - "Successful query": { - "$ref": "./examples//SuccessfulQueryRequest.json" - } + "Successful query": { + "$ref": "./examples//SuccessfulQueryRequest.json" + } } } }