diff --git a/generator/README.md b/generator/README.md index e8c67ef911..9ac89cbe40 100644 --- a/generator/README.md +++ b/generator/README.md @@ -31,11 +31,12 @@ View the Pipeline Configuration [here](/azure-pipelines-autogen.yml). 2. Create a Pull Request from [`autogenerate`](https://github.com/Azure/azure-resource-manager-schemas/tree/autogenerate) to [`master`](https://github.com/Azure/azure-resource-manager-schemas/tree/master). 3. If there are any modifications to [schemas/common/autogeneratedResources.json](/schemas/common/autogeneratedResources.json), push a commit to the autogenerate branch to make any corresponding changes to [schemas/2014-04-01-preview/deploymentTemplate.json](/schemas/2014-04-01-preview/deploymentTemplate.json) and [schemas/2015-01-01/deploymentTemplate.json](/schemas/2015-01-01/deploymentTemplate.json). -#### Onboarding teams to autogeneration pipeline - -1. Run `npm run list-basepaths` to discover the specs repo path containing the swagger definitions. -1. Run `npm run generate-single {basePath}` to generate schemas for them. Save the console output to file. -1. Remove all references to the provider namespace from [schemas/2019-04-01/deploymentTemplate.json](/schemas/2019-04-01/deploymentTemplate.json). -1. Add the {basePath} to the autogenlist array in [autogenlist.ts](./autogenlist.ts). -1. Commit all the changed files, and submit a PR to this repo with title "Onboarding {provider} for autogeneration". Include the full output saved in step 2 as a comment. -1. Ensure all CI tests pass, and ask the team to review the PR (including tool output) to ensure that all expected resources have been detected and generated as expected. +#### Onboarding to the autogeneration pipeline + +1. Follow the steps listed under [Getting Started](#getting-started). The following commands assume you are running in the `generator` directory. +3. Run `npm run list-basepaths` to discover the specs repo path containing the swagger definitions. +4. Run `npm run generate-single {basePath}` to generate schemas for them. Save the console output to file. +5. Manually remove any existing references to your provider namespace (if any) from [schemas/2019-04-01/deploymentTemplate.json](/schemas/2019-04-01/deploymentTemplate.json). +6. Add the {basePath} to the autogenlist array in [autogenlist.ts](./autogenlist.ts). +7. Commit all the changed files, and submit a PR to this repo with title "Onboarding {provider} for autogeneration". Include the full output saved in step 2 as a comment. +8. Ensure all CI tests pass, and ask the team to review the PR (including tool output) to ensure that all expected resources have been detected and generated as expected. diff --git a/generator/autogenlist.ts b/generator/autogenlist.ts index 59b8a2392c..6397408ad2 100644 --- a/generator/autogenlist.ts +++ b/generator/autogenlist.ts @@ -786,6 +786,10 @@ const autoGenList: AutoGenConfig[] = [ { basePath: 'web/resource-manager', namespace: 'Microsoft.Web' + }, + { + basePath: 'deviceupdate/resource-manager', + namespace: 'Microsoft.DeviceUpdate', } ]; diff --git a/generator/generate.ts b/generator/generate.ts index 309a6d4a35..6113c91a8a 100644 --- a/generator/generate.ts +++ b/generator/generate.ts @@ -100,7 +100,7 @@ async function handleGeneratedSchema(readme: string, schemaPath: string, autoGen } async function execAutoRest(tmpFolder: string, params: string[]) { - await executeCmd(__dirname, autorestBinary, params); + await executeCmd(__dirname, `${__dirname}/node_modules/.bin/${autorestBinary}`, params); if (!await fileExists(tmpFolder)) { return []; } diff --git a/onboarded-report/result.json b/onboarded-report/result.json index f398e7cdfe..eea8274208 100644 --- a/onboarded-report/result.json +++ b/onboarded-report/result.json @@ -117,10 +117,8 @@ }, { "basePath": "azurearcdata/resource-manager", - "onboardedToAutogen": "no", - "missing": [ - "Microsoft.AzureArcData" - ], + "onboardedToAutogen": "yes", + "missing": [], "onboarded": [] }, { @@ -157,12 +155,6 @@ "missing": [], "onboarded": [] }, - { - "basePath": "batchai/resource-manager", - "onboardedToAutogen": "yes", - "missing": [], - "onboarded": [] - }, { "basePath": "billing/resource-manager", "onboardedToAutogen": "yes", @@ -906,6 +898,14 @@ "missing": [], "onboarded": [] }, + { + "basePath": "quota/resource-manager", + "onboardedToAutogen": "no", + "missing": [ + "Microsoft.Quota" + ], + "onboarded": [] + }, { "basePath": "recoveryservices/resource-manager", "onboardedToAutogen": "yes", diff --git a/schemas/2020-03-01-preview/Microsoft.DeviceUpdate.json b/schemas/2020-03-01-preview/Microsoft.DeviceUpdate.json new file mode 100644 index 0000000000..7cf65a6d0f --- /dev/null +++ b/schemas/2020-03-01-preview/Microsoft.DeviceUpdate.json @@ -0,0 +1,318 @@ +{ + "id": "https://schema.management.azure.com/schemas/2020-03-01-preview/Microsoft.DeviceUpdate.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.DeviceUpdate", + "description": "Microsoft DeviceUpdate Resource Types", + "resourceDefinitions": { + "accounts": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2020-03-01-preview" + ] + }, + "identity": { + "oneOf": [ + { + "$ref": "#/definitions/Identity" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Identity for the resource." + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives" + }, + "name": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$", + "minLength": 3, + "maxLength": 24 + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Account name." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/AccountProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Device Update account properties." + }, + "resources": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/accounts_instances_childResource" + } + ] + } + }, + "tags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Resource tags." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.DeviceUpdate/accounts" + ] + } + }, + "required": [ + "apiVersion", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.DeviceUpdate/accounts" + }, + "accounts_instances": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2020-03-01-preview" + ] + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives" + }, + "name": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$", + "minLength": 3, + "maxLength": 36 + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Instance name." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/InstanceProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Device Update instance properties." + }, + "tags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Resource tags." + }, + "type": { + "type": "string", + "enum": [ + "Microsoft.DeviceUpdate/accounts/instances" + ] + } + }, + "required": [ + "apiVersion", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.DeviceUpdate/accounts/instances" + } + }, + "definitions": { + "AccountProperties": { + "type": "object", + "properties": {}, + "description": "Device Update account properties." + }, + "accounts_instances_childResource": { + "type": "object", + "properties": { + "apiVersion": { + "type": "string", + "enum": [ + "2020-03-01-preview" + ] + }, + "location": { + "type": "string", + "description": "The geo-location where the resource lives" + }, + "name": { + "oneOf": [ + { + "type": "string", + "pattern": "^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$", + "minLength": 3, + "maxLength": 36 + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Instance name." + }, + "properties": { + "oneOf": [ + { + "$ref": "#/definitions/InstanceProperties" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Device Update instance properties." + }, + "tags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "properties": {} + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Resource tags." + }, + "type": { + "type": "string", + "enum": [ + "instances" + ] + } + }, + "required": [ + "apiVersion", + "location", + "name", + "properties", + "type" + ], + "description": "Microsoft.DeviceUpdate/accounts/instances" + }, + "Identity": { + "type": "object", + "properties": { + "type": { + "oneOf": [ + { + "type": "string", + "enum": [ + "SystemAssigned", + "None" + ] + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "The identity type." + } + }, + "description": "Identity for the resource." + }, + "InstanceProperties": { + "type": "object", + "properties": { + "enableDiagnostics": { + "oneOf": [ + { + "type": "boolean" + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "Enables or Disables the diagnostic logs collection" + }, + "iotHubs": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/IotHubSettings" + } + }, + { + "$ref": "https://schema.management.azure.com/schemas/common/definitions.json#/definitions/expression" + } + ], + "description": "List of IoT Hubs associated with the account." + } + }, + "description": "Device Update instance properties." + }, + "IotHubSettings": { + "type": "object", + "properties": { + "eventHubConnectionString": { + "type": "string", + "description": "EventHub connection string." + }, + "ioTHubConnectionString": { + "type": "string", + "description": "IoTHub connection string." + }, + "resourceId": { + "type": "string", + "minLength": 108, + "maxLength": 244, + "description": "IoTHub resource ID" + } + }, + "required": [ + "resourceId" + ], + "description": "Device Update account integration with IoT Hub settings." + } + } +} \ No newline at end of file diff --git a/schemas/common/autogeneratedResources.json b/schemas/common/autogeneratedResources.json index 4b2cca8608..23d6096f43 100644 --- a/schemas/common/autogeneratedResources.json +++ b/schemas/common/autogeneratedResources.json @@ -4057,6 +4057,12 @@ { "$ref": "https://schema.management.azure.com/schemas/2020-09-01-preview/Microsoft.Devices.Provisioning.json#/resourceDefinitions/provisioningServices_privateEndpointConnections" }, + { + "$ref": "https://schema.management.azure.com/schemas/2020-03-01-preview/Microsoft.DeviceUpdate.json#/resourceDefinitions/accounts" + }, + { + "$ref": "https://schema.management.azure.com/schemas/2020-03-01-preview/Microsoft.DeviceUpdate.json#/resourceDefinitions/accounts_instances" + }, { "$ref": "https://schema.management.azure.com/schemas/2019-07-01-preview/Microsoft.DevOps.json#/resourceDefinitions/pipelines" },