From f3d65db8d45faa3016fc407697411820c430c9a3 Mon Sep 17 00:00:00 2001 From: jjbfour Date: Tue, 30 Apr 2019 11:33:54 -0700 Subject: [PATCH] Add Swagger and Examples for custom resource provider to Azure (#5808) * Add Swagger and Examples for custom resource provider to Azure * Apply suggestions from code review Fix typos in strings for RP. Co-Authored-By: jjbfour --- .../2018-09-01-preview/customproviders.json | 707 ++++++++++++++++++ .../examples/createOrUpdateCustomRP.json | 79 ++ .../examples/deleteCustomRP.json | 13 + .../examples/getCustomRP.json | 36 + .../listCustomRPsByResourceGroup.json | 62 ++ .../examples/listCustomRPsBySubscription.json | 61 ++ .../examples/operationsList.json | 40 + .../examples/updateCustomRP.json | 38 + .../resource-manager/readme.csharp.md | 15 + .../resource-manager/readme.go.md | 19 + .../resource-manager/readme.md | 84 +++ .../resource-manager/readme.nodejs.md | 15 + .../resource-manager/readme.python.md | 21 + .../resource-manager/readme.ruby.md | 19 + .../resource-manager/readme.typescript.md | 13 + 15 files changed, 1222 insertions(+) create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateCustomRP.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteCustomRP.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getCustomRP.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsByResourceGroup.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsBySubscription.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/operationsList.json create mode 100644 specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/updateCustomRP.json create mode 100644 specification/customproviders/resource-manager/readme.csharp.md create mode 100644 specification/customproviders/resource-manager/readme.go.md create mode 100644 specification/customproviders/resource-manager/readme.md create mode 100644 specification/customproviders/resource-manager/readme.nodejs.md create mode 100644 specification/customproviders/resource-manager/readme.python.md create mode 100644 specification/customproviders/resource-manager/readme.ruby.md create mode 100644 specification/customproviders/resource-manager/readme.typescript.md diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json new file mode 100644 index 000000000000..c72b56e15706 --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json @@ -0,0 +1,707 @@ +{ + "swagger": "2.0", + "info": { + "version": "2018-09-01-preview", + "title": "customproviders", + "description": "Allows extension of ARM control plane with custom resource providers.", + "x-ms-code-generation-settings": { + "name": "customprovidersClient" + } + }, + "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": { + "/providers/Microsoft.CustomProviders/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "x-ms-examples": { + "List the custom providers operations": { + "$ref": "examples/operationsList.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "description": "The list of operations provided by Microsoft CustomProviders.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Describe the result of a successful operation.", + "schema": { + "$ref": "#/definitions/ResourceProviderOperationList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}": { + "put": { + "tags": [ + "CustomResourceProvider" + ], + "operationId": "CustomResourceProvider_CreateOrUpdate", + "x-ms-examples": { + "Create or update the custom resource provider": { + "$ref": "examples/createOrUpdateCustomRP.json" + } + }, + "x-ms-long-running-operation": true, + "description": "Creates or updates the custom resource provider.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ResourceProviderNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "resourceProvider", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CustomRPManifest" + }, + "description": "The parameters required to create or update a custom resource provider definition." + } + ], + "responses": { + "201": { + "description": "Created response definition. Resource has been created", + "schema": { + "$ref": "#/definitions/CustomRPManifest" + } + }, + "200": { + "description": "OK response definition. Resource already exists and the changes have been accepted", + "schema": { + "$ref": "#/definitions/CustomRPManifest" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + }, + "delete": { + "tags": [ + "CustomResourceProvider" + ], + "operationId": "CustomResourceProvider_Delete", + "x-ms-examples": { + "Delete a custom resource provider": { + "$ref": "examples/deleteCustomRP.json" + } + }, + "x-ms-long-running-operation": true, + "description": "Deletes the custom resource provider.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ResourceProviderNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK resource deleted" + }, + "202": { + "description": "OK resource delete has been accepted." + }, + "204": { + "description": "OK resource was not found." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + }, + "get": { + "tags": [ + "CustomResourceProvider" + ], + "operationId": "CustomResourceProvider_Get", + "x-ms-examples": { + "Get a custom resource provider": { + "$ref": "examples/getCustomRP.json" + } + }, + "description": "Gets the custom resource provider manifest.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ResourceProviderNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK response definition with the existing resource.", + "schema": { + "$ref": "#/definitions/CustomRPManifest" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + }, + "patch": { + "tags": [ + "CustomResourceProvider" + ], + "operationId": "CustomResourceProvider_Update", + "x-ms-examples": { + "Update a custom resource provider": { + "$ref": "examples/updateCustomRP.json" + } + }, + "description": "Updates an existing custom resource provider. The only value that can be updated via PATCH currently is the tags.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ResourceProviderNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "patchableResource", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ResourceProvidersUpdate" + }, + "description": "The updatable fields of a custom resource provider." + } + ], + "responses": { + "200": { + "description": "OK response. The resource has been updated.", + "schema": { + "$ref": "#/definitions/CustomRPManifest" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders": { + "get": { + "tags": [ + "CustomResourceProvider" + ], + "operationId": "CustomResourceProvider_ListByResourceGroup", + "x-ms-examples": { + "List all custom resource providers on the resourceGroup": { + "$ref": "examples/listCustomRPsByResourceGroup.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "description": "Gets all the custom resource providers within a resource group.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of custom resource providers.", + "schema": { + "$ref": "#/definitions/ListByCustomRPManifest" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.CustomProviders/resourceProviders": { + "get": { + "tags": [ + "CustomResourceProvider" + ], + "operationId": "CustomResourceProvider_ListBySubscription", + "x-ms-examples": { + "List all custom resource providers on the subscription": { + "$ref": "examples/listCustomRPsBySubscription.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "description": "Gets all the custom resource providers within a subscription.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns an array of custom resource providers.", + "schema": { + "$ref": "#/definitions/ListByCustomRPManifest" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ] + } + } + }, + "definitions": { + "ListByCustomRPManifest": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomRPManifest" + }, + "description": "The array of custom resource provider manifests." + }, + "nextLink": { + "type": "string", + "description": "The URL to use for getting the next set of results." + } + }, + "description": "List of custom resource providers." + }, + "CustomRPRouteDefinition": { + "description": "A route definition that defines an action or resource that can be interacted with through the custom resource provider.", + "required": [ + "name", + "endpoint" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the route definition. This becomes the name for the ARM extension (e.g. '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}')" + }, + "endpoint": { + "type": "string", + "description": "The route definition endpoint URI that the custom resource provider will proxy requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path (e.g. 'https://testendpoint/{requestPath}')", + "pattern": "^https:\/\/.+" + } + } + }, + "CustomRPActionRouteDefinition": { + "description": "The route definition for an action implemented by the custom resource provider.", + "properties": { + "routingType": { + "type": "string", + "description": "The routing types that are supported for action requests.", + "x-ms-enum": { + "modelAsString": true, + "name": "ActionRouting" + }, + "enum": [ + "Proxy" + ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/CustomRPRouteDefinition" + } + ] + }, + "CustomRPResourceTypeRouteDefinition": { + "description": "The route definition for a resource implemented by the custom resource provider.", + "properties": { + "routingType": { + "type": "string", + "description": "The routing types that are supported for resource requests.", + "x-ms-enum": { + "modelAsString": true, + "name": "ResourceTypeRouting" + }, + "enum": [ + "Proxy", + "Proxy,Cache" + ] + } + }, + "allOf": [ + { + "$ref": "#/definitions/CustomRPRouteDefinition" + } + ] + }, + "CustomRPValidations": { + "description": "A validation to apply on custom resource provider requests.", + "required": [ + "specification" + ], + "properties": { + "validationType": { + "type": "string", + "description": "The type of validation to run against a matching request.", + "x-ms-enum": { + "modelAsString": true, + "name": "ValidationType" + }, + "enum": [ + "Swagger" + ] + }, + "specification": { + "type": "string", + "description": "A link to the validation specification. The specification must be hosted on raw.githubusercontent.com.", + "pattern": "^https:\/\/raw.githubusercontent.com\/.+" + } + } + }, + "CustomRPManifest": { + "properties": { + "properties": { + "type": "object", + "x-ms-client-flatten": true, + "description": "The manifest for the custom resource provider", + "properties": { + "actions": { + "type": "array", + "description": "A list of actions that the custom resource provider implements.", + "items": { + "$ref": "#/definitions/CustomRPActionRouteDefinition" + } + }, + "resourceTypes": { + "type": "array", + "description": "A list of resource types that the custom resource provider implements.", + "items": { + "$ref": "#/definitions/CustomRPResourceTypeRouteDefinition" + } + }, + "validations": { + "type": "array", + "description": "A list of validations to run on the custom resource provider's requests.", + "items": { + "$ref": "#/definitions/CustomRPValidations" + } + }, + "provisioningState": { + "type": "string", + "description": "The provisioning state of the resource provider.", + "readOnly": true, + "x-ms-enum": { + "modelAsString": true, + "name": "ProvisioningState" + }, + "enum": [ + "Accepted", + "Deleting", + "Running", + "Succeeded", + "Failed" + ] + } + } + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "A manifest file that defines the custom resource provider resources." + }, + "ResourceProviderOperationList": { + "description": "Results of the request to list operations.", + "readOnly": true, + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceProviderOperation" + }, + "description": "List of operations supported by this resource provider." + }, + "nextLink": { + "type": "string", + "description": "The URL to use for getting the next set of results." + } + } + }, + "ResourceProviderOperation": { + "description": "Supported operations of this resource provider.", + "readOnly": true, + "properties": { + "name": { + "description": "Operation name, in format of {provider}/{resource}/{operation}", + "type": "string" + }, + "display": { + "description": "Display metadata associated with the operation.", + "properties": { + "provider": { + "description": "Resource provider: Microsoft Custom Providers.", + "type": "string" + }, + "resource": { + "description": "Resource on which the operation is performed.", + "type": "string" + }, + "operation": { + "description": "Type of operation: get, read, delete, etc.", + "type": "string" + }, + "description": { + "description": "Description of this operation.", + "type": "string" + } + } + } + } + }, + "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" + }, + "location": { + "type": "string", + "description": "Resource location", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "required": [ + "location" + ], + "description": "The resource definition.", + "x-ms-azure-resource": true + }, + "ResourceProvidersUpdate": { + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "description": "custom resource provider update information." + }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, + "ErrorDefinition": { + "description": "Error definition.", + "properties": { + "code": { + "description": "Service specific error code which serves as the substatus for the HTTP error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Description of the error.", + "type": "string", + "readOnly": true + }, + "details": { + "description": "Internal error details.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorDefinition" + }, + "readOnly": true + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)" + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "ResourceProviderNameParameter": { + "name": "resourceProviderName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource provider.", + "minLength": 3, + "maxLength": 64, + "x-ms-parameter-location": "method" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to be used with the HTTP request." + } + } +} diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateCustomRP.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateCustomRP.json new file mode 100644 index 000000000000..70bb120f6f8b --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/createOrUpdateCustomRP.json @@ -0,0 +1,79 @@ +{ + "parameters": { + "resourceProviderName": "newrp", + "resourceGroupName": "testRG", + "api-version": "2018-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceProvider": { + "location": "eastus", + "properties": { + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + } + }, + "responses": { + "201": { + "body": { + "name": "newrp", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Accepted", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + } + }, + "200": { + "body": { + "name": "newrp", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Accepted", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteCustomRP.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteCustomRP.json new file mode 100644 index 000000000000..6169dbc68b95 --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/deleteCustomRP.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "testRG", + "resourceProviderName": "newrp", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getCustomRP.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getCustomRP.json new file mode 100644 index 000000000000..415803d4a073 --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/getCustomRP.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "testRG", + "resourceProviderName": "newrp", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "name": "newrp", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsByResourceGroup.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsByResourceGroup.json new file mode 100644 index 000000000000..f2cef510b6ed --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsByResourceGroup.json @@ -0,0 +1,62 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "testRG", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "name": "newrp1", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp1", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + }, + { + "name": "newrp2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp2", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsBySubscription.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsBySubscription.json new file mode 100644 index 000000000000..3ecd3bf50731 --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/listCustomRPsBySubscription.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "name": "newrp1", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp1", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + }, + { + "name": "newrp2", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG2/providers/Microsoft.CustomProviders/resourceProviders/newrp2", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/operationsList.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/operationsList.json new file mode 100644 index 000000000000..df64c999b8bb --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/operationsList.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.CustomProviders/resourceProviders/read", + "display": { + "provider": "Azure Custom Providers", + "resource": "resourceProviders", + "operation": "List Custom Providers", + "description": "List or get the Custom Providers" + } + }, + { + "name": "Microsoft.CustomProviders/resourceProviders/delete", + "display": { + "provider": "Azure Custom Providers", + "resource": "resourceProviders", + "operation": "List Custom Providers", + "description": "List or get the Custom Providers" + } + }, + { + "name": "Microsoft.CustomProviders/resourceProviders/wrte", + "display": { + "provider": "Azure Custom Providers", + "resource": "resourceProviders", + "operation": "List Custom Providers", + "description": "List or get the Custom Providers" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/updateCustomRP.json b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/updateCustomRP.json new file mode 100644 index 000000000000..17b432061bd0 --- /dev/null +++ b/specification/customproviders/resource-manager/Microsoft.CustomProviders/preview/2018-09-01-preview/examples/updateCustomRP.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "resourceProviderName": "newrp", + "resourceGroupName": "testRG", + "api-version": "2018-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "patchableResource": { + "tags": {} + } + }, + "responses": { + "200": { + "body": { + "name": "newrp", + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.CustomProviders/resourceProviders/newrp", + "type": "Microsoft.CustomProviders/resourceProviders", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "actions": [ + { + "name": "TestAction", + "routingType": "Proxy", + "endpoint": "https://mytestendpoint/" + } + ], + "resourceTypes": [ + { + "name": "TestResource", + "routingType": "Proxy,Cache", + "endpoint": "https://mytestendpoint2/" + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/specification/customproviders/resource-manager/readme.csharp.md b/specification/customproviders/resource-manager/readme.csharp.md new file mode 100644 index 000000000000..cd01c0536486 --- /dev/null +++ b/specification/customproviders/resource-manager/readme.csharp.md @@ -0,0 +1,15 @@ +## 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 + payload-flattening-threshold: 1 + clear-output-folder: true + client-side-validation: false + namespace: Microsoft.CustomProviders + output-folder: $(csharp-sdks-folder)/customproviders/management/Microsoft.CustomProviders/GeneratedProtocol +``` diff --git a/specification/customproviders/resource-manager/readme.go.md b/specification/customproviders/resource-manager/readme.go.md new file mode 100644 index 000000000000..910d6bf0d4fd --- /dev/null +++ b/specification/customproviders/resource-manager/readme.go.md @@ -0,0 +1,19 @@ +## Go + +These settings apply only when `--go` is specified on the command line. + +```yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + namespace: customproviders + clear-output-folder: true +``` + +### Tag: package-2018-09-01-preview and go + +These settings apply only when `--tag=package-2018-09-01-preview --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +```yaml $(tag) == 'package-2018-09-01-preview' && $(go) +output-folder: $(go-sdk-folder)/services/preview/$(namespace)/mgmt/2018-09-01-preview/$(namespace) +``` diff --git a/specification/customproviders/resource-manager/readme.md b/specification/customproviders/resource-manager/readme.md new file mode 100644 index 000000000000..1c4039307b08 --- /dev/null +++ b/specification/customproviders/resource-manager/readme.md @@ -0,0 +1,84 @@ +# customproviders + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for customproviders. + +## Getting Started + +To build the SDKs for My API, simply install AutoRest via `npm` (`npm install -g autorest`) and then run: + +> `autorest readme.md` + +To see additional help and options, run: + +> `autorest --help` + +For other options on installation see [Installing AutoRest](https://aka.ms/autorest/install) on the AutoRest github page. + +--- + +## Configuration + +### Basic Information + +These are the global settings for the customproviders. + +```yaml +openapi-type: arm +tag: package-2018-09-01-preview +``` + +### Tag: package-2018-09-01-preview + +These settings apply only when `--tag=package-2018-09-01-preview` is specified on the command line. + +```yaml $(tag) == 'package-2018-09-01-preview' +input-file: + - Microsoft.CustomProviders/preview/2018-09-01-preview/customproviders.json +``` + +--- + +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +```yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-sdk-for-java + - repo: azure-sdk-for-go + - repo: azure-sdk-for-node + - repo: azure-sdk-for-js + - repo: azure-sdk-for-ruby + after_scripts: + - bundle install && rake arm:regen_all_profiles['azure_mgmt_customproviders'] +``` + +## Go + +See configuration in [readme.go.md](./readme.go.md) + +## Python + +See configuration in [readme.python.md](./readme.python.md) + +## Ruby + +See configuration in [readme.ruby.md](./readme.ruby.md) + +## TypeScript + +See configuration in [readme.typescript.md](./readme.typescript.md) + +## CSharp + +See configuration in [readme.csharp.md](./readme.csharp.md) + +## NodeJS + +See configuration in [readme.nodejs.md](./readme.nodejs.md) diff --git a/specification/customproviders/resource-manager/readme.nodejs.md b/specification/customproviders/resource-manager/readme.nodejs.md new file mode 100644 index 000000000000..1a17e2ae3479 --- /dev/null +++ b/specification/customproviders/resource-manager/readme.nodejs.md @@ -0,0 +1,15 @@ +## Node.js + +These settings apply only when `--nodejs` is specified on the command line. +Please also specify `--node-sdk-folder=`. + +```yaml $(nodejs) +nodejs: + azure-arm: true + payload-flattening-threshold: 1 + generate-license-txt: true + generate-package-json: true + generate-readme-md: false + package-name: customproviders + output-folder: $(node-sdk-folder)/customproviders/Generated +``` diff --git a/specification/customproviders/resource-manager/readme.python.md b/specification/customproviders/resource-manager/readme.python.md new file mode 100644 index 000000000000..6a57ff8a0e0b --- /dev/null +++ b/specification/customproviders/resource-manager/readme.python.md @@ -0,0 +1,21 @@ +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +```yaml $(python) +python: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: Microsoft.CustomProviders + package-name: customproviders + package-version: 2018-09-01-preview + clear-output-folder: true +``` + +```yaml $(python) +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/azure-mgmt/customproviders +``` diff --git a/specification/customproviders/resource-manager/readme.ruby.md b/specification/customproviders/resource-manager/readme.ruby.md new file mode 100644 index 000000000000..64ba3f898eb4 --- /dev/null +++ b/specification/customproviders/resource-manager/readme.ruby.md @@ -0,0 +1,19 @@ +## Ruby + +These settings apply only when `--ruby` is specified on the command line. + +```yaml +package-name: azure_mgmt_customproviders +package-version: 2018-09-01-preview +azure-arm: true +``` + +### Tag: package-2018-09-01-preview and ruby + +These settings apply only when `--tag=package-2018-09-01-preview --ruby` is specified on the command line. +Please also specify `--ruby-sdks-folder=`. + +```yaml $(tag) == 'package-2018-09-01-preview' && $(ruby) +namespace: Microsoft.CustomProviders +output-folder: $(ruby-sdks-folder)/customproviders +``` diff --git a/specification/customproviders/resource-manager/readme.typescript.md b/specification/customproviders/resource-manager/readme.typescript.md new file mode 100644 index 000000000000..21682a2f4bf6 --- /dev/null +++ b/specification/customproviders/resource-manager/readme.typescript.md @@ -0,0 +1,13 @@ +## TypeScript + +These settings apply only when `--typescript` is specified on the command line. +Please also specify `--typescript-sdks-folder=`. + +```yaml $(typescript) +typescript: + azure-arm: true + package-name: "customproviders" + output-folder: "$(typescript-sdks-folder)/packages/customproviders" + payload-flattening-threshold: 1 + generate-metadata: true +```