diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/GetPricingByName_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/GetPricingByName_example.json new file mode 100644 index 000000000000..3f82b0634aaf --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/GetPricingByName_example.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "api-version": "2018-06-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "pricingName": "VirtualMachines" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines", + "name": "VirtualMachines", + "type": "Microsoft.Security/pricings", + "properties": { + "pricingTier": "Standard" + } + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/ListPricings_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/ListPricings_example.json new file mode 100644 index 000000000000..9fd70c6ad741 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/ListPricings_example.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2018-06-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" + }, + "responses": { + "200": { + "body": { + "value": [{ + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines", + "name": "VirtualMachines", + "type": "Microsoft.Security/pricings", + "properties": { + "pricingTier": "Standard" + } + }, + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/SqlServers", + "name": "SqlServers", + "type": "Microsoft.Security/pricings", + "properties": { + "pricingTier": "Standard" + } + }, + { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/AppServices", + "name": "AppServices", + "type": "Microsoft.Security/pricings", + "properties": { + "pricingTier": "Free" + } + }] + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/PutPricingByName_example.json b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/PutPricingByName_example.json new file mode 100644 index 000000000000..dc28fe5af600 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/examples/Pricings/PutPricingByName_example.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2018-06-01", + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "pricingName": "VirtualMachines", + "pricing": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines", + "name": "VirtualMachines", + "type": "Microsoft.Security/pricings", + "properties": { + "pricingTier": "Standard" + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines", + "name": "VirtualMachines", + "type": "Microsoft.Security/pricings", + "properties": { + "pricingTier": "Standard" + } + } + } + } +} \ No newline at end of file diff --git a/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/security.json b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/security.json new file mode 100644 index 000000000000..3073f7d2c049 --- /dev/null +++ b/specification/security/resource-manager/Microsoft.Security/stable/2018-06-01/security.json @@ -0,0 +1,278 @@ +{ + "swagger": "2.0", + "info": { + "title": "Security Center", + "description": "API spec for Microsoft.Security (Azure Security Center) resource provider", + "version": "2018-06-01" + }, + "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/pricings": { + "get": { + "x-ms-examples": { + "Get pricings on subscription": { + "$ref": "./examples/Pricings/ListPricings_example.json" + } + }, + "tags": ["Pricings"], + "description": "Security pricing configurations in the subscription", + "operationId": "Pricings_List", + "parameters": [{ + "$ref": "#/parameters/ApiVersion" + }, { + "$ref": "#/parameters/SubscriptionId" + }], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PricingList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}": { + "get": { + "x-ms-examples": { + "Get pricings on subscription": { + "$ref": "./examples/Pricings/GetPricingByName_example.json" + } + }, + "tags": ["Pricings"], + "description": "Security pricing configuration in the subscription", + "operationId": "Pricings_Get", + "parameters": [{ + "$ref": "#/parameters/ApiVersion" + }, { + "$ref": "#/parameters/SubscriptionId" + }, { + "$ref": "#/parameters/PricingName" + }], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Pricing" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "put": { + "x-ms-examples": { + "Update pricing on subscription": { + "$ref": "./examples/Pricings/PutPricingByName_example.json" + } + }, + "tags": ["Pricings"], + "description": "Security pricing configuration in the subscription", + "operationId": "Pricings_Update", + "parameters": [{ + "$ref": "#/parameters/ApiVersion" + }, { + "$ref": "#/parameters/SubscriptionId" + }, { + "$ref": "#/parameters/PricingName" + }, { + "$ref": "#/parameters/Pricing" + }], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Pricing" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "CloudError": { + "x-ms-external": true, + "type": "object", + "description": "Error response structure.", + "properties": { + "error": { + "x-ms-client-flatten": true, + "description": "Error data", + "$ref": "#/definitions/CloudErrorBody" + } + } + }, + "CloudErrorBody": { + "x-ms-external": true, + "type": "object", + "description": "Error details.", + "properties": { + "code": { + "readOnly": true, + "type": "string", + "description": "An identifier for the error. Codes are invariant and are intended to be consumed programmatically." + }, + "message": { + "readOnly": true, + "type": "string", + "description": "A message describing the error, intended to be suitable for display in a user interface." + } + } + }, + "Resource": { + "type": "object", + "description": "Describes an Azure resource.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type" + } + }, + "x-ms-azure-resource": true + }, + "PricingList": { + "description": "List of pricing configurations response", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "array", + "description": "List of pricing configurations", + "items": { + "$ref": "#/definitions/Pricing" + } + } + } + }, + "Pricing": { + "type": "object", + "description": "Pricing tier will be applied for the scope based on the resource ID", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "description": "Pricing data", + "$ref": "#/definitions/PricingProperties" + } + }, + "allOf": [{ + "$ref": "#/definitions/Resource" + }] + }, + "PricingProperties": { + "type": "object", + "description": "Pricing properties for the relevant scope", + "properties": { + "pricingTier": { + "type": "string", + "description": "The pricing tier value", + "enum": ["Free", "Standard"], + "x-ms-enum": { + "name": "pricingTier", + "modelAsString": true, + "values": [{ + "value": "Free", + "description": "Get free Azure security center experience with basic security features" + }, + { + "value": "Standard", + "description": "Get the standard Azure security center experience with advanced security features" + } + ] + } + }, + "FreeTrialRemainingTime": { + "type": "string", + "format": "duration", + "readOnly": true, + "description": "The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S)." + } + }, + "required": [ + "pricingTier" + ] + } + }, + "parameters": { + "SubscriptionId": { + "name": "subscriptionId", + "in": "path", + "required": true, + "pattern": "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$", + "type": "string", + "description": "Azure subscription ID" + }, + "ApiVersion": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "enum": ["2018-06-01"], + "description": "API version for the operation" + }, + "PricingName": { + "name": "pricingName", + "in": "path", + "required": true, + "type": "string", + "description": "name of the pricing configuration", + "x-ms-parameter-location": "method" + }, + "Pricing": { + "name": "pricing", + "in": "body", + "required": true, + "description": "Pricing object", + "schema": { + "$ref": "#/definitions/Pricing" + }, + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file