From 49901c0ff81fe30b40679c4290fe845cc3802460 Mon Sep 17 00:00:00 2001 From: sankalpsoni Date: Tue, 10 Jul 2018 01:02:18 +0530 Subject: [PATCH] Swagger for diagnostic settings and association resource types (#3295) * Association resource and example * Guest diagnostic setting * Fixing Travis CI Failure * Fixing travis build * Travis failures * Travis failures * Travis failures * Travis failures * Travis failures * Review comments * Trying out to fix linter error * Trying out to fix linter error * PR Comments * Adding more examples * Build failures * Build failures * Documentation fixes * Documentation fixes * Fixes * Fixes * Fixes * Comments resolution * Comments resolution * Model CI Failure --- ...createOrUpdateGuestDiagnosticSettings.json | 153 +++++ ...ateGuestDiagnosticSettingsAssociation.json | 42 ++ ...eteGuestDiagnosticSettingsAssociation.json | 17 + .../examples/getGuestDiagnosticSettings.json | 168 +++++ ...getGuestDiagnosticSettingsAssociation.json | 22 + ...ateGuestDiagnosticSettingsAssociation.json | 28 + ...uestDiagnosticSettingsAssociation_API.json | 444 ++++++++++++++ .../guestDiagnosticSettings_API.json | 580 ++++++++++++++++++ .../updateServiceDiagnosticSetting.json | 2 +- 9 files changed, 1455 insertions(+), 1 deletion(-) create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettings.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettingsAssociation.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/deleteGuestDiagnosticSettingsAssociation.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettings.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettingsAssociation.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/updateGuestDiagnosticSettingsAssociation.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettingsAssociation_API.json create mode 100644 specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettings_API.json diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettings.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettings.json new file mode 100644 index 000000000000..e57cc6ec6235 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettings.json @@ -0,0 +1,153 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "Default-ResourceGroup", + "diagnosticSettingsName": "SampleDiagSetting", + "api-version": "2018-06-01-preview", + "diagnosticSettings": { + "location": "Global", + "tags": {}, + "properties": { + "osType": "Windows", + "dataSources": [ + { + "kind": "PerformanceCounter", + "configuration": { + "perfCounters": [ + { + "name": "\\Process(_Total)\\%Processor Time", + "samplingPeriod": "PT1M" + }, + { + "name": "\\Process(_Total)\\Working Set", + "samplingPeriod": "PT1M" + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + }, + { + "kind": "ETWProviders", + "configuration": { + "providers": [ + { + "name": "AuditLog", + "id": 1, + "filter": "filter exp" + }, + { + "name": "TraceLog", + "id": 2 + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + }, + { + "kind": "WindowsEventLogs", + "configuration": { + "eventLogs": [ + { + "logName": "Application", + "filter": "SourceName == Xyz AND EventId = \"100\" AND $Xpath/Column=\"DCName\" = \"CatWoman\"" + + }, + { + "logName": "Application", + "filter": "SourceName == Xyz AND EventId = \"100\" AND $Xpath/Column=\"DCName\" = \"BatMan\"" + } + + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + } + + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ResourceGroup/providers/microsoft.insights/guestDiagnosticSettings/SampleDiagSetting", + "name": "productionMachineSetting", + "type": "Microsoft.Insights/guestDiagnosticSettings", + "location": "West US", + "tags": {}, + "properties": { + "osType": "Windows", + "dataSources": [ + { + "kind": "PerformanceCounter", + "configuration": { + "perfCounters": [ + { + "name": "\\Process(_Total)\\%Processor Time", + "samplingPeriod": "PT1M" + }, + { + "name": "\\Process(_Total)\\Working Set", + "samplingPeriod": "PT1M" + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + } + ] + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ResourceGroup/providers/microsoft.insights/guestDiagnosticSettings/SampleDiagSetting", + "name": "SampleDiagSetting", + "type": "Microsoft.Insights/guestDiagnosticSettings", + "location": "West US", + "tags": {}, + "properties": { + "osType": "Windows", + "dataSources": [ + { + "kind": "PerformanceCounter", + "configuration": { + "perfCounters": [ + { + "name": "\\Process(_Total)\\%Processor Time", + "samplingPeriod": "PT1M" + }, + { + "name": "\\Process(_Total)\\Working Set", + "samplingPeriod": "PT1M" + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettingsAssociation.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettingsAssociation.json new file mode 100644 index 000000000000..c35cff6c5de2 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/createOrUpdateGuestDiagnosticSettingsAssociation.json @@ -0,0 +1,42 @@ +{ + "parameters": { + "resourceUri":"subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai", + "associationName": "healthSystemMachineConfigAssociation", + "api-version": "2018-06-01-preview", + "diagnosticSettingsAssociation": { + "location": "Global", + "tags": {}, + "properties": { + "guestDiagnosticSettingsName": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity" + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation", + "type": "Microsoft.Insights/GuestDiagnosticSettingsAssociation", + "name": "healthSystemMachineConfigAssociation", + "location": "Global", + "tags": {}, + "properties": { + "guestDiagnosticSettingsName": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity" + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation", + "type": "Microsoft.Insights/GuestDiagnosticSettingsAssociation", + "name": "healthSystemMachineConfigAssociation", + "location": "Global", + "tags": {}, + "properties": { + "guestDiagnosticSettingsName": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity" + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/deleteGuestDiagnosticSettingsAssociation.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/deleteGuestDiagnosticSettingsAssociation.json new file mode 100644 index 000000000000..2de5c4bb50ef --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/deleteGuestDiagnosticSettingsAssociation.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "resourceUri":"subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai", + "associationName": "healthSystemMachineConfigAssociation", + "api-version": "2018-06-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": null + }, + "204": { + "headers": {}, + "body": null + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettings.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettings.json new file mode 100644 index 000000000000..09a003c11131 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettings.json @@ -0,0 +1,168 @@ +{ + "parameters": { + "subscriptionId": "187f412d-1758-44d9-b052-169e2564721d", + "resourceGroupName": "Default-ResourceGroup", + "diagnosticSettingsName": "productionMachineSetting", + "api-version": "2018-06-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ResourceGroup/providers/microsoft.insights/guestDiagnosticSettings/productionMachineSetting", + "name": "productionMachineSetting", + "type": "Microsoft.Insights/guestDiagnosticSettings", + "location": "West US", + "tags": {}, + "properties": { + "osType": "windows", + "dataSources": [ + { + "kind": "PerformanceCounter", + "configuration": { + "perfCounters": [ + { + "name": "\\Process(_Total)\\%Processor Time", + "samplingPeriod": "PT1M" + }, + { + "name": "\\Process(_Total)\\Working Set", + "samplingPeriod": "PT1M" + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + }, + { + "kind": "ETWProviders", + "configuration": { + "providers": [ + { + "name": "AuditLog", + "id": 1, + "filter": "filter exp" + }, + { + "name": "TraceLog", + "id": 2 + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + }, + { + "kind": "WindowsEventLogs", + "configuration": { + "eventLogs": [ + { + "logName": "Application", + "filter": "SourceName == Xyz AND EventId = \"100\" AND $Xpath/Column=\"DCName\" = \"CatWoman\"" + + }, + { + "logName": "Application", + "filter": "SourceName == Xyz AND EventId = \"100\" AND $Xpath/Column=\"DCName\" = \"BatMan\"" + } + + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + } + + ] + } + } + }, + "202": { + "headers": {}, + "body": { + "id": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ResourceGroup/providers/microsoft.insights/guestDiagnosticSettings/productionMachineSetting", + "name": "productionMachineSetting", + "type": "Microsoft.Insights/guestDiagnosticSettings", + "location": "West US", + "tags": {}, + "properties": { + "osType": "windows", + "dataSources": [ + { + "kind": "PerformanceCounter", + "configuration": { + "perfCounters": [ + { + "name": "\\Process(_Total)\\%Processor Time", + "samplingPeriod": "PT1M" + }, + { + "name": "\\Process(_Total)\\Working Set", + "samplingPeriod": "PT1M" + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + }, + { + "kind": "ETWProviders", + "configuration": { + "providers": [ + { + "name": "AuditLog", + "id": 1, + "filter": "filter exp" + }, + { + "name": "TraceLog", + "id": 2 + } + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + }, + { + "kind": "WindowsEventLogs", + "configuration": { + "eventLogs": [ + { + "logName": "Application", + "filter": "SourceName == Xyz AND EventId = \"100\" AND $Xpath/Column=\"DCName\" = \"CatWoman\"" + + }, + { + "logName": "Application", + "filter": "SourceName == Xyz AND EventId = \"100\" AND $Xpath/Column=\"DCName\" = \"BatMan\"" + } + + ] + }, + "sinks": [ + { + "kind": "LogAnalytics" + } + ] + } + + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettingsAssociation.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettingsAssociation.json new file mode 100644 index 000000000000..5ee3afd4ef02 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/getGuestDiagnosticSettingsAssociation.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "resourceUri":"subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai", + "associationName": "healthSystemMachineConfigAssociation", + "api-version": "2018-06-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation", + "type": "Microsoft.Insights/GuestDiagnosticSettingsAssociation", + "name": "healthSystemMachineConfigAssociation", + "location": "Global", + "tags": {}, + "properties": { + "guestDiagnosticSettingsName": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/SampleDiagnosticSettingsName" + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/updateGuestDiagnosticSettingsAssociation.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/updateGuestDiagnosticSettingsAssociation.json new file mode 100644 index 000000000000..e33341549273 --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/examples/updateGuestDiagnosticSettingsAssociation.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "resourceUri":"subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai", + "associationName": "healthSystemMachineConfigAssociation", + "api-version": "2018-06-01-preview", + "parameters": { + "tags": null, + "properties": { + "guestDiagnosticSettingsName": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity" + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/8498f01b-8064-4e37-856e-318f3c6c685f/resourceGroups/healthsystem/providers/Microsoft.Compute/virtualMachines/eastussojai/providers/microsoft.insights/guestDiagnosticSettingsAssociation/healthSystemMachineConfigAssociation", + "type": "Microsoft.Insights/GuestDiagnosticSettingsAssociation", + "name": "healthSystemMachineConfigAssociation", + "location": "Global", + "tags": null, + "properties": { + "guestDiagnosticSettingsName": "/subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-Association-ResourceGroup/providers/providers/microsoft.insights/guestDiagnosticSettings/vmSettingForSecurity" + } + } + } + } +} \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettingsAssociation_API.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettingsAssociation_API.json new file mode 100644 index 000000000000..80487b3dc64d --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettingsAssociation_API.json @@ -0,0 +1,444 @@ +{ + "swagger": "2.0", + "info": { + "title": "Guest Diagnostic Settings Association API", + "description": "API to Add/Remove/List Guest Diagnostics Settings Association for Azure Resources", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "version": "2018-06-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/guestDiagnosticSettingsAssociation/{associationName}": { + "put": { + "description": "Creates or updates guest diagnostics settings association.", + "tags": [ + "GuestDiagnosticsSettingsAssociation" + ], + "operationId": "guestDiagnosticsSettingsAssociation_CreateOrUpdate", + "x-ms-examples": { + "Create or update an guest diagnostic settings association": { + "$ref": "./examples/createOrUpdateGuestDiagnosticSettingsAssociation.json" + } + }, + "parameters": [ + { + "name": "resourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The fully qualified ID of the resource, including the resource name and resource type.", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/DiagnosticSettingsAssociationNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "diagnosticSettingsAssociation", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationResource" + }, + "description": "The diagnostic settings association to create or update." + } + ], + "responses": { + "200": { + "description": "An existing guest diagnostic settings association was successfully updated.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationResource" + } + }, + "201": { + "description": "A new guest diagnostic settings association was successfully created.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationResource" + } + }, + "default": { + "description": "An error occurred and the guest diagnostic settings association could not be created or updated.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "description": "Gets guest diagnostics association settings.", + "tags": [ + "GuestDiagnosticsSettingsAssociation" + ], + "operationId": "guestDiagnosticsSettingsAssociation_Get", + "x-ms-examples": { + "Create or update an guest diagnostic settings association": { + "$ref": "./examples/getGuestDiagnosticSettingsAssociation.json" + } + }, + "parameters": [ + { + "name": "resourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The fully qualified ID of the resource, including the resource name and resource type.", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/DiagnosticSettingsAssociationNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationResource" + } + }, + "default": { + "description": "An error occurred and the diagnostic settings association could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "description": "Delete guest diagnostics association settings.", + "tags": [ + "GuestDiagnosticsSettingsAssociation" + ], + "x-ms-examples": { + "Create or update an guest diagnostic settings association": { + "$ref": "./examples/deleteGuestDiagnosticSettingsAssociation.json" + } + }, + "operationId": "GuestDiagnosticsSettingsAssociation_Delete", + "parameters": [ + { + "name": "resourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The fully qualified ID of the resource, including the resource name and resource type.", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/DiagnosticSettingsAssociationNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The diagnostic settings association was successfully deleted." + }, + "204": { + "description": "The diagnostic settings association does not exist. It may have already been deleted." + }, + "default": { + "description": "An error occurred and the diagnostic settings association could not be deleted.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "description": "Updates an existing guestDiagnosticsSettingsAssociation Resource. To update other fields use the CreateOrUpdate method", + "operationId": "guestDiagnosticsSettingsAssociation_Update", + "parameters": [ + { + "name": "resourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The fully qualified ID of the resource, including the resource name and resource type.", + "x-ms-skip-url-encoding": true + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/DiagnosticSettingsAssociationNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationResourcePatch" + }, + "description": "Parameters supplied to the operation." + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "An existing guest diagnostics setting resource was successfully updated.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationResource" + } + } + }, + "x-ms-examples": { + "Update a service diagnostic setting": { "$ref": "./examples/updateGuestDiagnosticSettingsAssociation.json" } + } + } + }, + "/subscriptions/{subscriptionId}/providers/microsoft.insights/guestDiagnosticSettingsAssociations": { + "get": { + "description": "Get a list of all guest diagnostic settings association in a subscription.", + "operationId": "guestDiagnosticsSettingsAssociation_List", + "x-ms-pageable": { + "nextLinkName": null + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationList" + } + }, + "default": { + "description": "An error occurred and the list of guest diagnostic settings association could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettingsAssociations": { + "get": { + "description": "Get a list of all guest diagnostic settings association in a resource group.", + "operationId": "guestDiagnosticsSettingsAssociation_ListByResourceGroup", + "x-ms-pageable": { + "nextLinkName": null + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationList" + } + }, + "default": { + "description": "An error occurred and the list of guest diagnostic settings association could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "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" + } + } + }, + "GuestDiagnosticSettingsAssociationList": { + "description": "A list of guest diagnostic settings association.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/GuestDiagnosticSettingsAssociationResource" + }, + "description": "The list of guest diagnostic settings association." + }, + "nextLink": { + "type": "string", + "description": "Provides the link to retrieve the next set of elements." + } + } + }, + "GuestDiagnosticSettingsAssociationResourcePatch": { + "description": "Guest diagnostic setting resource for patch operations", + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/GuestDiagnosticSettingsAssociation", + "description": "The service diagnostics settings for an update operation." + } + } + }, + "GuestDiagnosticSettingsAssociation": { + "description": "A guest diagnostic settings association.", + "properties": { + "guestDiagnosticSettingsName": { + "type": "string", + "description": "The guest diagnostic settings name." + } + }, + "required": [ + "guestDiagnosticSettingsName" + ] + }, + "GuestDiagnosticSettingsAssociationResource": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "properties" + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/GuestDiagnosticSettingsAssociation", + "description": "The diagnostics settings associations of the resource." + } + }, + "description": "Virtual machine guest diagnostic settings resource." + }, + "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": { + "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" + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription Id." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "DiagnosticSettingsAssociationNameParameter": { + "name": "associationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the diagnostic settings association.", + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } + } \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettings_API.json b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettings_API.json new file mode 100644 index 000000000000..092ba0613f6f --- /dev/null +++ b/specification/monitor/resource-manager/microsoft.insights/preview/2018-06-01-preview/guestDiagnosticSettings_API.json @@ -0,0 +1,580 @@ +{ + "swagger": "2.0", + "info": { + "title": "Guest Diagnostic Settings API", + "description": "API to Add/Remove/List Guest Diagnostics Configuration to Azure Resources", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "version": "2018-06-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": { + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettings/{diagnosticSettingsName}": { + "put": { + "description": "Creates or updates guest diagnostics settings.", + "tags": [ + "GuestDiagnosticsSettings" + ], + "operationId": "guestDiagnosticsSettings_CreateOrUpdate", + "x-ms-examples": { + "Create or update a guest diagnostic settings": { + "$ref": "./examples/createOrUpdateGuestDiagnosticSettings.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/DiagnosticSettingNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "diagnosticSettings", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsResource" + }, + "description": "The configuration to create or update." + } + ], + "responses": { + "200": { + "description": "An existing guest diagnostic settings was successfully updated.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsResource" + } + }, + "201": { + "description": "A new guest diagnostic settings was successfully created.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsResource" + } + }, + "default": { + "description": "An error occurred and the guest diagnostic settings could not be created or updated.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "description": "Gets guest diagnostics settings.", + "tags": [ + "GuestDiagnosticsSettings" + ], + "operationId": "guestDiagnosticsSettings_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/DiagnosticSettingNameParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsResource" + } + }, + "default": { + "description": "An error occurred and the diagnostic settings could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "description": "Updates guest diagnostics settings.", + "operationId": "guestDiagnosticsSettings_Update", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/DiagnosticSettingNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsPatchResource" + }, + "description": "The configuration to patch." + } + ], + "responses": { + "200": { + "description": "An existing guest diagnostic settings was successfully updated.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsResource" + } + }, + "201": { + "description": "A new guest diagnostic settings was successfully created.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsResource" + } + }, + "default": { + "description": "An error occurred and the guest diagnostic settings could not be created or updated.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "description": "Delete guest diagnostics settings.", + "tags": [ + "GuestDiagnosticsSettings" + ], + "operationId": "guestDiagnosticsSettings_Delete", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/DiagnosticSettingNameParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The diagnostic settings was successfully deleted." + }, + "204": { + "description": "The diagnostic settings does not exist. It may have already been deleted." + }, + "default": { + "description": "An error occurred and the diagnostic settings could not be deleted.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/microsoft.insights/guestDiagnosticSettings": { + "get": { + "description": "Get a list of all guest diagnostic settings in a subscription.", + "operationId": "guestDiagnosticsSettings_List", + "x-ms-pageable": { + "nextLinkName": null + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsList" + } + }, + "default": { + "description": "An error occurred and the list of guest diagnostic settings could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/guestDiagnosticSettings": { + "get": { + "description": "Get a list of all guest diagnostic settings in a resource group.", + "operationId": "guestDiagnosticsSettings_ListByResourceGroup", + "x-ms-pageable": { + "nextLinkName": null + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The request succeeded.", + "schema": { + "$ref": "#/definitions/GuestDiagnosticSettingsList" + } + }, + "default": { + "description": "An error occurred and the list of guest diagnostic settings could not be retrieved.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "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" + } + } + }, + "GuestDiagnosticSettingsList": { + "description": "A list of guest diagnostic settings.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/GuestDiagnosticSettingsResource" + }, + "description": "The list of guest diagnostic settings." + }, + "nextLink": { + "type": "string", + "description": "Provides the link to retrieve the next set of elements." + } + } + }, + "GuestDiagnosticSettingsResource": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "properties" + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/GuestDiagnosticSettings", + "description": "The diagnostic settings to be applied to azure resources." + } + }, + "description": "Virtual machine guest diagnostics settings resource." + }, + "GuestDiagnosticSettings": { + "description": "Virtual machine diagnostic settings", + "properties": { + "osType": { + "type": "string", + "enum": [ + "Windows", + "Linux" + ], + "description" : "Operating system type for the configuration" + }, + "dataSources": { + "type": "array", + "items": { + "$ref": "#/definitions/DataSource" + }, + "description": "the array of data source object which are configured to collect and send data" + }, + "proxySetting": { + "type": "string" + } + } + }, + "GuestDiagnosticSettingsPatchResource": { + "description": "An diagnostic settings object for the body of patch operations.", + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/GuestDiagnosticSettings", + "description": "The diagnostic settings for an update operation." + } + } + }, + "DataSource": { + "type": "object", + "required": [ + "kind", + "configuration", + "sinks" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "PerformanceCounter", + "ETWProviders", + "WindowsEventLogs" + ], + "description": "Datasource kind" + }, + "configuration": { + "type": "object", + "$ref": "#/definitions/DataSourceConfiguration" + }, + "sinks": { + "type": "array", + "items": { + "$ref": "#/definitions/SinkConfiguration" + } + } + }, + "description": "Data source object contains configuration to collect telemetry and one or more sinks to send that telemetry data to" + }, + "SinkConfiguration": { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "EventHub", + "ApplicationInsights", + "LogAnalytics" + ] + } + } + }, + "DataSourceConfiguration": { + "type": "object", + "properties": { + "providers": { + "type": "array", + "items": { + "$ref": "#/definitions/EtwProviderConfiguration" + }, + "description": "ETW providers configuration" + }, + "perfCounters": { + "type": "array", + "items": { + "$ref": "#/definitions/PerformanceCounterConfiguration" + }, + "description": "Performance counter configuration" + }, + "eventLogs": { + "type": "array", + "items": { + "$ref": "#/definitions/EventLogConfiguration" + }, + "description": "Windows event logs configuration." + } + } + }, + "EtwEventConfiguration": { + "type": "object", + "required": [ + "name", + "id" + ], + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "filter": { + "type": "string" + } + } + }, + "EtwProviderConfiguration": { + "type": "object", + "required": [ + "id", + "events" + ], + "properties": { + "id": { + "type": "string" + }, + "events": { + "type": "array", + "items": { + "$ref": "#/definitions/EtwEventConfiguration" + } + } + } + }, + "PerformanceCounterConfiguration": { + "type": "object", + "required": [ + "name", + "samplingPeriod" + ], + "properties": { + "name": { + "type": "string" + }, + "samplingPeriod": { + "type": "string" + }, + "instance": { + "type": "string" + } + } + }, + "EventLogConfiguration": { + "type": "object", + "required": [ + "logName" + ], + "properties": { + "logName": { + "type": "string" + }, + "filter": { + "type": "string" + } + } + }, + "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": { + "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" + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription Id." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "DiagnosticSettingNameParameter": { + "name": "diagnosticSettingsName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the diagnostic setting.", + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } + } \ No newline at end of file diff --git a/specification/monitor/resource-manager/microsoft.insights/stable/2016-09-01/examples/updateServiceDiagnosticSetting.json b/specification/monitor/resource-manager/microsoft.insights/stable/2016-09-01/examples/updateServiceDiagnosticSetting.json index 9dc9115491a0..da047720e4ff 100644 --- a/specification/monitor/resource-manager/microsoft.insights/stable/2016-09-01/examples/updateServiceDiagnosticSetting.json +++ b/specification/monitor/resource-manager/microsoft.insights/stable/2016-09-01/examples/updateServiceDiagnosticSetting.json @@ -2,7 +2,7 @@ "parameters": { "resourceUri": "/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourcegroups/viruela1/providers/microsoft.logic/workflows/viruela6", "api-version": "2016-09-01", - "serviceDiagnosticSettingsResource": { + "parameters": { "tags": null, "properties": { "storageAccountId":"/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1",