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

[Merge-on-date: (TBA)] Add container log APIs to WebApps.json #1681

Merged
merged 5 commits into from
Dec 8, 2017
Merged
Changes from 2 commits
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 @@ -1913,6 +1913,90 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs": {
Copy link
Contributor

Choose a reason for hiding this comment

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

May be rename the action to getContainerLogs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might want to add a new getContainerLogs later, but as of now we would like to keep the name.

"post": {
"tags": [
"WebApps"
],
"summary": "Gets the last lines of docker logs for the given site",
Copy link
Member

Choose a reason for hiding this comment

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

did you want to add an appropriate produces element? (see IANA Media Types )

 "produces": [
     "text/plain"
  ],

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

@jianghaolu jianghaolu Sep 20, 2017

Choose a reason for hiding this comment

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

Please let me know if I'm missing something here but this endpoint does seem to work for me:

POST https://management.azure.com/subscriptions/ffa52f27-be12-4cad-b1ea-c2c241b6cceb/resourceGroups/linux-test-appgroup/providers/Microsoft.Web/sites/linux-test-app/containerlogs?api-version=2016-08-01
405 Method Not Allowed 749.00 ms
{
  "error": {
    "Message": "The requested resource does not support http method 'POST'."
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The deployment to production happened two weeks ago. I have confirmed it working with my testa pp. Can you please try again?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the endpoint is returning a base 64 encoded content - in this case, the return type shouldn't be file but byte. The file response type should be unencoded (gzipped okay).

Also, the server is actually returning me application/json for content type.

"description": "Gets the last lines of docker logs for the given site",
"operationId": "WebApps_GetWebSiteContainerLogs",
Copy link
Member

Choose a reason for hiding this comment

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

And maybe here too?

 "produces": [
     "application/zip"
  ],

(and for the other APIs too...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for this one - get application/json for content type, which probably requires a server-side fix and the response should be byte.

"produces": [
"text/plain"
],
"parameters": [
{
"$ref": "#/parameters/resourceGroupNameParameter"
},
{
"name": "name",
"in": "path",
"description": "Name of web app.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/subscriptionIdParameter"
},
{
"$ref": "#/parameters/apiVersionParameter"
}
],
"responses": {
"204": {
"description": "No Content"
},
"200": {
"description": "OK",
"schema": {
"type": "file"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download": {
"post": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also this one

POST https://management.azure.com/subscriptions/ffa52f27-be12-4cad-b1ea-c2c241b6cceb/resourceGroups/linux-test-appgroup/providers/Microsoft.Web/sites/linux-test-app/containerlogs/zip/download?api-version=2016-08-01
404 Not Found
The response was empty

"tags": [
"WebApps"
],
"summary": "Gets the ZIP archived docker log files for the given site",
"description": "Gets the ZIP archived docker log files for the given site",
"operationId": "WebApps_GetWebSiteContainerLogsZip",
"produces": [
"application/zip"
],
"parameters": [
{
"$ref": "#/parameters/resourceGroupNameParameter"
},
{
"name": "name",
"in": "path",
"description": "Name of web app.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/subscriptionIdParameter"
},
{
"$ref": "#/parameters/apiVersionParameter"
}
],
"responses": {
"204": {
"description": "No Content"
},
"200": {
"description": "OK",
"schema": {
"type": "file"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs": {
"get": {
"tags": [
Expand Down Expand Up @@ -8405,6 +8489,104 @@
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs": {
"post": {
"tags": [
"WebApps"
],
"summary": "Gets the last lines of docker logs for the given site",
"description": "Gets the last lines of docker logs for the given site",
"operationId": "WebApps_GetWebSiteContainerLogsSlot",
"produces": [
"text/plain"
],
"parameters": [
{
"$ref": "#/parameters/resourceGroupNameParameter"
},
{
"name": "name",
"in": "path",
"description": "Name of web app.",
"required": true,
"type": "string"
},
{
"name": "slot",
"in": "path",
"description": "Name of web app slot. If not specified then will default to production slot.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/subscriptionIdParameter"
},
{
"$ref": "#/parameters/apiVersionParameter"
}
],
"responses": {
"204": {
"description": "No Content"
},
"200": {
"description": "OK",
"schema": {
"type": "file"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download": {
"post": {
"tags": [
"WebApps"
],
"summary": "Gets the ZIP archived docker log files for the given site",
"description": "Gets the ZIP archived docker log files for the given site",
"operationId": "WebApps_GetWebSiteContainerLogsZipSlot",
"produces": [
"application/zip"
],
"parameters": [
{
"$ref": "#/parameters/resourceGroupNameParameter"
},
{
"name": "name",
"in": "path",
"description": "Name of web app.",
"required": true,
"type": "string"
},
{
"name": "slot",
"in": "path",
"description": "Name of web app slot. If not specified then will default to production slot.",
"required": true,
"type": "string"
},
{
"$ref": "#/parameters/subscriptionIdParameter"
},
{
"$ref": "#/parameters/apiVersionParameter"
}
],
"responses": {
"204": {
"description": "No Content"
},
"200": {
"description": "OK",
"schema": {
"type": "file"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs": {
"get": {
"tags": [
Expand Down