Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
@@ -0,0 +1,271 @@
{

Copy link
Copy Markdown
Contributor

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.

"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.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is explicit in the example with a logic app.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tag and location aren't allowed in #/definitions/DiagnosticSettingsCategoryResource.

"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": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make this an enum

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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"
}
}
}
Loading