{ "swagger": "2.0", "info": { "title": "MonitorManagementClient", "x-ms-code-generation-settings": { "name": "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/diagnosticSettings/{name}": { "get": { "tags": [ "DiagnosticSettings" ], "operationId": "DiagnosticSettings_Get", "description": "Gets the active diagnostic settings for the specified resource.", "parameters": [ { "$ref": "#/parameters/ResourceUriParameter" }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/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", "schema": { "$ref": "#/definitions/DiagnosticSettingsResource" } } }, "x-ms-examples": { "Gets the diagnostic setting": { "$ref": "./examples/getDiagnosticSetting.json" } } }, "put": { "tags": [ "DiagnosticSettings" ], "operationId": "DiagnosticSettings_CreateOrUpdate", "description": "Creates or updates diagnostic settings for the specified resource.", "parameters": [ { "$ref": "#/parameters/ResourceUriParameter" }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/DiagnosticSettingsResource" }, "description": "Parameters supplied to the operation." }, { "$ref": "#/parameters/NameParameter" } ], "responses": { "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "200": { "description": "Successful request to create a diagnostic setting", "schema": { "$ref": "#/definitions/DiagnosticSettingsResource" } } }, "x-ms-examples": { "Creates or Updates the diagnostic setting": { "$ref": "./examples/createOrUpdateDiagnosticSetting.json" } } }, "delete": { "tags": [ "DiagnosticSettings" ], "operationId": "DiagnosticSettings_Delete", "description": "Deletes existing diagnostic settings for the specified resource.", "parameters": [ { "$ref": "#/parameters/ResourceUriParameter" }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" }, { "$ref": "#/parameters/NameParameter" } ], "responses": { "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "#/definitions/ErrorResponse" } }, "200": { "description": "Successful request to remove a diagnostic setting" }, "204": { "description": "Successful request to remove a diagnostic setting" } }, "x-ms-examples": { "Deletes the diagnostic setting": { "$ref": "./examples/deleteDiagnosticSetting.json" } } } }, "/{resourceUri}/providers/Microsoft.Insights/diagnosticSettings": { "get": { "tags": [ "DiagnosticSettings" ], "operationId": "DiagnosticSettings_List", "description": "Gets the active diagnostic settings list for the specified resource.", "parameters": [ { "$ref": "#/parameters/ResourceUriParameter" }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/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", "schema": { "$ref": "#/definitions/DiagnosticSettingsResourceCollection" } } }, "x-ms-examples": { "Gets the diagnostic setting": { "$ref": "./examples/listDiagnosticSettings.json" } } } } }, "definitions": { "ProxyOnlyResource": { "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" } }, "x-ms-azure-resource": true, "description": "A proxy only azure resource object" }, "RetentionPolicy": { "properties": { "enabled": { "type": "boolean", "description": "a value indicating whether the retention policy is enabled." }, "days": { "type": "integer", "format": "int32", "minimum": 0, "description": "the number of days for the retention in days. A value of 0 will retain the events indefinitely." } }, "required": [ "enabled", "days" ], "description": "Specifies the retention policy for the log." }, "MetricSettings": { "properties": { "timeGrain": { "type": "string", "format": "duration", "description": "the timegrain of the metric in ISO8601 format." }, "category": { "type": "string", "description": "Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation." }, "enabled": { "type": "boolean", "description": "a value indicating whether this category is enabled." }, "retentionPolicy": { "$ref": "#/definitions/RetentionPolicy", "description": "the retention policy for this category." } }, "required": [ "enabled" ], "description": "Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric." }, "LogSettings": { "properties": { "category": { "type": "string", "description": "Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation." }, "enabled": { "type": "boolean", "description": "a value indicating whether this log is enabled." }, "retentionPolicy": { "$ref": "#/definitions/RetentionPolicy", "description": "the retention policy for this log." } }, "required": [ "enabled" ], "description": "Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log." }, "DiagnosticSettings": { "properties": { "storageAccountId": { "type": "string", "description": "The resource ID of the storage account to which you would like to send Diagnostic Logs." }, "serviceBusRuleId": { "type": "string", "description": "The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility." }, "eventHubAuthorizationRuleId": { "type": "string", "description": "The resource Id for the event hub authorization rule." }, "eventHubName": { "type": "string", "description": "The name of the event hub. If none is specified, the default event hub will be selected." }, "metrics": { "type": "array", "items": { "$ref": "#/definitions/MetricSettings" }, "x-ms-identifiers": [ "category" ], "description": "The list of metric settings." }, "logs": { "type": "array", "items": { "$ref": "#/definitions/LogSettings" }, "x-ms-identifiers": [ "category" ], "description": "The list of logs settings." }, "workspaceId": { "type": "string", "description": "The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2" }, "logAnalyticsDestinationType": { "type": "string", "description": "A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: _. Possible values are: Dedicated and null (null is default.)" } }, "description": "The diagnostic settings." }, "DiagnosticSettingsResource": { "type": "object", "allOf": [ { "$ref": "#/definitions/ProxyOnlyResource" } ], "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/DiagnosticSettings", "description": "Properties of a Diagnostic Settings Resource." } }, "description": "The diagnostic setting resource." }, "DiagnosticSettingsResourceCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/DiagnosticSettingsResource" }, "description": "The collection of diagnostic settings resources;." } }, "description": "Represents a collection of alert rule 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": { "ResourceUriParameter": { "name": "resourceUri", "in": "path", "required": true, "type": "string", "description": "The identifier of the resource.", "x-ms-parameter-location": "method", "x-ms-skip-url-encoding": true }, "NameParameter": { "name": "name", "in": "path", "required": true, "type": "string", "description": "The name of the diagnostic setting.", "x-ms-parameter-location": "method" } } }