Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cognitive Services] Update endpoint URL template for Face. #3490

Merged
merged 2 commits into from Jul 26, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ nodejs:
package-name: azure-cognitiveservices-face
package-version: 1.0.0-preview
output-folder: $(node-sdks-folder)/lib/services/face
override-client-name: FaceAPIClient
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this as the class name now naturally ends with "Client"

azure-arm: false
generate-license-txt: true
generate-package-json: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
"apim_key": []
}
],
"host": "api.cognitive.microsoft.com",
"basePath": "/face/v1.0",
"schemes": [
"https"
],
"x-ms-parameterized-host": {
"hostTemplate": "{Endpoint}/face/v1.0",
"useSchemePrefix": false,
"parameters": [
{
"$ref": "#/parameters/Endpoint"
}
]
},
"paths": {
"/findsimilars": {
"post": {
Expand Down Expand Up @@ -2401,6 +2405,15 @@
"format": "uuid",
"x-ms-parameter-location": "method",
"collectionFormat": "csv"
},
"Endpoint": {
"name": "Endpoint",
"description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).",
Copy link

@huxuan huxuan Jul 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little concern about the Endpoint setting. Previously, we also have Endpoint concept in Windows SDK [1] and many other places where the endpoint is the whole base url including the path /face/v1.0. I prefer we keep consistency and that is also more general since the path dose not need to be fixed. But if this is a team decision as explained in #3489 that we will keep the same style in all cognitive services, I am OK with it.

[1] https://github.com/Microsoft/Cognitive-Common-Windows/blob/10b0875f4f984186db45ec6da987617dd967d14f/SampleUserControlLibrary/SubscriptionKeyPage.xaml#L49

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @huxuan, the decision is a compromise according to the feedback from multiple teams as well as the limitations of swagger. (In fact we have this change because we prefer consistency over back compatibility)

In this PR we changed the definition of Endpoint, we are planning to update Endpoint in documents and Azure Portal when all the teams agree with the change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huxuan BTW feel free to bring up you concerns in the e-mail thread.

"x-ms-parameter-location": "client",
"required": true,
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"faceListId": "sample_face_list",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"faceListId": "sample_face_list",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"faceListId": "sample_face_list",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
"body":{
"body": {
"name": "mike",
"userData": "{additional data associated with mike}"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"faceListId": "sample_face_list"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"faceListId": "sample_face_list",
"persistedFaceId":"62004fa7-1ac0-478e-9d5a-b38f9e7fbc68"
"persistedFaceId": "62004fa7-1ac0-478e-9d5a-b38f9e7fbc68"
},
"responses": {
"200": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
"personId": "25985303-c537-4467-b41d-bdb45cd95ca1",
"persistedFaceId":"62004fa7-1ac0-478e-9d5a-b38f9e7fbc68"
"persistedFaceId": "62004fa7-1ac0-478e-9d5a-b38f9e7fbc68"
},
"responses": {
"200": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/octet-stream",
"Ocp-Apim-Subscription-Key": "{API key}",
"returnFaceAttributes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"returnFaceAttributes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit] Indent

"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"body": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"faceListId": "sample_face_list"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Ocp-Apim-Subscription-Key": "{API key}"
},
"responses": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Ocp-Apim-Subscription-Key": "{API key}",
"start": "sample_group",
"top": 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"body": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"body": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"faceListId": "sample_face_list",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"personGroupId": "abc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"body": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parameters": {
"AzureRegion": "westus",
"Endpoint": "{Endpoint}",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "{API key}",
"body": {
Expand Down