Skip to content

Commit

Permalink
[Cognitive Services] March release (add usages operation, addnew/deco…
Browse files Browse the repository at this point in the history
…mission some APIs) (Azure#2544)

* March release initial checkin

1. Add usages operation;
2. Add new APIs;
3. Remove decommisioned APIs

* Add WebLM back

Add WebLM back
  • Loading branch information
felixwa authored and sarangan12 committed Mar 8, 2018
1 parent ab8c049 commit 6d04dab
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,67 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages": {
"get": {
"tags": [
"CognitiveServicesAccounts"
],
"description": "Get usages for the requested Cognitive Services account",
"x-ms-examples": {
"Get Usages": {
"$ref": "./examples/GetUsages.json"
}
},
"operationId": "Accounts_GetUsages",
"parameters": [
{
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group within the user's subscription."
},
{
"name": "accountName",
"in": "path",
"required": true,
"type": "string",
"maxLength": 64,
"minLength": 2,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$",
"description": "The name of Cognitive Services account."
},
{
"$ref": "#/parameters/apiVersionParameter"
},
{
"$ref": "#/parameters/subscriptionIdParameter"
},
{
"$ref": "#/parameters/usageFilterParameter"
}
],
"responses": {
"200": {
"description": "The usages for Cognitive Services account were retrieved successfully.",
"schema": {
"$ref": "#/definitions/UsagesResult"
}
},
"default": {
"description": "Error response describing why the operation failed. If the resource does not exist, 404 (NotFound) will be returned.",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/providers/Microsoft.CognitiveServices/operations": {
"get": {
"tags": [ "Operations" ],
"tags": [
"Operations"
],
"description": "Lists all the available Cognitive Services account operations.",
"operationId": "Operations_List",
"x-ms-examples": {
Expand Down Expand Up @@ -543,7 +601,9 @@
},
"/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability": {
"post": {
"tags": [ "CognitiveServicesAccounts" ],
"tags": [
"CognitiveServicesAccounts"
],
"operationId": "CheckSkuAvailability_List",
"description": "Check available SKUs.",
"x-ms-examples": {
Expand Down Expand Up @@ -622,24 +682,21 @@
"type": "string",
"description": "Required. Indicates the type of cognitive service account.",
"enum": [
"Academic",
"Bing.Autosuggest",
"Bing.Autosuggest.v7",
"Bing.CustomSearch",
"Bing.Search",
"Bing.Search.v7",
"Bing.Speech",
"Bing.SpellCheck",
"Bing.SpellCheck.v7",
"ComputerVision",
"ContentModerator",
"CustomSpeech",
"CustomVision.Prediction",
"CustomVision.Training",
"Emotion",
"Face",
"LUIS",
"Recommendations",
"QnAMaker",
"SpeakerRecognition",
"Speech",
"SpeechTranslation",
"TextAnalytics",
"TextTranslation",
Expand Down Expand Up @@ -869,6 +926,100 @@
},
"description": "Cognitive Services resource type and SKU."
},
"UsagesResult": {
"properties": {
"value": {
"type": "array",
"readOnly": true,
"items": {
"$ref": "#/definitions/Usage"
},
"description": "The list of usages for Cognitive Service account."
}
},
"description": "The response to a list usage request."
},
"Usage": {
"properties": {
"unit": {
"description": "The unit of the metric.",
"$ref": "#/definitions/UnitType"
},
"name": {
"$ref": "#/definitions/MetricName",
"readOnly": true,
"description": "The name information for the metric."
},
"quotaPeriod": {
"type": "string",
"readOnly": true,
"description": "The quota period used to summarize the usage values."
},
"limit": {
"type": "integer",
"readOnly": true,
"description": "Maximum value for this metric."
},
"currentValue": {
"type": "integer",
"readOnly": true,
"description": "Current value for this metric."
},
"nextResetTime": {
"type": "string",
"readOnly": true,
"description": "Next reset time for current quota."
},
"status": {
"type": "string",
"description": "Cognitive Services account quota usage status.",
"enum": [
"Included",
"Blocked",
"InOverage",
"Unknown"
],
"x-ms-enum": {
"name": "QuotaUsageStatus",
"modelAsString": true
}
}
},
"description": "The usage data for a usage request."
},
"MetricName": {
"properties": {
"value": {
"readOnly": true,
"type": "string",
"description": "The name of the metric."
},
"localizedValue": {
"readOnly": true,
"type": "string",
"description": "The friendly name of the metric."
}
},
"description": "A metric name."
},
"UnitType": {
"type": "string",
"readOnly": true,
"description": "The unit of the metric.",
"enum": [
"Count",
"Bytes",
"Seconds",
"Percent",
"CountPerSecond",
"BytesPerSecond",
"Milliseconds"
],
"x-ms-enum": {
"modelAsString": true,
"name": "UnitType"
}
},
"Error": {
"properties": {
"error": {
Expand Down Expand Up @@ -1045,6 +1196,13 @@
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
},
"usageFilterParameter": {
"name": "$filter",
"in": "query",
"required": false,
"type": "string",
"description": "An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names)."
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"parameters": {
"api-version": "2017-04-18",
"subscriptionId": "5a4f5c2e-6983-4ccb-bd34-2196d5b5bbd3",
"resourceGroupName": "felixwa-01",
"accountName": "TestUsage02"
},
"responses": {
"200": {
"body": {
"value": [
{
"name": {
"value": "Face.Transactions",
"localizedValue": "Face.Transactions"
},
"status": "Included",
"currentValue": 3,
"limit": 30000,
"nextResetTime": "2018-03-28T09:33:51Z",
"quotaPeriod": "30.00:00:00",
"unit": "Count"
}
]
}
}
}
}

0 comments on commit 6d04dab

Please sign in to comment.