-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Named DiagnosticSettings #1641
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
Named DiagnosticSettings #1641
Changes from 3 commits
a47419e
b004a34
1b32026
b5b15f2
40082bf
ece23e4
15c38b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,271 @@ | ||
| { | ||
| "swagger": "2.0", | ||
| "info": { | ||
| "title": "MonitorManagementClient", | ||
| "version": "2017-05-01-preview" | ||
| }, | ||
| "host": "management.azure.com", | ||
| "schemes": [ | ||
| "https" | ||
| ], | ||
| "consumes": [ | ||
| "application/json" | ||
| ], | ||
| "produces": [ | ||
| "application/json" | ||
| ], | ||
| "security": [ | ||
| { | ||
| "azure_auth": [ | ||
| "user_impersonation" | ||
| ] | ||
| } | ||
| ], | ||
| "securityDefinitions": { | ||
| "azure_auth": { | ||
| "type": "oauth2", | ||
| "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", | ||
| "flow": "implicit", | ||
| "description": "Azure Active Directory OAuth2 Flow", | ||
| "scopes": { | ||
| "user_impersonation": "impersonate your user account" | ||
| } | ||
| } | ||
| }, | ||
| "paths": { | ||
| "/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}": { | ||
| "get": { | ||
| "tags": [ | ||
| "DiagnosticSettingsCategories" | ||
| ], | ||
| "operationId": "DiagnosticSettingsCategory_Get", | ||
| "description": "Gets the diagnostic settings category for the specified resource.", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please indicate some of the typical values resourceUri could take to help customers understand this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is explicit in the example with a logic app.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it too difficult to add it to the description? SDK users rely on description, API docs rely on description.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any change in the description breaks the generation, so it requires more work that touches all our classes. I created a task on us to fix that. |
||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/ResourceUriParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ApiVersionParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/NameParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ErrorResponse" | ||
| } | ||
| }, | ||
| "200": { | ||
| "description": "Successful request to get more information about diagnostic setting category", | ||
| "schema": { | ||
| "$ref": "#/definitions/DiagnosticSettingsCategoryResource" | ||
| }, | ||
| "examples": { | ||
| "application/json": | ||
| { | ||
| "id":"/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime", | ||
| "type":"microsoft.insights/diagnosticSettingsCategories", | ||
| "name":"WorkflowRuntime", | ||
| "location":"eastus", | ||
| "tags":null, | ||
| "properties": { | ||
| "categoryType":"Logs" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Gets the diagnostic setting": { | ||
| "$ref": "./examples/getDiagnosticSettingsCategory.json" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories": { | ||
| "get": { | ||
| "tags": [ | ||
| "DiagnosticSettingsCategories" | ||
| ], | ||
| "operationId": "DiagnosticSettingsCategory_List", | ||
| "description": "Lists the diagnostic settings categories for the specified resource.", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/ResourceUriParameter" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/ApiVersionParameter" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/ErrorResponse" | ||
| } | ||
| }, | ||
| "200": { | ||
| "description": "Successful request to get more information about diagnostic setting category", | ||
| "schema": { | ||
| "$ref": "#/definitions/DiagnosticSettingsCategoryResourceCollection" | ||
| }, | ||
| "examples": { | ||
| "application/json": { | ||
| "value": [ | ||
| { | ||
| "id":"/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime", | ||
| "type":"microsoft.insights/diagnosticSettingsCategories", | ||
| "name":"WorkflowRuntime", | ||
| "location":"eastus", | ||
| "tags":null, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| "properties": { | ||
| "categoryType":"Logs" | ||
| } | ||
| }, | ||
| { | ||
| "id":"/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowMetric", | ||
| "type":"microsoft.insights/diagnosticSettingsCategories", | ||
| "name":"WorkflowMetric", | ||
| "location":"eastus", | ||
| "tags":null, | ||
| "properties": { | ||
| "categoryType":"Metrics" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-examples": { | ||
| "Gets the diagnostic setting": { | ||
| "$ref": "./examples/listDiagnosticSettingsCategories.json" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
| "Resource": { | ||
| "properties": { | ||
| "id": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "Azure resource Id" | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "Azure resource name" | ||
| }, | ||
| "type": { | ||
| "type": "string", | ||
| "readOnly": true, | ||
| "description": "Azure resource type" | ||
| }, | ||
| "location": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think there should be location or tags here. Isnt this a proxy resource.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a proxy resource, but these are populated anyway when the request comes back. Also the resource class is shared by everything. It has been that way for a long time. I believe we could have another class for proxy resource, but I prefer addressing that in a different release.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we get an ACK in email with a workitem that this will be addressed in the next release? Apologies, but this is the only way to get the APIs cleaned up across Azure plat. I wont remember this comment in a few months and no one else on your team will :). So it will most likely be missed in the next rev also.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created a task for this |
||
| "type": "string", | ||
| "description": "Resource location", | ||
| "x-ms-mutability": [ | ||
| "create", | ||
| "read" | ||
| ] | ||
| }, | ||
| "tags": { | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| }, | ||
| "description": "Resource tags" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "location" | ||
| ], | ||
| "x-ms-azure-resource": true, | ||
| "description": "An azure resource object" | ||
| }, | ||
| "DiagnosticSettingsCategory": { | ||
| "properties": { | ||
| "categoryType": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this an enum
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I consider Enum bad practice when serialization is involved. If we introduce a new type, customers will be forced to update the sdk or the serialization will break.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes and that is the recommendation. Enum will make your API more usable. Else how will someone know when you support new types? When you support new types, you add the enum value and increment the APi version
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like enums in serialization, but I am taking this feedback since more people seem to like them. |
||
| "enum": ["Metrics", "Logs"], | ||
| "type": "string", | ||
| "x-ms-enum": { | ||
| "name": "categoryType" | ||
| }, | ||
| "x-nullable": false, | ||
| "description": "The type of the diagnostic settings category." | ||
| } | ||
| }, | ||
| "description": "The diagnostic settings Category." | ||
| }, | ||
| "DiagnosticSettingsCategoryResource": { | ||
| "type": "object", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/Resource" | ||
| } | ||
| ], | ||
| "properties": { | ||
| "properties": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add description. |
||
| "x-ms-client-flatten": true, | ||
| "$ref": "#/definitions/DiagnosticSettingsCategory" | ||
| } | ||
| }, | ||
| "description": "Description of diagnostic setting category." | ||
| }, | ||
| "DiagnosticSettingsCategoryResourceCollection": { | ||
| "properties": { | ||
| "value": { | ||
| "type": "array", | ||
| "items": { | ||
| "$ref": "#/definitions/DiagnosticSettingsCategoryResource" | ||
| }, | ||
| "description": "The collection of diagnostic settings category resources." | ||
| } | ||
| }, | ||
| "description": "Represents a collection of diagnostic setting category resources." | ||
| }, | ||
| "ErrorResponse": { | ||
| "description": "Describes the format of Error response.", | ||
| "type": "object", | ||
| "properties": { | ||
| "code": { | ||
| "description": "Error code", | ||
| "type": "string" | ||
| }, | ||
| "message": { | ||
| "description": "Error message indicating why the operation failed.", | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "parameters": { | ||
| "ApiVersionParameter": { | ||
| "name": "api-version", | ||
| "in": "query", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "Client Api Version." | ||
| }, | ||
| "ResourceUriParameter": { | ||
| "name": "resourceUri", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The identifier of the resource.", | ||
| "x-ms-parameter-location": "method" | ||
| }, | ||
| "NameParameter": { | ||
| "name": "name", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "The name of the diagnostic setting.", | ||
| "x-ms-parameter-location": "method" | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Operations API should be implemented.