From a3a4b8b98edfe05f6cf7ab180de19279d7d1499f Mon Sep 17 00:00:00 2001 From: Chen Lahav Date: Wed, 20 Mar 2019 15:30:06 +0200 Subject: [PATCH 1/2] Adding stable API version for Settings --- .../examples/Settings/GetSetting_example.json | 20 ++ .../Settings/GetSettings_example.json | 32 +++ .../Settings/UpdateSetting_example.json | 29 ++ .../stable/2019-01-01/settings.json | 251 ++++++++++++++++++ 4 files changed, 332 insertions(+) create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json create mode 100644 specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json new file mode 100644 index 000000000000..c7dd9545eb40 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "api-version": "2017-08-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "settingName": "MCAS" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSetting", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json new file mode 100644 index 000000000000..a3be78de6a2b --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "api-version": "2017-08-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSetting", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + }, + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP", + "name": "WDATP", + "kind": "DataExportSetting", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": false + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json new file mode 100644 index 000000000000..a6494654cb18 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "api-version": "2017-08-01-preview", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "settingName": "MCAS", + "setting": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSetting", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSetting", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json new file mode 100644 index 000000000000..190ba7d322ab --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json @@ -0,0 +1,251 @@ +{ + "swagger": "2.0", + "info": { + "title": "Security Center", + "description": "API spec for Microsoft.Security (Azure Security Center) resource provider", + "version": "2017-08-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}/providers/Microsoft.Security/settings": { + "get": { + "x-ms-examples": { + "Get settings of subscription": { + "$ref": "./examples/Settings/GetSettings_example.json" + } + }, + "tags": ["Settings"], + "description": "Settings about different configurations in security center", + "operationId": "Settings_List", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SettingsList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}": { + "get": { + "x-ms-examples": { + "Get a setting on subscription": { + "$ref": "./examples/Settings/GetSetting_example.json" + } + }, + "tags": ["Settings"], + "description": "Settings of different configurations in security center", + "operationId": "Settings_Get", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/SettingName" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Setting" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + }, + "put": { + "x-ms-examples": { + "Update a setting for subscription": { + "$ref": "./examples/Settings/UpdateSetting_example.json" + } + }, + "tags": ["Settings"], + "description": "updating settings about different configurations in security center", + "operationId": "Settings_Update", + "parameters": [ + { + "$ref": "../../../common/v1/types.json#/parameters/ApiVersion" + }, + { + "$ref": "../../../common/v1/types.json#/parameters/SubscriptionId" + }, + { + "$ref": "#/parameters/SettingName" + }, + { + "$ref": "#/parameters/Setting" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Setting" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../common/v1/types.json#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "SettingsList": { + "type": "object", + "description": "Subscription settings list.", + "properties": { + "value": { + "type": "array", + "description": "The settings list.", + "items": { + "$ref": "#/definitions/Setting" + } + }, + "nextLink": { + "readOnly": true, + "type": "string", + "description": "The URI to fetch the next page." + } + } + }, + "Setting": { + "type": "object", + "description": "Represents a security setting in Azure Security Center.", + "discriminator": "kind", + "properties": {}, + "allOf": [ + { + "$ref": "#/definitions/SettingResource" + } + ] + }, + "DataExportSetting": { + "type": "object", + "description": "Represents a data export setting", + "x-ms-discriminator-value": "DataExportSetting", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Data export setting data", + "$ref": "#/definitions/DataExportSettingProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Setting" + } + ] + }, + "SettingResource": { + "type": "object", + "description": "The kind of the security setting", + "properties": { + "kind": { + "type": "string", + "description": "the kind of the settings string (DataExportSetting)", + "enum": ["DataExportSetting", "AlertSuppressionSetting"], + "x-ms-enum": { + "name": "SettingKind", + "modelAsString": true, + "values": [ + { + "value": "DataExportSetting" + }, + { + "value": "AlertSuppressionSetting" + } + ] + } + } + }, + "required": ["kind"], + "allOf": [ + { + "$ref": "../../../common/v1/types.json#/definitions/Resource" + } + ] + }, + "DataExportSettingProperties": { + "type": "object", + "description": "The data export setting properties", + "properties": { + "enabled": { + "type": "boolean", + "description": "Is the data export setting is enabled" + } + }, + "required": ["enabled"] + } + }, + "parameters": { + "SettingName": { + "name": "settingName", + "in": "path", + "required": true, + "type": "string", + "description": "Name of setting: (MCAS/WDATP)", + "enum": ["MCAS", "WDATP"], + "x-ms-parameter-location": "method" + }, + "Setting": { + "name": "setting", + "in": "body", + "required": true, + "description": "Setting object", + "schema": { + "$ref": "#/definitions/Setting" + }, + "x-ms-parameter-location": "method" + } + } +} From 35998a721ea3c6fbae6d5b40f051a3d0a8144ea9 Mon Sep 17 00:00:00 2001 From: Chen Lahav Date: Wed, 20 Mar 2019 16:07:08 +0200 Subject: [PATCH 2/2] Changing new version Settings file --- .../examples/Settings/GetSetting_example.json | 2 +- .../Settings/GetSettings_example.json | 8 ++--- .../Settings/UpdateSetting_example.json | 28 ++++++++--------- .../stable/2019-01-01/settings.json | 2 +- .../security/resource-manager/readme.md | 31 ++++++++++++++++++- 5 files changed, 50 insertions(+), 21 deletions(-) diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json index c7dd9545eb40..ba3e2be064dd 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSetting_example.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2017-08-01-preview", + "api-version": "2019-01-01", "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", "settingName": "MCAS" }, diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json index a3be78de6a2b..fbf29c0a5d83 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/GetSettings_example.json @@ -1,8 +1,8 @@ { - "parameters": { - "api-version": "2017-08-01-preview", - "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" - }, + "parameters": { + "api-version": "2019-01-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" + }, "responses": { "200": { "body": { diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json index a6494654cb18..8893c3bb31d7 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/Settings/UpdateSetting_example.json @@ -1,18 +1,18 @@ { - "parameters": { - "api-version": "2017-08-01-preview", - "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "settingName": "MCAS", - "setting": { - "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", - "name": "MCAS", - "kind": "DataExportSetting", - "type": "Microsoft.Security/settings", - "properties": { - "enabled": true - } - } - }, + "parameters": { + "api-version": "2019-01-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "settingName": "MCAS", + "setting": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", + "name": "MCAS", + "kind": "DataExportSetting", + "type": "Microsoft.Security/settings", + "properties": { + "enabled": true + } + } + }, "responses": { "200": { "body": { diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json index 190ba7d322ab..30b5727119be 100644 --- a/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json +++ b/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/settings.json @@ -3,7 +3,7 @@ "info": { "title": "Security Center", "description": "API spec for Microsoft.Security (Azure Security Center) resource provider", - "version": "2017-08-01-preview" + "version": "2019-01-01" }, "host": "management.azure.com", "schemes": ["https"], diff --git a/specification/security/resource-manager/readme.md b/specification/security/resource-manager/readme.md index 071d9f0aebeb..52e286b85076 100644 --- a/specification/security/resource-manager/readme.md +++ b/specification/security/resource-manager/readme.md @@ -38,7 +38,7 @@ These are the global settings for the Security API. title: SecurityCenter description: API spec for Microsoft.Security (Azure Security Center) resource provider openapi-type: arm -tag: package-composite-v2 +tag: package-composite-v3 ``` ## Composite packages @@ -103,6 +103,35 @@ override-info: title: SecurityCenter ``` +### Tag: package-composite-v3 + +These settings apply only when `--tag=package-composite-v3` is specified on the command line. + +```yaml $(tag) == 'package-composite-v3' +input-file: +- Microsoft.Security/stable/2018-06-01/pricings.json +- Microsoft.Security/stable/2019-01-01/alerts.json +- Microsoft.Security/stable/2019-01-01/settings.json +- Microsoft.Security/preview/2015-06-01-preview/allowedConnections.json +- Microsoft.Security/preview/2015-06-01-preview/discoveredSecuritySolutions.json +- Microsoft.Security/preview/2015-06-01-preview/externalSecuritySolutions.json +- Microsoft.Security/preview/2015-06-01-preview/jitNetworkAccessPolicies.json +- Microsoft.Security/preview/2015-06-01-preview/locations.json +- Microsoft.Security/preview/2015-06-01-preview/operations.json +- Microsoft.Security/preview/2015-06-01-preview/tasks.json +- Microsoft.Security/preview/2015-06-01-preview/topologies.json +- Microsoft.Security/preview/2017-08-01-preview/advancedThreatProtectionSettings.json +- Microsoft.Security/preview/2017-08-01-preview/autoProvisioningSettings.json +- Microsoft.Security/preview/2017-08-01-preview/compliances.json +- Microsoft.Security/preview/2017-08-01-preview/informationProtectionPolicies.json +- Microsoft.Security/preview/2017-08-01-preview/securityContacts.json +- Microsoft.Security/preview/2017-08-01-preview/workspaceSettings.json + +# Needed when there is more than one input file +override-info: + title: SecurityCenter +``` + --- # Code Generation