Skip to content

Commit

Permalink
Adding azure accounts APIs (#4524)
Browse files Browse the repository at this point in the history
* Adding azure accounts APIs

* Adding Publishing To Regions Status

* fixes

* fixing build errors

* Fixing OAV errors

* Add packaging APIs

* fixing build errors

* apply yangyuan suggestion

* adding response content for gzip apis

* Revert "adding response content for gzip apis"

This reverts commit 3495ee0.

* PackageBinaryStreamObject type as file

* remove PackageBinaryStreamObject and directly add file type in response

* specify body format in packaging response examples

* adding content type in packaging response examples parameters

* maybe a casing issue?

* trying to remove the binary body from response parameters

* Add application-json as a 2nd prdocues format for packaging APIs, to describe the error responses

* fix

* Updating operation ids

* fix oav and remove error responses
  • Loading branch information
omarelhariry authored and praries880 committed Dec 13, 2018
1 parent 65689e3 commit 7d344e2
Show file tree
Hide file tree
Showing 16 changed files with 453 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2719,6 +2719,9 @@
"parameters": [
{
"$ref": "#/parameters/AppIdInPath"
},
{
"$ref": "#/parameters/ForcePath"
}
],
"responses": {
Expand Down Expand Up @@ -2815,7 +2818,13 @@
],
"responses": {
"201": {
"description": "An object containing the application endpoint URL and its assigned endpoint key.",
"description": "An object containing the application endpoint URL, its assigned endpoint key and publishing status.",
"schema": {
"$ref": "#/definitions/ProductionOrStagingEndpointInfo"
}
},
"207": {

This comment has been minimized.

Copy link
@dsgouda

dsgouda Feb 8, 2019

Contributor

@praries880 did you confirm with ARM/API review board that we support 207 status code?

"description": "An object containing the application endpoint URL, its assigned endpoint key and publishing status in case that publishing one or more regions failed.",
"schema": {
"$ref": "#/definitions/ProductionOrStagingEndpointInfo"
}
Expand Down Expand Up @@ -7557,8 +7566,247 @@
}
}
}
},
"/apps/{appId}/azureaccounts": {
"post": {
"description": "Assigns an azure account to the application.",
"operationId": "AzureAccounts_AssignToApp",
"summary": "apps - Assign a LUIS azure account to an application",
"parameters": [
{
"$ref": "#/parameters/AppIdInPath"
},
{
"$ref": "#/parameters/BearerAuthPath"
},
{
"name": "azureAccountInfoObject",
"in": "body",
"schema": {
"$ref": "#/definitions/AzureAccountInfoObject"
},
"description": "The azure account information object."
}
],
"consumes": [
"application/json"
],
"responses": {
"201": {
"description": "Successful operation.",
"schema": {
"$ref": "#/definitions/OperationStatus"
}
},
"default": {
"description": "Error Response.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"Successful Assign azure account request": {
"$ref": "./examples/stats/SuccessfulAssignAzureAccountRequest.json"
}
}
},
"get": {
"description": "Gets the LUIS azure accounts assigned to the application for the user using his ARM token.",
"operationId": "AzureAccounts_GetAssigned",
"summary": "apps - Get LUIS azure accounts assigned to the application",
"parameters": [
{
"$ref": "#/parameters/AppIdInPath"
},
{
"$ref": "#/parameters/BearerAuthPath"
}
],
"responses": {
"200": {
"description": "A list of azure account information objects.",
"schema": {
"$ref": "#/definitions/AzureAccountInfoList"
}
},
"default": {
"description": "Error Response.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"Successful Get assigned azure accounts request": {
"$ref": "./examples/stats/SuccessfulGetAssignedAzureAccountsRequest.json"
}
}
},
"delete": {
"description": "Removes assigned azure account from the application.",
"operationId": "AzureAccounts_RemoveFromApp",
"summary": "apps - Removes an assigned LUIS azure account from an application",
"parameters": [
{
"$ref": "#/parameters/AppIdInPath"
},
{
"$ref": "#/parameters/BearerAuthPath"
},
{
"name": "azureAccountInfoObject",
"in": "body",
"schema": {
"$ref": "#/definitions/AzureAccountInfoObject"
},
"description": "The azure account information object."
}
],
"consumes": [
"application/json"
],
"responses": {
"200": {
"description": "Successful operation.",
"schema": {
"$ref": "#/definitions/OperationStatus"
}
},
"default": {
"description": "Error Response.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"Successful delete assigned azure account request": {
"$ref": "./examples/stats/SuccessfulDeleteAssignedAzureAccountRequest.json"
}
}
}
},
"/azureaccounts": {
"get": {
"description": "Gets the LUIS azure accounts for the user using his ARM token.",
"operationId": "AzureAccounts_GetUserLUISAccounts",
"summary": "user - Get LUIS azure accounts",
"parameters": [
{
"$ref": "#/parameters/BearerAuthPath"
}
],
"responses": {
"200": {
"description": "A list of azure account information objects.",
"schema": {
"$ref": "#/definitions/AzureAccountInfoList"
}
},
"default": {
"description": "Error Response.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/json"
],
"x-ms-examples": {
"Successful Get azure accounts request": {
"$ref": "./examples/stats/SuccessfulGetAzureAccountsRequest.json"
}
}
}
},
"/package/{appId}/slot/{slotName}/gzip": {
"get": {
"description": "Packages published LUIS application as GZip.",
"operationId": "Apps_PackagePublishedApplicationAsGzip",
"summary": "package - Gets published LUIS application package in binary stream GZip format",
"parameters": [
{
"$ref": "#/parameters/AppIdInPath"
},
{
"$ref": "#/parameters/SlotNameInPath"
}
],
"responses": {
"200": {
"description": "The GZip binary stream of the published application package.",
"schema": {
"type": "file"
}
},
"default": {
"description": "Error Response.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/octet-stream",
"application/json"
],
"x-ms-examples": {
"Successful Get published application package request": {
"$ref": "./examples/package/SuccessfulGetTrainedApplicationPackageRequest.json"
}
}
}
},
"/package/{appId}/versions/{versionId}/gzip": {
"get": {
"description": "Packages trained LUIS application as GZip.",
"operationId": "Apps_PackageTrainedApplicationAsGzip",
"summary": "package - Gets trained LUIS application package in binary stream GZip format",
"parameters": [
{
"$ref": "#/parameters/AppIdInPath"
},
{
"$ref": "#/parameters/VersionIdInPath"
}
],
"responses": {
"200": {
"description": "The GZip binary stream of the trained application package.",
"schema": {
"type": "file"
}
},
"default": {
"description": "Error Response.",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
},
"produces": [
"application/octet-stream",
"application/json"
],
"x-ms-examples": {
"Successful Get published application package request": {
"$ref": "./examples/package/SuccessfulGetPublishedApplicationPackageRequest.json"
}
}
}
}
},
},
"definitions": {
"EntityLabelObject": {
"description": "Defines the entity type and position of the extracted entity within the example.",
Expand Down Expand Up @@ -9113,6 +9361,10 @@
"type": "string",
"description": "The endpoint's region."
},
"failedRegions": {
"type": "string",
"description": "Regions where publishing failed."
},
"publishedDateTime": {
"description": "Timestamp when was last published.",
"type": "string"
Expand Down Expand Up @@ -9818,6 +10070,36 @@
"type": "string"
}
}
},
"AzureAccountInfoList": {
"description": "List of Azure account info objects.",
"type": "array",
"items": {
"$ref": "#/definitions/AzureAccountInfoObject"
}
},
"AzureAccountInfoObject": {
"description": "Defines the azure account information object.",
"type": "object",
"required": [
"azureSubscriptionId",
"resourceGroup",
"accountName"
],
"properties": {
"azureSubscriptionId": {
"description": "The id for the azure subscription.",
"type": "string"
},
"resourceGroup": {
"description": "The azure resource group name.",
"type": "string"
},
"accountName": {
"description": "The azure account name.",
"type": "string"
}
}
}
},
"parameters": {
Expand Down Expand Up @@ -9865,6 +10147,15 @@
"format": "uuid",
"x-ms-parameter-location": "method"
},
"SlotNameInPath": {
"name": "slotName",
"in": "path",
"description": "The publishing slot name.",
"required": true,
"type": "string",
"format": "uuid",
"x-ms-parameter-location": "method"
},
"SkipInPath": {
"name": "skip",
"in": "query",
Expand All @@ -9884,6 +10175,14 @@
"maximum": 500,
"x-ms-parameter-location": "method"
},
"ForcePath": {
"name": "force",
"in": "query",
"description": "A flag to indicate whether to force an operation.",
"type": "boolean",
"default": false,
"x-ms-parameter-location": "method"
},
"Endpoint": {
"name": "Endpoint",
"description": "Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).",
Expand All @@ -9892,6 +10191,14 @@
"type": "string",
"in": "path",
"x-ms-skip-url-encoding": true
},
"BearerAuthPath": {
"name": "Authorization",
"in": "header",
"description": "The bearer authorization header to use; containing the user's ARM token used to validate azure accounts information.",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"parameters": {
"Endpoint": "{Endpoint}",
"Ocp-Apim-Subscription-Key": "00000000000000000000000000000000",
"skip": "0",
"take": "100"
"skip": 0,
"take": 100
},
"responses": {
"200": {
Expand Down
Loading

0 comments on commit 7d344e2

Please sign in to comment.