From 48672316f986a489f8b214645495ed05d53060eb Mon Sep 17 00:00:00 2001 From: Yang Yuan Date: Thu, 26 Jul 2018 11:46:03 -0700 Subject: [PATCH] [cognitive Services] Update endpoint URL template for TextAnalytics. (#3491) --- .../data-plane/TextAnalytics/readme.nodejs.md | 1 - .../stable/v2.0/TextAnalytics.json | 25 +++++++++++++++---- .../examples/SuccessfulEntitiesRequest.json | 2 +- .../examples/SuccessfulKeyPhrasesRequest.json | 2 +- .../examples/SuccessfulLanguagesRequest.json | 2 +- .../examples/SuccessfulSentimentRequest.json | 2 +- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/readme.nodejs.md b/specification/cognitiveservices/data-plane/TextAnalytics/readme.nodejs.md index 34827eec4fc2..a8d252e8a841 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/readme.nodejs.md +++ b/specification/cognitiveservices/data-plane/TextAnalytics/readme.nodejs.md @@ -8,7 +8,6 @@ nodejs: package-name: azure-cognitiveservices-textanalytics package-version: 1.0.0 output-folder: $(node-sdks-folder)/lib/services/textAnalytics - override-client-name: TextAnalyticsAPIClient azure-arm: false generate-license-txt: true generate-package-json: true diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/TextAnalytics.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/TextAnalytics.json index 7ec0a0a41ce3..49ac6a85f00a 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/TextAnalytics.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/TextAnalytics.json @@ -22,11 +22,15 @@ "apim_key": [] } ], - "host": "api.cognitive.microsoft.com", - "basePath": "/text/analytics/v2.0", - "schemes": [ - "https" - ], + "x-ms-parameterized-host": { + "hostTemplate": "{Endpoint}/text/analytics/v2.0", + "useSchemePrefix": false, + "parameters": [ + { + "$ref": "#/parameters/Endpoint" + } + ] + }, "paths": { "/keyPhrases": { "post": { @@ -572,5 +576,16 @@ } } } + }, + "parameters": { + "Endpoint": { + "name": "Endpoint", + "description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).", + "x-ms-parameter-location": "client", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + } } } diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulEntitiesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulEntitiesRequest.json index 01a7fd165fa2..7c7350b1c365 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulEntitiesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulEntitiesRequest.json @@ -1,7 +1,7 @@ { "parameters": { "Ocp-Apim-Subscription-Key": "{API key}", - "AzureRegion": "westus", + "Endpoint": "{Endpoint}", "input": { "documents": [ { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulKeyPhrasesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulKeyPhrasesRequest.json index 3980b96282f8..2c79c9965846 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulKeyPhrasesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulKeyPhrasesRequest.json @@ -1,7 +1,7 @@ { "parameters": { "Ocp-Apim-Subscription-Key": "{API key}", - "AzureRegion": "westus", + "Endpoint": "{Endpoint}", "input": { "documents": [ { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulLanguagesRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulLanguagesRequest.json index 747ab22bbcfd..e2d44e5f9c28 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulLanguagesRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulLanguagesRequest.json @@ -1,7 +1,7 @@ { "parameters": { "Ocp-Apim-Subscription-Key": "{API key}", - "AzureRegion": "westus", + "Endpoint": "{Endpoint}", "input": { "documents": [ { diff --git a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulSentimentRequest.json b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulSentimentRequest.json index 210bee807bbc..58f93a0bd9b6 100644 --- a/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulSentimentRequest.json +++ b/specification/cognitiveservices/data-plane/TextAnalytics/stable/v2.0/examples/SuccessfulSentimentRequest.json @@ -1,7 +1,7 @@ { "parameters": { "Ocp-Apim-Subscription-Key": "{API key}", - "AzureRegion": "westus", + "Endpoint": "{Endpoint}", "input": { "documents": [ {