diff --git a/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/attestation.json b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/attestation.json new file mode 100644 index 000000000000..5f71dd991b87 --- /dev/null +++ b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/attestation.json @@ -0,0 +1,520 @@ + { + "swagger": "2.0", + "info": { + "title": "AttestationManagementClient", + "description": "Various APIs for managing resources in attestation service. This primarily encompasses per-tenant instance management.", + "version": "2018-09-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "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": { + "/providers/Microsoft.Attestation/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "description": "Lists all of the available Azure attestation operations.", + "x-ms-examples": { + "Operations_List": { + "$ref": "./examples/Operations_List.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "x-ms-pageable": { + "nextLinkName": null + }, + "responses": { + "200": { + "description": "List all the operations.", + "schema": { + "$ref": "#/definitions/OperationList" + } + }, + "default": { + "description": "Attestation service error result", + "schema": { + "$ref": "#/definitions/ErrorResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}": { + "get": { + "tags": [ + "AttestationProvider" + ], + "operationId": "AttestationProviders_Get", + "description": "Get the status of Attestation Provider.", + "x-ms-examples": { + "AttestationProviders_Get": { + "$ref": "./examples/Get_AttestationProvider.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "name": "providerName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "Name of the attestation service" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Get the status of attestation Provider", + "schema": { + "$ref": "#/definitions/AttestationProvider" + } + }, + "default": { + "description": "Error result from Attestation service", + "schema": { + "$ref": "#/definitions/ErrorResult" + } + } + } + }, + "put": { + "tags": [ + "AttestationProvider" + ], + "operationId": "AttestationProviders_Create", + "description": "Creates or updates the Attestation Provider.", + "x-ms-examples": { + "AttestationProviders_Create": { + "$ref": "./examples/Create_AttestationProvider.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "name": "providerName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "Name of the attestation service" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "creationParams", + "in": "body", + "description": "Client supplied parameters.", + "schema": { + "$ref": "#/definitions/AttestationServiceCreationParams" + }, + "x-ms-parameter-location": "method" + } + ], + "responses": { + "200": { + "description": "Created or updated attestation service", + "schema": { + "$ref": "#/definitions/AttestationProvider" + } + }, + "201": { + "description": "Created or updated attestation service", + "schema": { + "$ref": "#/definitions/AttestationProvider" + } + }, + "default": { + "description": "Error result from Attestation service", + "schema": { + "$ref": "#/definitions/ErrorResult" + } + } + } + }, + "delete": { + "tags": [ + "AttestationProvider" + ], + "operationId": "AttestationProviders_Delete", + "description": "Delete Attestation Service.", + "x-ms-examples": { + "AttestationProviders_Delete": { + "$ref": "./examples/Delete_AttestationProvider.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "name": "providerName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-]{3,24}$", + "description": "Name of the attestation service" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "Request accepted for deletion of attestation service" + }, + "200": { + "description": "Resource exists and was deleted successfully" + }, + "204": { + "description": "Resource does not exist" + }, + "default": { + "description": "Error result from Attestation service", + "schema": { + "$ref": "#/definitions/ErrorResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Attestation/attestationProviders": { + "get": { + "tags": [ + "AttestationProviders" + ], + "operationId": "AttestationProviders_List", + "description": "Returns a list of attestation providers in a subscription.", + "x-ms-examples": { + "AttestationProviders_List": { + "$ref": "./examples/Get_AttestationProvidersList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "x-ms-pageable": { + "nextLinkName": null + }, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AttestationProviderListResult" + } + }, + "default": { + "description": "Attestation service error result", + "schema": { + "$ref": "#/definitions/ErrorResult" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders": { + "get": { + "tags": [ + "AttestationProviders" + ], + "operationId": "AttestationProviders_ListByResourceGroup", + "description": "Returns attestation providers list in a resource group.", + "x-ms-examples": { + "AttestationProviders_ListByResourceGroup": { + "$ref": "./examples/Get_AttestationProvidersListByResourceGroup.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "x-ms-pageable": { + "nextLinkName": null, + "itemName": "keys" + }, + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AttestationProviderListResult" + } + }, + "default": { + "description": "Attestation service error result", + "schema": { + "$ref": "#/definitions/ErrorResult" + } + } + } + } + } + }, + "definitions": { + "OperationList": { + "properties": { + "value": { + "type": "array", + "description": "List of supported operations.", + "items": { + "$ref": "#/definitions/OperationsDefinition" + } + } + }, + "description": "List of supported operations." + }, + "OperationsDefinition": { + "type": "object", + "description": "Definition object with the name and properties of an operation.", + "properties": { + "name": { + "type": "string", + "description": "Name of the operation." + }, + "display": { + "$ref": "#/definitions/OperationsDisplayDefinition", + "description": "Display object with properties of the operation." + } + } + }, + "OperationsDisplayDefinition": { + "type": "object", + "description": "Display object with properties of the operation.", + "properties": { + "provider": { + "type": "string", + "description": "Resource provider of the operation." + }, + "resource": { + "type": "string", + "description": "Resource for the operation." + }, + "operation": { + "type": "string", + "description": "Short description of the operation." + }, + "description": { + "type": "string", + "description": "Description of the operation." + } + } + }, + "AttestationProvider": { + "description": "Attestation service response message.", + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "x-ms-azure-resource": true, + "properties": { + "properties": { + "type": "object", + "$ref": "#/definitions/StatusResult", + "description": "Describes Attestation service status.", + "x-ms-client-flatten": true + } + } + }, + "StatusResult": { + "type": "object", + "description": "Status of attestation service.", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "description": "Status of attestation service.", + "enum": [ + "Ready", + "NotReady", + "Error" + ], + "x-ms-enum": { + "name": "AttestationServiceStatus", + "modelAsString": true + } + }, + "attestUri": { + "type": "string", + "description": "Gets the uri of attestation service" + } + } + }, + "ErrorResult": { + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "properties": { + "error": { + "type": "object", + "description": "Error object.", + "$ref": "#/definitions/ErrorResponseBody" + } + } + }, + "ErrorResponseBody": { + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Service specific error code" + } + } + }, + "ErrorResponse": { + "type": "object", + "description": "Error response", + "properties": { + "error": { + "type": "object", + "description":"Error response", + "properties": { + "code": { + "type": "string", + "description": "Description of the error." + }, + "message": { + "type": "string", + "description": "Service specific error code." + } + } + } + } + }, + "AttestationProviderListResult": { + "description": "Attestation Providers List.", + "properties": { + "value": { + "type": "array", + "description": "Attestation Provider array.", + "items": { + "$ref": "#/definitions/AttestationProvider" + } + } + } + }, + "AttestationServiceCreationParams": { + "description": "Client supplied parameters passed to attestation service.", + "properties": { + "attestationPolicy": { + "type": "string", + "description":"Name of attestation policy." + } + } + }, + "Resource": { + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "The id of the ARM resource, e.g. \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation/attestationProviders/{providerName}\"" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the attestation service." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Microsoft.Attestation/attestationProviders" + } + }, + "description": "Attestation resource", + "x-ms-azure-resource": true + } + }, + "parameters": { + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "Name of the resource group to which the resource belongs.", + "required": true, + "type": "string", + "maxLength": 90, + "minLength": 1, + "pattern": "^[-\\w\\._\\(\\)]+[^\\.]$", + "x-ms-parameter-location": "method" + }, + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription credentials that uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client API version." + } + } + } diff --git a/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Create_AttestationProvider.json b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Create_AttestationProvider.json new file mode 100644 index 000000000000..888e7373b0d4 --- /dev/null +++ b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Create_AttestationProvider.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "resourceGroupName": "sample-resource-group", + "serviceName": "sampleservicename", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2018-09-01-preview", + "providerName": "providerName1", + "creationParams": "test" + }, + "responses": { + "200": { + "body": { + "id": "subscriptions/subscriptionID/resourceGroups/resourceGroupID/providers/Microsoft.Attestation/attestationProviders/codes1", + "name": "codes1", + "type": "Microsoft.Attestation/attestationProviders", + "properties": { + "status": "Ready", + "attestUri": "https://sample-attestation.attestation.azure.net" + } + } + }, + "201": { + "body": { + "id": "subscriptions/subscriptionID/resourceGroups/resourceGroupID/providers/Microsoft.Attestation/attestationProviders/codes1", + "name": "codes1", + "type": "Microsoft.Attestation/attestationProviders", + "properties": { + "status": "Ready", + "attestUri": "https://sample-attestation.attestation.azure.net" + } + } + } + } +} diff --git a/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Delete_AttestationProvider.json b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Delete_AttestationProvider.json new file mode 100644 index 000000000000..795e261eb948 --- /dev/null +++ b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Delete_AttestationProvider.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "resourceGroupName": "sample-resource-group", + "serviceName": "sampleservicename", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2018-09-01-preview", + "providerName": "providerName1" + }, + "responses": { + "202": { + "description": "Request accepted for deletion of attestation service" + }, + "200": { + "description": "Resource exists and was deleted successfully" + }, + "204": { + "description": "Resource does not exist" + } + } +} diff --git a/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvider.json b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvider.json new file mode 100644 index 000000000000..a91ba4b458b8 --- /dev/null +++ b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvider.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "resourceGroupName": "sample-resource-group", + "serviceName": "sampleservicename", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2018-09-01-preview", + "providerName": "providerName1" + }, + "responses": { + "200": { + "body": { + "id": "subscriptions/subscriptionID/resourceGroups/resourceGroupID/providers/Microsoft.Attestation/attestationProviders/codes1", + "name": "codes1", + "type": "Microsoft.Attestation/attestationProviders", + "properties": { + "status": "Ready" + } + } + } + } +} diff --git a/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvidersList.json b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvidersList.json new file mode 100644 index 000000000000..2751eaf20e85 --- /dev/null +++ b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvidersList.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg1/providers/Microsoft.Attestation/attestationProviders/codes1", + "name": "codes1", + "type": "Microsoft.Attestation/attestationProviders", + "properties": { + "status": "Ready" + } + }, + { + "id": "subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg2/providers/Microsoft.Attestation/attestationProviders/codes2", + "name": "codes2", + "type": "Microsoft.Attestation/attestationProviders", + "properties": { + "status": "Ready" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvidersListByResourceGroup.json b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvidersListByResourceGroup.json new file mode 100644 index 000000000000..c901537506bd --- /dev/null +++ b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Get_AttestationProvidersListByResourceGroup.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "resourceGroupName": "testrg1", + "subscriptionId": "6c96b33e-f5b8-40a6-9011-5cb1c58b0915", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg1/providers/Microsoft.Attestation/attestationProviders/codes1", + "name": "codes1", + "type": "Microsoft.Attestation/attestationProviders", + "properties": { + "status": "Ready" + } + }, + { + "id": "subscriptions/6c96b33e-f5b8-40a6-9011-5cb1c58b0915/resourceGroups/testrg1/providers/Microsoft.Attestation/attestationProviders/codes2", + "name": "codes2", + "type": "Microsoft.Attestation/attestationProviders", + "properties": { + "status": "Ready" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Operations_List.json b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Operations_List.json new file mode 100644 index 000000000000..4e92f79336b0 --- /dev/null +++ b/specification/attestation/resource-manager/Microsoft.Attestation/2018-09-01-preview/examples/Operations_List.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "body": [ + { + "name": "Microsoft.Attestation/attestationProviders/attestation/read", + "display": { + "provider": "Microsoft Azure Attestation", + "resource": "Attestation", + "operation": "Get status of attestation service", + "description": "Get status of attestation service." + } + }, + { + "name": "Microsoft.Attestation/attestationProviders/attestation/write", + "display": { + "provider": "Microsoft Azure Attestation", + "resource": "Attestation", + "operation": "Adds attestation service.", + "description": "Adds attestation service." + } + }, + { + "name": "Microsoft.Attestation/attestationProviders/attestation/delete", + "display": { + "provider": "Microsoft Azure Attestation", + "resource": "Attestation", + "operation": "Removes attestation service", + "description": "Removes attestation service" + } + } + ] + } + } +} \ No newline at end of file diff --git a/specification/attestation/resource-manager/readme.md b/specification/attestation/resource-manager/readme.md new file mode 100644 index 000000000000..c8165c33e5af --- /dev/null +++ b/specification/attestation/resource-manager/readme.md @@ -0,0 +1,60 @@ +# Attestation + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Attestation. + + + +--- +## Getting Started +To build the SDK for Attestation, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +## Configuration + + + +### Basic Information +These are the global settings for the Attestation API. + +``` yaml +openapi-type: arm +tag: package-2018-09 +``` + +### Tag: package-2018-09 + +These settings apply only when `--tag=package-2018-09` is specified on the command line. + +``` yaml $(tag) == 'package-2018-09' +input-file: +- Microsoft.Attestation/2018-09-01-preview/attestation.json +``` + +--- +# Code Generation + + +--- +## C# + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +``` yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + namespace: Microsoft.Azure.Management.Attestation + output-folder: $(csharp-sdks-folder)/attestation/Microsoft.Azure.Management.Attestation/src/Generated + clear-output-folder: true +``` + +