diff --git a/powershell/cmdlets/class.ts b/powershell/cmdlets/class.ts index 02a10b162d9..6e4b01d967e 100644 --- a/powershell/cmdlets/class.ts +++ b/powershell/cmdlets/class.ts @@ -2468,7 +2468,7 @@ export class NewCmdletClass extends Class { addDefaultInfo(cmdletParameter, vParam); } - const isEnum = propertyType.schema.language.csharp?.enum !== undefined; + const isEnum = propertyType instanceof NewEnumImplementation;; const hasEnum = propertyType instanceof NewArrayOf && propertyType.elementType instanceof NewEnumImplementation; if (isEnum || hasEnum) { cmdletParameter.add(new Attribute(ArgumentCompleterAttribute, { parameters: [`typeof(${hasEnum ? (propertyType).elementType.declaration : propertyType.declaration})`] })); @@ -2613,7 +2613,7 @@ export class NewCmdletClass extends Class { // regularCmdletParameter.add(new Attribute(ArgumentCompleterAttribute, { parameters: [`typeof(${this.declaration})`] })); } - const isEnum = propertyType.schema.language.csharp?.enum !== undefined; + const isEnum = propertyType instanceof NewEnumImplementation; const hasEnum = propertyType instanceof NewArrayOf && propertyType.elementType instanceof NewEnumImplementation; if (isEnum || hasEnum) { regularCmdletParameter.add(new Attribute(ArgumentCompleterAttribute, { parameters: [`typeof(${hasEnum ? (propertyType).elementType.declaration : propertyType.declaration})`] })); diff --git a/powershell/llcsharp/schema/schema-resolver.ts b/powershell/llcsharp/schema/schema-resolver.ts index b62f79a9980..40e25040299 100644 --- a/powershell/llcsharp/schema/schema-resolver.ts +++ b/powershell/llcsharp/schema/schema-resolver.ts @@ -25,6 +25,7 @@ import { EnhancedTypeDeclaration, NewEnhancedTypeDeclaration } from './extended- import { PwshModel } from '../../utils/PwshModel'; import { NewModelState } from '../../utils/model-state'; import { Channel, Host, Session, startSession } from '@azure-tools/autorest-extension-base'; +import { schemaHasEnum } from '../validations'; export class SchemaDefinitionResolver { private readonly cache = new Map(); @@ -244,6 +245,9 @@ export class NewSchemaDefinitionResolver { return new NewString(schema, required); } case SchemaType.SealedChoice: + if (schema.language.default.skip === true) { + return new NewString(schema, required); + } return new NewEnumImplementation(schema, required); case undefined: if (schema.extensions && schema.extensions['x-ms-enum']) { diff --git a/powershell/llcsharp/schema/string.ts b/powershell/llcsharp/schema/string.ts index b49b4ac7b43..a39aa57f1d9 100644 --- a/powershell/llcsharp/schema/string.ts +++ b/powershell/llcsharp/schema/string.ts @@ -398,7 +398,7 @@ ${this.validateEnum(eventListener, property)} return `await ${eventListener}.AssertRegEx(${nameof(property.value)},${property},@"${pattern}");`; } private validateEnum(eventListener: Variable, property: Variable): string { - if (this.schema.type !== SchemaType.SealedChoice) { + if (this.schema.type !== SchemaType.SealedChoice && this.schema.type != SchemaType.Choice) { return ''; } const choiceValues = (this.schema).choices.map((c) => c.value); diff --git a/powershell/plugins/plugin-create-inline-properties.ts b/powershell/plugins/plugin-create-inline-properties.ts index 05c7646bcec..f05e414f25a 100644 --- a/powershell/plugins/plugin-create-inline-properties.ts +++ b/powershell/plugins/plugin-create-inline-properties.ts @@ -270,11 +270,6 @@ function createVirtualProperties(schema: ObjectSchema, stack: Array, thr alias: [], required: property.required || property.language.default.required }); - // dolauli, set constant value and make it readonly, if it is constant - if (property.schema.type === SchemaType.Constant) { - property.language.default.readOnly = true; - property.language.default.constantValue = (property.schema).value.value; - } } // resolve name collisions. diff --git a/powershell/plugins/plugin-tweak-model.ts b/powershell/plugins/plugin-tweak-model.ts index ea298ffe5ea..83a0401fc44 100644 --- a/powershell/plugins/plugin-tweak-model.ts +++ b/powershell/plugins/plugin-tweak-model.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Property, codeModelSchema, CodeModel, StringSchema, ObjectSchema, GroupSchema, isObjectSchema, SchemaType, GroupProperty, ParameterLocation, Operation, Parameter, VirtualParameter, getAllProperties, ImplementationLocation, OperationGroup, Request, SchemaContext, ChoiceSchema, Scheme, Schema, ConstantSchema } from '@azure-tools/codemodel'; +import { Property, SealedChoiceSchema, codeModelSchema, CodeModel, StringSchema, ObjectSchema, GroupSchema, isObjectSchema, SchemaType, GroupProperty, ParameterLocation, Operation, Parameter, VirtualParameter, getAllProperties, ImplementationLocation, OperationGroup, Request, SchemaContext, ChoiceSchema, Scheme, Schema, ConstantSchema } from '@azure-tools/codemodel'; //import { ModelState } from '@azure-tools/codemodel-v3'; //import { KnownMediaType, knownMediaType, ParameterLocation, getPolymorphicBases, isSchemaObject, JsonType, Property, Schema, processCodeModel, StringFormat, codemodel, ModelState } from '@azure-tools/codemodel-v3'; import { pascalCase, deconstruct, fixLeadingNumber, serialize, KnownMediaType } from '@azure-tools/codegen'; @@ -286,6 +286,21 @@ async function tweakModelV2(state: State): Promise { } else if (parameter.schema.type === SchemaType.Constant) { const constantSchema = parameter.schema as ConstantSchema; parameter.language.default.constantValue = constantSchema.value.value; + } else if (parameter.schema.type === SchemaType.SealedChoice) { + const sealedChoiceSchema = parameter.schema as SealedChoiceSchema; + if (sealedChoiceSchema.choices.length === 1) { + parameter.language.default.constantValue = sealedChoiceSchema.choices[0].value; + if (sealedChoiceSchema.language.default.skip !== false) { + sealedChoiceSchema.language.default.skip = true; + } + } + } + } else { + if (parameter.schema.type === SchemaType.SealedChoice) { + const sealedChoiceSchema = parameter.schema as SealedChoiceSchema; + if (sealedChoiceSchema.choices.length === 1) { + sealedChoiceSchema.language.default.skip = false; + } } } } @@ -306,6 +321,21 @@ async function tweakModelV2(state: State): Promise { } else if (property.schema.type === SchemaType.Constant) { const constantSchema = property.schema as ConstantSchema; property.language.default.constantValue = constantSchema.value.value; + } else if (property.schema.type === SchemaType.SealedChoice) { + const sealedChoiceSchema = property.schema as SealedChoiceSchema; + if (sealedChoiceSchema.choices.length === 1) { + property.language.default.constantValue = sealedChoiceSchema.choices[0].value; + if (sealedChoiceSchema.language.default.skip !== false) { + sealedChoiceSchema.language.default.skip = true; + } + } + } + } else { + if (property.schema.type === SchemaType.SealedChoice) { + const sealedChoiceSchema = property.schema as SealedChoiceSchema; + if (sealedChoiceSchema.choices.length === 1) { + sealedChoiceSchema.language.default.skip = false; + } } } } diff --git a/tests-upgrade/datamodels-datatypes-object/swagger.json b/tests-upgrade/datamodels-datatypes-object/swagger.json index b82571a6750..1f3304195bd 100644 --- a/tests-upgrade/datamodels-datatypes-object/swagger.json +++ b/tests-upgrade/datamodels-datatypes-object/swagger.json @@ -1,131 +1,125 @@ { - - "swagger": "2.0", - "info": { - "title": "DatabricksClient", - "version": "2018-04-01", - "description": "ARM Databricks" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "security": [ - { - "azure_auth": [ - "user_impersonation" - ] + "swagger": "2.0", + "info": { + "title": "DatabricksClient", + "version": "2018-04-01", + "description": "ARM Databricks" + }, + "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" } - ], - "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/resourceGroup": { + "get": { + "tags": [ + "Workspaces" + ], + "operationId": "Workspaces_Get", + "description": "Gets the workspace.", + "responses": { + "200": { + "description": "OK-Return workspace." + } } } - }, - "paths": { - "/subscriptions/resourceGroup": { - "get": { - "tags": [ - "Workspaces" - ], - "operationId": "Workspaces_Get", - "description": "Gets the workspace.", - "responses": { - "200": { - "description": "OK-Return workspace." - } - } + } + }, + "definitions": { + "Model": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "integer" } } }, - "definitions": { - "Model": { - "type": "object", - "properties": { - "message": { - "type": "string" - }, - "code": { - "type": "integer" - } - } + "Model2": { + "type": "object", + "properties": { + "id": { + "type": "integer" }, - "Model2": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "username": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "id", - "username" - ] + "username": { + "type": "string" }, - "Model3": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "readOnly": true - }, - "password": { - "type": "string" - } - }, - "required": [ - "id", - "username" - ] - }, - "ContactInfo": { - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "email" - }, - "phone": { - "type": "string" - } + "name": { + "type": "string" } }, - "User": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "contact_info": { - "$ref": "#/definitions/ContactInfo" - } + "required": [ + "id", + "username" + ] + }, + "Model3": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "readOnly": true + }, + "password": { + "type": "string" } }, - "Model4": { - "type": "object", - "minProperties": 2, - "maxProperties": 10 + "required": [ + "id", + "username" + ] + }, + "ContactInfo": { + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "email" + }, + "phone": { + "type": "string" + } + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "contact_info": { + "$ref": "#/definitions/ContactInfo" + } } } + } } \ No newline at end of file diff --git a/tests-upgrade/functions/helpers/AppInsights/readme.md b/tests-upgrade/functions/helpers/AppInsights/readme.md new file mode 100644 index 00000000000..211e1297df0 --- /dev/null +++ b/tests-upgrade/functions/helpers/AppInsights/readme.md @@ -0,0 +1,114 @@ + +# Az.AppInsights +This directory contains the PowerShell module for the AppInsights service. + +--- +## Status +[![Az.AppInsights](https://img.shields.io/powershellgallery/v/Az.AppInsights.svg?style=flat-square&label=Az.AppInsights "Az.AppInsights")](https://www.powershellgallery.com/packages/Az.AppInsights/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.6.0 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.AppInsights`, see [how-to.md](how-to.md). + + +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.Storage.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Storage`. Instead, this sub-module is imported by the `..\custom\Az.Storage.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Storage.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.Storage`. + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +#output-folder: . +#subject-prefix: '' +#title: AppInsights +#module-version: 4.0.0 +apprepo: https://github.com/Azure/azure-rest-api-specs/blob/resource-hybrid-profile +require: + - $(this-folder)/../../readme.azure.md +``` + +## Multi-API/Profile support for AutoRest v3 generators + +AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. + +This block is updated by an automatic script. Edits may be lost! + +``` yaml $(tag) == 'all-api-versions' /* autogenerated */ +# include the azure profile definitions from the standard location +require: $(apprepo)/profiles/readme.md +appinsights: $(apprepo)/specification/applicationinsights/resource-manager + +# all the input files across all versions +input-file: + - $(appinsights)/Microsoft.Insights/stable/2015-05-01/componentApiKeys_API.json + - $(appinsights)/Microsoft.Insights/stable/2015-05-01/components_API.json +``` + +# Directives +``` yaml +directive: + - where: + verb: Clear|Remove|Set + subject: ^Component$ + remove: true + - where: + verb: Get + subject: ^ComponentPurgeStatus$ + remove: true + - where: + verb: New|Remove + subject: ^ApiKey$ + remove: true + - where: + verb: Update + subject: ^ComponentTag$ + remove: true + - where: + subject: ^Component$ + set: + subject: AppInsights + - where: + subject: ^ApiKey$ + set: + subject: AppInsightsApiKey + - where: + verb: Get|New + subject: ^AppInsights$ + hide: true + - where: + verb: Get + subject: ^AppInsightsApiKey$ + hide: true +``` diff --git a/tests-upgrade/functions/helpers/AppInsights/readme.noprofile.md b/tests-upgrade/functions/helpers/AppInsights/readme.noprofile.md new file mode 100644 index 00000000000..635fa81cba0 --- /dev/null +++ b/tests-upgrade/functions/helpers/AppInsights/readme.noprofile.md @@ -0,0 +1,119 @@ + +# Az.AppInsights +This directory contains the PowerShell module for the AppInsights service. + +--- +## Status +[![Az.AppInsights](https://img.shields.io/powershellgallery/v/Az.AppInsights.svg?style=flat-square&label=Az.AppInsights "Az.AppInsights")](https://www.powershellgallery.com/packages/Az.AppInsights/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.6.0 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.AppInsights`, see [how-to.md](how-to.md). + + +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.Storage.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Storage`. Instead, this sub-module is imported by the `..\custom\Az.Storage.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Storage.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.Storage`. + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +#output-folder: . +#subject-prefix: '' +#title: AppInsights +#module-version: 4.0.0 +require: + - $(this-folder)/../../../readme.azure.noprofile.md +``` + +## Multi-API/Profile support for AutoRest v3 generators + +AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. + +This block is updated by an automatic script. Edits may be lost! + +``` yaml +apprepo: https://github.com/Azure/azure-rest-api-specs/blob/resource-hybrid-profile +# include the azure profile definitions from the standard location +appinsights: $(apprepo)/specification/applicationinsights/resource-manager + +# all the input files across all versions +input-file: + - $(appinsights)/Microsoft.Insights/stable/2015-05-01/componentApiKeys_API.json + - $(appinsights)/Microsoft.Insights/stable/2015-05-01/components_API.json + +subject-prefix: '' +``` + +# Directives +``` yaml +directive: + - where: + verb: Clear|Remove|Set + subject: ^Component$ + remove: true + - where: + verb: Get + subject: ^ComponentPurgeStatus$ + remove: true + - where: + verb: New|Remove + subject: ^ApiKey$ + remove: true + - where: + verb: Update + subject: ^ComponentTag$ + remove: true + - where: + subject: ^Component$ + set: + subject: AppInsights + - where: + subject: ^ApiKey$ + set: + subject: AppInsightsApiKey + - where: + verb: Get|New + subject: ^AppInsights$ + hide: true + - where: + verb: Get + subject: ^AppInsightsApiKey$ + hide: true + - where: + subject: ^AppInsights.* + set: + subject-prefix: '' +``` diff --git a/tests-upgrade/functions/helpers/KeyVault/readme.noprofile.md b/tests-upgrade/functions/helpers/KeyVault/readme.noprofile.md new file mode 100644 index 00000000000..9563f3d19db --- /dev/null +++ b/tests-upgrade/functions/helpers/KeyVault/readme.noprofile.md @@ -0,0 +1,21 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../../readme.azure.noprofile.md +input-file: + - $(repo)/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2016-10-01/keyvault.json + +# subject-prefix: '' + +directive: + # Remove unnedded cmdlets + - remove-operation: Operations_List + # hide all cmdlets + - where: + subject: ^VaultDeleted$|^Vault$|^VaultNameAvailability$|^VaultAccessPolicy$ + hide: true + set: + subject-prefix: '' +``` diff --git a/tests-upgrade/functions/helpers/ManagedIdentity/readme.noprofile.md b/tests-upgrade/functions/helpers/ManagedIdentity/readme.noprofile.md new file mode 100644 index 00000000000..182ddc3f059 --- /dev/null +++ b/tests-upgrade/functions/helpers/ManagedIdentity/readme.noprofile.md @@ -0,0 +1,25 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../../readme.azure.noprofile.md +input-file: + - $(repo)/specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2018-11-30/ManagedIdentity.json + +subject-prefix: '' + +directive: + # Remove unnedded cmdlets + - remove-operation: Operations_List + + # Hide Storage Account cmdlets + - where: + subject: ^UserAssignedIdentity.* + hide: true + - where: + subject: ^UserAssignedIdentity.* + set: + subject-prefix: '' + +``` diff --git a/tests-upgrade/functions/helpers/Storage/readme.md b/tests-upgrade/functions/helpers/Storage/readme.md new file mode 100644 index 00000000000..400c26b59a9 --- /dev/null +++ b/tests-upgrade/functions/helpers/Storage/readme.md @@ -0,0 +1,194 @@ + +# Az.Storage +This directory contains the PowerShell module for the Storage service. + +--- +## Status +[![Az.Storage](https://img.shields.io/powershellgallery/v/Az.Storage.svg?style=flat-square&label=Az.Storage "Az.Storage")](https://www.powershellgallery.com/packages/Az.Storage/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.6.0 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.Storage`, see [how-to.md](how-to.md). + + +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.Storage.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Storage`. Instead, this sub-module is imported by the `..\custom\Az.Storage.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Storage.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.Storage`. + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../readme.azure.md + - $(repo)/specification/storage/resource-manager/readme.md + +subject-prefix: '' +# title: Storage +# module-version: 4.0.0 +# skip-model-cmdlets: true + +directive: + # Remove unnedded cmdlets + - where: + subject: ^BlobContainerLegalHold$ + remove: true + - where: + subject: ^BlobContainer$ + remove: true + - where: + subject: ^BlobContainerImmutabilityPolicy$ + remove: true + - where: + subject: ^BlobService$ + remove: true + - where: + subject: ^BlobServiceProperty$ + remove: true + - where: + subject: ^FileService$ + remove: true + - where: + subject: ^FileServiceProperty$ + remove: true + - where: + subject: ^FileShare$ + remove: true + - where: + subject: ^ManagementPolicy$ + remove: true + - where: + subject: ^Operation$ + remove: true + - where: + subject: ^Sku$ + remove: true + - where: + subject: ^StorageAccountProperty$ + remove: true + - where: + subject: ^Usage$ + remove: true + - where: + subject: ^ExtendBlobContainerImmutabilityPolicy$ + remove: true + - where: + subject: ^LeaseBlobContainer$ + remove: true + - where: + subject: ^StorageAccountFailover$ + remove: true + - where: + subject: ^ContainerImmutabilityPolicy$ + remove: true + - where: + subject: ^StorageAccountUserDelegationKey$ + remove: true + - where: + subject: ^StorageAccountNameAvailability$ + remove: true + - where: + verb: Set|New|Remove|Update + subject: ^StorageAccount$ + remove: true + - where: + verb: Get + subject: ^StorageAccountServiceSas$ + remove: true + - where: + verb: Get + subject: ^StorageAccountSas$ + remove: true + - where: + verb: New + subject: ^StorageAccountKey$ + remove: true + + + # Hide Storage Account cmdlets + - where: + subject: ^StorageAccount.* + hide: true + - where: + subject: ^StorageAccount.* + set: + subject-prefix: '' + + # StorageAccount + - where: + subject: StorageAccount.* + parameter-name: AccountName + set: + parameter-name: Name + - where: + subject: StorageAccount + parameter-name: CustomDomainUseSubDomainName + set: + parameter-name: UseSubDomain + - where: + subject: StorageAccount + parameter-name: NetworkAcls(.*) + set: + parameter-name: NetworkRuleSet$1 + - where: + subject: StorageAccount + parameter-name: BlobEnabled + set: + parameter-name: EncryptBlobService + - where: + subject: StorageAccount + parameter-name: FileEnabled + set: + parameter-name: EncryptFileService + - where: + subject: StorageAccount + parameter-name: QueueEnabled + set: + parameter-name: EncryptQueueService + - where: + subject: StorageAccount + parameter-name: TableEnabled + set: + parameter-name: EncryptTableService + - where: + subject: ^StorageAccount$ + parameter-name: Keyvaultproperty(.*) + set: + parameter-name: $1 + - where: + subject: ^StorageAccount$ + parameter-name: IsHnsEnabled + set: + parameter-name: EnableHierarchicalNamespace +``` diff --git a/tests-upgrade/functions/helpers/Storage/readme.noprofile.md b/tests-upgrade/functions/helpers/Storage/readme.noprofile.md new file mode 100644 index 00000000000..8aabb9ae9db --- /dev/null +++ b/tests-upgrade/functions/helpers/Storage/readme.noprofile.md @@ -0,0 +1,196 @@ + +# Az.Storage +This directory contains the PowerShell module for the Storage service. + +--- +## Status +[![Az.Storage](https://img.shields.io/powershellgallery/v/Az.Storage.svg?style=flat-square&label=Az.Storage "Az.Storage")](https://www.powershellgallery.com/packages/Az.Storage/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.6.0 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.Storage`, see [how-to.md](how-to.md). + + +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.Storage.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Storage`. Instead, this sub-module is imported by the `..\custom\Az.Storage.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Storage.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.Storage`. + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../../readme.azure.noprofile.md +input-file: + #- $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2019-04-01/storage.json + - $(repo)/specification/storage/resource-manager/Microsoft.Storage/stable/2019-04-01/blob.json + +subject-prefix: '' +# title: Storage +# module-version: 4.0.0 +# skip-model-cmdlets: true + +directive: + # Remove unnedded cmdlets + - where: + subject: ^BlobContainerLegalHold$ + remove: true + - where: + subject: ^BlobContainer$ + remove: true + - where: + subject: ^BlobContainerImmutabilityPolicy$ + remove: true + - where: + subject: ^BlobService$ + remove: true + - where: + subject: ^BlobServiceProperty$ + remove: true + - where: + subject: ^FileService$ + remove: true + - where: + subject: ^FileServiceProperty$ + remove: true + - where: + subject: ^FileShare$ + remove: true + - where: + subject: ^ManagementPolicy$ + remove: true + - where: + subject: ^Operation$ + remove: true + - where: + subject: ^Sku$ + remove: true + - where: + subject: ^StorageAccountProperty$ + remove: true + - where: + subject: ^Usage$ + remove: true + - where: + subject: ^ExtendBlobContainerImmutabilityPolicy$ + remove: true + - where: + subject: ^LeaseBlobContainer$ + remove: true + - where: + subject: ^StorageAccountFailover$ + remove: true + - where: + subject: ^ContainerImmutabilityPolicy$ + remove: true + - where: + subject: ^StorageAccountUserDelegationKey$ + remove: true + - where: + subject: ^StorageAccountNameAvailability$ + remove: true + - where: + verb: Set|New|Remove|Update + subject: ^StorageAccount$ + remove: true + - where: + verb: Get + subject: ^StorageAccountServiceSas$ + remove: true + - where: + verb: Get + subject: ^StorageAccountSas$ + remove: true + - where: + verb: New + subject: ^StorageAccountKey$ + remove: true + + + # Hide Storage Account cmdlets + - where: + subject: ^StorageAccount.* + hide: true + - where: + subject: ^StorageAccount.* + set: + subject-prefix: '' + + # StorageAccount + - where: + subject: StorageAccount.* + parameter-name: AccountName + set: + parameter-name: Name + - where: + subject: StorageAccount + parameter-name: CustomDomainUseSubDomainName + set: + parameter-name: UseSubDomain + - where: + subject: StorageAccount + parameter-name: NetworkAcls(.*) + set: + parameter-name: NetworkRuleSet$1 + - where: + subject: StorageAccount + parameter-name: BlobEnabled + set: + parameter-name: EncryptBlobService + - where: + subject: StorageAccount + parameter-name: FileEnabled + set: + parameter-name: EncryptFileService + - where: + subject: StorageAccount + parameter-name: QueueEnabled + set: + parameter-name: EncryptQueueService + - where: + subject: StorageAccount + parameter-name: TableEnabled + set: + parameter-name: EncryptTableService + - where: + subject: ^StorageAccount$ + parameter-name: Keyvaultproperty(.*) + set: + parameter-name: $1 + - where: + subject: ^StorageAccount$ + parameter-name: IsHnsEnabled + set: + parameter-name: EnableHierarchicalNamespace +``` diff --git a/tests-upgrade/functions/readme.md b/tests-upgrade/functions/readme.md new file mode 100644 index 00000000000..7b297123629 --- /dev/null +++ b/tests-upgrade/functions/readme.md @@ -0,0 +1,506 @@ + +# Az.Functions +This directory contains the PowerShell module for the Functions service. + +--- +## Status +[![Az.Functions](https://img.shields.io/powershellgallery/v/Az.Functions.svg?style=flat-square&label=Az.Functions "Az.Functions")](https://www.powershellgallery.com/packages/Az.Functions/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.7.4 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.Functions`, see [how-to.md](how-to.md). + + +--- +## Generation Requirements +Use of the beta version of `autorest.powershell` generator requires the following: +- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred) + - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes. +> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended. +- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@beta`
  +- PowerShell 6.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
  +- .NET Core SDK 2.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
  + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +### Suppression + +``` yaml +directive: + - suppress: XmsResourceInPutResponse + from: WebApps.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}"].put + reason: Model type is not an Azure resource + - suppress: RequiredPropertiesMissingInResourceModel + from: WebApps.json + where: $.definitions.KeyInfo + reason: Model type is not an Azure resource + - suppress: BodyTopLevelProperties + from: WebApps.json + where: $.definitions.KeyInfo.properties + reason: Model type is not an Azure resource +``` + +``` yaml +branch: powershell-function +require: + - $(this-folder)/../readme.azure.noprofile.md +input-file: + - $(repo)/specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2019-08-01/AppServiceCertificateOrders.json + - $(repo)/specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2019-08-01/CertificateRegistrationProvider.json + - $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/Domains.json + - $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/TopLevelDomains.json + - $(repo)/specification/web/resource-manager/Microsoft.DomainRegistration/stable/2019-08-01/DomainRegistrationProvider.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Certificates.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/CommonDefinitions.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/DeletedWebApps.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Diagnostics.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Provider.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/Recommendations.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/ResourceProvider.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/WebApps.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/StaticSites.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/AppServiceEnvironments.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/AppServicePlans.json + - $(repo)/specification/web/resource-manager/Microsoft.Web/stable/2019-08-01/ResourceHealthMetadata.json +module-version: 1.0.1 +title: Functions +subject-prefix: '' + +metadata: + authors: Microsoft Corporation + owners: Microsoft Corporation + description: 'Microsoft Azure PowerShell - Azure Functions service cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core.\n\nFor information on Azure Functions, please visit the following: https://docs.microsoft.com/azure/azure-functions/' + copyright: Microsoft Corporation. All rights reserved. + tags: Azure ResourceManager ARM PSModule Functions + companyName: Microsoft Corporation + requireLicenseAcceptance: true + licenseUri: https://aka.ms/azps-license + projectUri: https://github.com/Azure/azure-powershell + +directive: + - from: WebApps.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}"].delete.responses.200 + transform: delete $.schema + - from: WebApps.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}"].delete.responses.202 + transform: delete $.schema + - from: WebApps.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}"].delete.responses.204 + transform: delete $.schema + - from: Diagnostics.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute"].post + transform: delete $."x-ms-examples" + - from: swagger-document + where: $..produces + #transform: $ = $.filter( each => each === 'application/json'); + transform: $ = ["application/json"]; + reason: this spec adds produces application/xml and text/json erronously. + - where: + subject: Operation + hide: true + - where: $.definitions.Identifier.properties + suppress: R3019 +# Cmdlet renames + - where: + verb: Backup|Get|New|Remove|Restart|Restore|Publish|Set|Start|Stop|Update + subject: WebApp + variant: (.*) + set: + subject: FunctionApp + hide: true + - where: + subject: WebAppFunction + set: + subject: Function + hide: true + - where: + subject: GeoRegion + set: + subject: FunctionAppAvailableLocation + hide: true + - where: + subject: AppServicePlan + set: + subject: FunctionAppPlan + hide: true + # Formats.ps1xml + - where: + model-name: Site + set: + suppress-format: true + - where: + model-name: GeoRegion + set: + format-table: + properties: + - Name + - where: + model-name: AppServicePlan + set: + suppress-format: true + # Parameter renames + - where: + subject: Function + parameter-name: Name + set: + parameter-name: FunctionAppName + hide: true + - where: + verb: New + subject: Connection + parameter-name: Name + clear-alias: true + - where: + verb: Set + subject: Connection + parameter-name: Name + clear-alias: true +# Cmdlets to hide + - where: + subject: (.*)WebAppApplicationSetting(.*) + hide: true + - where: + subject: (.*)AzWebAppSlot(.*) + hide: true + - where: + subject: (.*)NameAvailability(.*) + hide: true + - where: + subject: (.*)WebAppConfiguration(.*) + hide: true +# Cmdlets to remove + - where: + subject: WebAppPremierAddOn(.*) + remove: true + - where: + subject: WebAppVnetConnection(.*) + remove: true + - where: + subject: WebAppSwiftVirtualNetworkConnection(.*) + remove: true + - where: + subject: WebAppRelayServiceConnection(.*) + remove: true + - where: + subject: WebAppPremierAddOnSlot(.*) + remove: true + - where: + subject: WebAppHybridConnection(.*) + remove: true + - where: + subject: WebAppDomainOwnershipIdentifier(.*) + remove: true + - where: + subject: SiteVnetConnection(.*) + remove: true + - where: + subject: SiteRelayServiceConnection(.*) + remove: true + - where: + subject: (.*)Domain(.*) + remove: true + - where: + subject: (.*)Certificate(.*) + remove: true + - where: + subject: AppServicePlanVnetRoute(.*) + remove: true + - where: + subject: AppServiceEnvironmentWorkerPool(.*) + remove: true + - where: + subject: AppServiceEnvironmentMultiRolePool(.*) + remove: true + - where: + subject: WebAppCustomHostname(.*) + remove: true + - where: + subject: HostingEnvironmentVnet(.*) + remove: true + - where: + subject: GlobalDomainRegistrationDomainPurchase(.*) + remove: true + - where: + subject: WebAppWebSiteNetworkTrace(.*) + remove: true + - where: + subject: WebAppWebSiteNetworkTraceSlot(.*) + remove: true + - where: + subject: WebAppNetworkTrace(.*) + remove: true + - where: + subject: WebAppPublicCertificate(.*) + remove: true + - where: + subject: WebAppDiagnosticLog(.*) + remove: true + - where: + subject: WebAppPerfMonCounter(.*) + remove: true + - where: + subject: WebAppMigrateMySqlStatus(.*) + remove: true + - where: + subject: WebAppMetric(.*) + remove: true + - where: + subject: SiteNetworkFeature(.*) + remove: true + - where: + subject: ResourceHealthMetadata(.*) + remove: true + - where: + subject: (.*)MultiRolePoolInstanceMetric(.*) + remove: true + - where: + subject: (.*)MultiRoleMetricDefinition(.*) + remove: true + - where: + subject: (.*)PremierAddOn(.*) + remove: true + - where: + subject: (.*)WebAppSlot(.*) + remove: true + - where: + subject: (.*)ConnectionConsent(.*) + remove: true + - where: + subject: (.*)WebAppBackup(.*) + remove: true + - where: + subject: (.*)AppServiceEnvironment(.*) + remove: true + - where: + subject: (.*)AppServicePlanHybridConnection(.*) + remove: true + - where: + subject: (.*)AppServicePlanMetric(.*) + remove: true + - where: + subject: (.*)BillingMeter(.*) + remove: true + - where: + subject: (.*)DeletedWebApp(.*) + remove: true + - where: + subject: (.*)DiagnosticSite(.*) + remove: true + - where: + subject: (.*)Global(.*) + remove: true + - where: + subject: (.*)Recommendation(.*) + remove: true + - where: + subject: (.*)ManagedApi(.*) + remove: true + - where: + subject: (.*)ManagedHosting(.*) + remove: true + - where: + subject: (.*)Provider(.*) + remove: true + - where: + subject: (.*)ServerFarm(.*) + remove: true + - where: + subject: (.*)SiteInstance(.*) + remove: true + - where: + subject: (.*)SiteOperation(.*) + remove: true + - where: + subject: (.*)SourceControl(.*) + remove: true + - where: + subject: (.*)SubscriptionDeployment(.*) + remove: true + - where: + subject: (.*)WebAppAzureStorage(.*) + remove: true + - where: + subject: (.*)WebAppConnection(.*) + remove: true + - where: + subject: (.*)WebAppContainer(.*) + remove: true + - where: + subject: (.*)WebAppContinuou(.*) + remove: true + - where: + subject: (.*)WebAppDeployment(.*) + remove: true + - where: + subject: (.*)WebAppInstance(.*) + remove: true + - where: + subject: (.*)WebAppMetadata(.*) + remove: true + - where: + subject: (.*)WebAppMS(.*) + remove: true + - where: + subject: (.*)WebAppNetwork(.*) + remove: true + - where: + subject: (.*)WebAppPrivate(.*) + remove: true + - where: + subject: (.*)WebAppPublishing(.*) + remove: true + - where: + subject: (.*)WebAppSite(.*) + remove: true + - where: + subject: (.*)WebAppSnapshot(.*) + remove: true + - where: + subject: (.*)WebAppSourceControl(.*) + remove: true + - where: + subject: (.*)WebAppSyncFunction(.*) + remove: true + - where: + subject: (.*)WebAppTriggered(.*) + remove: true + - where: + subject: (.*)WebAppUsage(.*) + remove: true + - where: + subject: (.*)AzWebAppWeb(.*) + remove: true + - where: + subject: (.*)Execute(.*) + remove: true + - where: + subject: (.*)WebAppMySql(.*) + remove: true + - where: + subject: (.*)WebAppStorage(.*) + remove: true + - where: + subject: (.*)Connection(.*) + remove: true + - where: + subject: (.*)WebAppDeployment(.*) + remove: true + - where: + subject: (.*)WebAppHost(.*) + remove: true + - where: + subject: (.*)ManagedHosting(.*) + remove: true + - where: + subject: (.*)WebAppFrom(.*) + remove: true + - where: + subject: (.*)WebAppAuthSetting(.*) + remove: true + - where: + subject: (.*)AppServicePlan(.*) + remove: true + - where: + subject: (.*)ClassicMobile(.*) + remove: true + - where: + subject: (.*)Hosting(.*) + remove: true + - where: + subject: (.*)PublishingUser(.*) + remove: true + - where: + subject: (.*)SiteIdentifier(.*) + remove: true + - where: + subject: (.*)WebAppFunctionAdmin(.*) + remove: true + - where: + subject: (.*)WebAppFunctionSecret(.*) + remove: true + - where: + subject: (.*)WebAppProcess(.*) + remove: true + - where: + subject: (.*)WebAppWebJob(.*) + remove: true + - where: + subject: (.*)WebAppWebSite(.*) + remove: true + - where: + subject: (.*)WebAppNewSite(.*) + remove: true + - where: + subject: (.*)WebAppClone(.*) + remove: true + - where: + subject: Move(.*) + remove: true + - where: + subject: (.*)WebAppRepository(.*) + remove: true + - where: + subject: (.*)WebAppFunctionTrigger(.*) + remove: true + - where: + subject: AppServicePlanWebApp + remove: true + - where: + subject: (.*)WebAppSwift(.*) + remove: true + - where: + subject: (.*)WebAppProduction(.*) + remove: true + - where: + subject: (.*)WebAppCloneable(.*) + remove: true + - where: + subject: (.*)ContainerSetting(.*) + remove: true + - where: + subject: (.*)StaticSite(.*) + remove: true + - from: source-file-csharp + where: $ + transform: $ = $.replace(/sb.AppendLine\(\$@\"\{Indent\}FormatsToProcess = \{formatList\}\"\);/, 'sb.AppendLine\(\$@\"\{Indent\}FormatsToProcess = \{formatList\}\"\);\r\nsb.AppendLine\(\$@\"\{Indent\}TypesToProcess = \'./custom/Functions.types.ps1xml\'{Environment.NewLine}\{Indent\}ScriptsToProcess = \'./custom/HelperFunctions.ps1\'{Environment.NewLine}\{Indent\}FunctionsToExport = \'Get-AzFunctionApp\', \'Get-AzFunctionAppAvailableLocation\', \'Get-AzFunctionAppPlan\', \'Get-AzFunctionAppSetting\', \'New-AzFunctionApp\', \'New-AzFunctionAppPlan\', \'Remove-AzFunctionApp\', \'Remove-AzFunctionAppPlan\', \'Remove-AzFunctionAppSetting\', \'Restart-AzFunctionApp\', \'Start-AzFunctionApp\', \'Stop-AzFunctionApp\', \'Update-AzFunctionApp\', \'Update-AzFunctionAppPlan\', \'Update-AzFunctionAppSetting\'\"\);'); + - from: source-file-csharp + where: $ + transform: $ = $.replace(/sb.AppendLine\(\$@\"\{Indent\}AliasesToExport = \{aliasesList\}\"\);/, '') + - from: source-file-csharp + where: $ + transform: $ = $.replace(/sb.AppendLine\(\$@\"\{Indent\}FunctionsToExport = \{cmdletsList\}\"\);/, '') +``` + +``` yaml + +# Add Storage and AppInsights cmdlet subset +require: + - $(this-folder)/helpers/Storage/readme.noprofile.md + - $(this-folder)/helpers/AppInsights/readme.noprofile.md + - $(this-folder)/helpers/ManagedIdentity/readme.noprofile.md + +``` diff --git a/tests-upgrade/kubconf/kubernetesconfiguration.json b/tests-upgrade/kubconf/kubernetesconfiguration.json new file mode 100644 index 00000000000..77717c096ce --- /dev/null +++ b/tests-upgrade/kubconf/kubernetesconfiguration.json @@ -0,0 +1,664 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-11-01-preview", + "title": "SourceControlConfigurationClient", + "description": "Use these APIs to create Source Control Configuration resources through ARM, for Kubernetes Clusters." + }, + "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}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}": { + "get": { + "tags": [ + "SourceControlConfiguration" + ], + "description": "Gets details of the Source Control Configuration.", + "operationId": "SourceControlConfigurations_Get", + "x-ms-examples": { + "Get Source Control Configuration": { + "$ref": "./examples/GetSourceControlConfiguration.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ClusterRpParameter" + }, + { + "$ref": "#/parameters/ClusterResourceNameParameter" + }, + { + "$ref": "#/parameters/ClusterNameParameter" + }, + { + "$ref": "#/parameters/SourceControlConfigurationNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SourceControlConfiguration" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "SourceControlConfiguration" + ], + "description": "Create a new Kubernetes Source Control Configuration.", + "operationId": "SourceControlConfigurations_CreateOrUpdate", + "x-ms-examples": { + "Create Source Control Configuration": { + "$ref": "./examples/CreateSourceControlConfiguration.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ClusterRpParameter" + }, + { + "$ref": "#/parameters/ClusterResourceNameParameter" + }, + { + "$ref": "#/parameters/ClusterNameParameter" + }, + { + "$ref": "#/parameters/SourceControlConfigurationNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "sourceControlConfiguration", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SourceControlConfiguration" + }, + "description": "Properties necessary to Create KubernetesConfiguration." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SourceControlConfiguration" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/SourceControlConfiguration" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "SourceControlConfiguration" + ], + "description": "This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo.", + "operationId": "SourceControlConfigurations_Delete", + "x-ms-examples": { + "Delete Source Control Configuration": { + "$ref": "./examples/DeleteSourceControlConfiguration.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ClusterRpParameter" + }, + { + "$ref": "#/parameters/ClusterResourceNameParameter" + }, + { + "$ref": "#/parameters/ClusterNameParameter" + }, + { + "$ref": "#/parameters/SourceControlConfigurationNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has been completed successfully." + }, + "204": { + "description": "No Content. The request has been accepted but the configuration was not found." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations": { + "get": { + "tags": [ + "SourceControlConfiguration" + ], + "description": "List all Source Control Configurations.", + "operationId": "SourceControlConfigurations_List", + "x-ms-examples": { + "List Source Control Configuration": { + "$ref": "./examples/ListSourceControlConfiguration.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ClusterRpParameter" + }, + { + "$ref": "#/parameters/ClusterResourceNameParameter" + }, + { + "$ref": "#/parameters/ClusterNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SourceControlConfigurationList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.KubernetesConfiguration/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "x-ms-examples": { + "BatchAccountDelete": { + "$ref": "./examples/OperationsList.json" + } + }, + "description": "List all the available operations the KubernetesConfiguration resource provider supports.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK response definition.", + "schema": { + "$ref": "#/definitions/ResourceProviderOperationList" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "Resource": { + "description": "The Resource model definition.", + "type": "object", + "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 + }, + "ProxyResource": { + "description": "ARM proxy resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": {} + }, + "Result": { + "description": "Sample result definition", + "properties": { + "sampleProperty": { + "type": "string", + "description": "Sample property of type string" + } + } + }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "description": "Error definition.", + "$ref": "#/definitions/ErrorDefinition" + } + } + }, + "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 + } + } + }, + "ComplianceStatus": { + "description": "Compliance Status details", + "type": "object", + "readOnly": true, + "properties": { + "complianceState": { + "description": "The compliance state of the configuration.", + "$ref": "#/definitions/ComplianceState", + "readOnly": true + }, + "lastConfigApplied": { + "description": "Datetime the configuration was last applied.", + "type": "string", + "format": "date-time" + }, + "message": { + "description": "Message from when the configuration was applied.", + "type": "string" + }, + "messageLevel": { + "description": "Level of the message.", + "type": "string", + "enum": [ + "Error", + "Warning", + "Information" + ], + "x-ms-enum": { + "name": "messageLevel", + "modelAsString": true + } + } + } + }, + "ComplianceState": { + "description": "The compliance state of the configuration.", + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "complianceState", + "modelAsString": true + }, + "enum": [ + "Pending", + "Compliant", + "Noncompliant", + "Installed", + "Failed" + ] + }, + "ChartVersion": { + "description": "Version of the operator Helm chart.", + "type": "string" + }, + "ChartValues": { + "description": "Values override for the operator Helm chart.", + "type": "string" + }, + "HelmOperatorProperties": { + "description": "Properties for Helm operator.", + "type": "object", + "properties": { + "chartVersion": { + "description": "Version of the operator Helm chart.", + "$ref": "#/definitions/ChartVersion" + }, + "chartValues": { + "description": "Values override for the operator Helm chart.", + "$ref": "#/definitions/ChartValues" + } + } + }, + "SourceControlConfiguration": { + "description": "The SourceControl Configuration object.", + "properties": { + "properties": { + "type": "object", + "x-ms-client-flatten": true, + "description": "Properties to create a Source Control Configuration resource", + "properties": { + "repositoryUrl": { + "type": "string", + "description": "Url of the SourceControl Repository." + }, + "operatorNamespace": { + "description": "The namespace to which this operator is installed to. Maximum of 253 lower case alphanumeric characters, hyphen and period only.", + "type": "string", + "default": "default" + }, + "operatorInstanceName": { + "description": "Instance name of the operator - identifying the specific configuration.", + "type": "string" + }, + "operatorType": { + "description": "Type of the operator", + "type": "string", + "enum": [ + "Flux" + ], + "x-ms-enum": { + "name": "operatorType", + "modelAsString": true + } + }, + "operatorParams": { + "description": "Any Parameters for the Operator instance in string format.", + "type": "string" + }, + "operatorScope": { + "description": "Scope at which the operator will be installed.", + "type": "string", + "enum": [ + "cluster", + "namespace" + ], + "default": "cluster", + "x-ms-enum": { + "name": "operatorScope", + "modelAsString": true + } + }, + "repositoryPublicKey": { + "description": "Public Key associated with this SourceControl configuration (either generated within the cluster or provided by the user).", + "type": "string", + "readOnly": true + }, + "enableHelmOperator": { + "description": "Option to enable Helm Operator for this git configuration.", + "type": "string", + "enum": [ + "true", + "false" + ], + "x-ms-enum": { + "name": "enableHelmOperator", + "modelAsString": true + } + }, + "helmOperatorProperties": { + "description": "Properties for Helm operator.", + "type": "object", + "$ref": "#/definitions/HelmOperatorProperties" + }, + "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" + ] + }, + "complianceStatus": { + "type": "object", + "description": "Compliance Status of the Configuration", + "readOnly": true, + "$ref": "#/definitions/ComplianceStatus" + } + } + } + }, + "allOf": [ + { + "$ref": "#/definitions/ProxyResource" + } + ] + }, + "SourceControlConfigurationList": { + "description": "Result of the request to list Source Control Configurations. It contains a list of SourceControlConfiguration objects and a URL link to get the next set of results.", + "properties": { + "value": { + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/SourceControlConfiguration" + }, + "description": "List of Source Control Configurations within a Kubernetes cluster." + }, + "nextLink": { + "type": "string", + "readOnly": true, + "description": "URL to get the next set of configuration objects, if any." + } + } + }, + "ResourceProviderOperation": { + "description": "Supported operation 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 KubernetesConfiguration.", + "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" + } + } + } + } + }, + "ResourceProviderOperationList": { + "description": "Result 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", + "readOnly": true, + "description": "URL to the next set of results, if any." + } + } + } + }, + "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" + }, + "ClusterRpParameter": { + "name": "clusterRp", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "Microsoft.ContainerService", + "Microsoft.Kubernetes" + ], + "description": "The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters).", + "x-ms-parameter-location": "method" + }, + "ClusterResourceNameParameter": { + "name": "clusterResourceName", + "in": "path", + "required": true, + "type": "string", + "enum": [ + "managedClusters", + "connectedClusters" + ], + "description": "The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters).", + "x-ms-parameter-location": "method" + }, + "ClusterNameParameter": { + "name": "clusterName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the kubernetes cluster.", + "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." + }, + "SourceControlConfigurationNameParameter": { + "name": "sourceControlConfigurationName", + "in": "path", + "description": "Name of the Source Control Configuration.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/tests-upgrade/kubconf/readme.md b/tests-upgrade/kubconf/readme.md new file mode 100644 index 00000000000..d38a81ae602 --- /dev/null +++ b/tests-upgrade/kubconf/readme.md @@ -0,0 +1,86 @@ + +# Az.KubernetesConfiguration +This directory contains the PowerShell module for the KubernetesConfiguration service. + +--- +## Status +[![Az.KubernetesConfiguration](https://img.shields.io/powershellgallery/v/Az.KubernetesConfiguration.svg?style=flat-square&label=Az.KubernetesConfiguration "Az.KubernetesConfiguration")](https://www.powershellgallery.com/packages/Az.KubernetesConfiguration/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.7.4 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.KubernetesConfiguration`, see [how-to.md](how-to.md). + + +--- +## Generation Requirements +Use of the beta version of `autorest.powershell` generator requires the following: +- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred) + - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes. +> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended. +- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@beta`
  +- PowerShell 6.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
  +- .NET Core SDK 2.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
  + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../readme.azure.noprofile.md +input-file: + - ./kubernetesconfiguration.json + +title: KubernetesConfiguration +module-version: 0.1.0 +subject-prefix: '' + +identity-correction-for-post: true + +directive: + - where: + variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ + remove: true + - where: + subject: SourceControlConfiguration + set: + subject: KubernetesConfiguration + - where: + parameter-name: ClusterResourceName + set: + parameter-name: ClusterType + - where: + verb: Set + subject: KubernetesConfiguration + set: + verb: Update + - where: + verb: New|Remove + subject: KubernetesConfiguration + hide: true + - where: + verb: Update + subject: KubernetesConfiguration + remove: true +``` diff --git a/tests-upgrade/mysql/.gitattributes b/tests-upgrade/mysql/.gitattributes new file mode 100644 index 00000000000..2125666142e --- /dev/null +++ b/tests-upgrade/mysql/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/tests-upgrade/mysql/.gitignore b/tests-upgrade/mysql/.gitignore new file mode 100644 index 00000000000..649721c69ce --- /dev/null +++ b/tests-upgrade/mysql/.gitignore @@ -0,0 +1,14 @@ +bin +obj +.vs +generated +internal +exports +custom/*.psm1 +test/*-TestResults.xml +/*.ps1 +/*.ps1xml +/*.psm1 +/*.snk +/*.csproj +/*.nuspec \ No newline at end of file diff --git a/tests-upgrade/mysql/common-types/resource-management/v1/privatelinks.json b/tests-upgrade/mysql/common-types/resource-management/v1/privatelinks.json new file mode 100644 index 00000000000..91e640b03fe --- /dev/null +++ b/tests-upgrade/mysql/common-types/resource-management/v1/privatelinks.json @@ -0,0 +1,174 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "PrivateEndpoint": { + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "The ARM identifier for Private Endpoint" + } + }, + "description": "The Private Endpoint resource." + }, + "PrivateEndpointConnection": { + "properties": { + "properties": { + "$ref": "#/definitions/PrivateEndpointConnectionProperties", + "x-ms-client-flatten": true, + "description": "Resource properties." + } + }, + "allOf": [ + { + "$ref": "./types.json#/definitions/Resource" + } + ], + "description": "The Private Endpoint Connection resource." + }, + "PrivateEndpointConnectionProperties": { + "properties": { + "privateEndpoint": { + "$ref": "#/definitions/PrivateEndpoint", + "description": "The resource of private end point." + }, + "privateLinkServiceConnectionState": { + "$ref": "#/definitions/PrivateLinkServiceConnectionState", + "description": "A collection of information about the state of the connection between service consumer and provider." + }, + "provisioningState": { + "$ref": "#/definitions/PrivateEndpointConnectionProvisioningState", + "description": "The provisioning state of the private endpoint connection resource." + } + }, + "required": [ + "privateLinkServiceConnectionState" + ], + "description": "Properties of the PrivateEndpointConnectProperties." + }, + "PrivateLinkServiceConnectionState": { + "properties": { + "status": { + "$ref": "#/definitions/PrivateEndpointServiceConnectionStatus", + "description": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service." + }, + "description": { + "type": "string", + "description": "The reason for approval/rejection of the connection." + }, + "actionsRequired": { + "type": "string", + "description": "A message indicating if changes on the service provider require any updates on the consumer." + } + }, + "description": "A collection of information about the state of the connection between service consumer and provider." + }, + "PrivateEndpointServiceConnectionStatus": { + "type": "string", + "description": "The private endpoint connection status.", + "enum": [ + "Pending", + "Approved", + "Rejected" + ], + "x-ms-enum": { + "name": "PrivateEndpointServiceConnectionStatus", + "modelAsString": true + } + }, + "PrivateEndpointConnectionProvisioningState": { + "type": "string", + "readOnly": true, + "description": "The current provisioning state.", + "enum": [ + "Succeeded", + "Creating", + "Deleting", + "Failed" + ], + "x-ms-enum": { + "name": "PrivateEndpointConnectionProvisioningState", + "modelAsString": true + } + }, + "PrivateLinkResource": { + "properties": { + "properties": { + "$ref": "#/definitions/PrivateLinkResourceProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + }, + "allOf": [ + { + "$ref": "./types.json#/definitions/Resource" + } + ], + "description": "A private link resource" + }, + "PrivateLinkResourceProperties": { + "properties": { + "groupId": { + "description": "The private link resource group id.", + "type": "string", + "readOnly": true + }, + "requiredMembers": { + "description": "The private link resource required member names.", + "type": "array", + "items": { + "type": "string" + }, + "readOnly": true + }, + "requiredZoneNames": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The private link resource Private link DNS zone name." + } + }, + "description": "Properties of a private link resource." + }, + "PrivateEndpointConnectionListResult": { + "properties": { + "value": { + "type": "array", + "description": "Array of private endpoint connections", + "items": { + "$ref": "#/definitions/PrivateEndpointConnection" + } + } + }, + "description": "List of private endpoint connection associated with the specified storage account" + }, + "PrivateLinkResourceListResult": { + "properties": { + "value": { + "type": "array", + "description": "Array of private link resources", + "items": { + "$ref": "#/definitions/PrivateLinkResource" + } + } + }, + "description": "A list of private link resources" + } + }, + "parameters": { + "PrivateEndpointConnectionName": { + "name": "privateEndpointConnectionName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the private endpoint connection associated with the Azure resource", + "x-ms-parameter-location": "method" + } + } +} diff --git a/tests-upgrade/mysql/common-types/resource-management/v1/types.json b/tests-upgrade/mysql/common-types/resource-management/v1/types.json new file mode 100644 index 00000000000..bf32e064a31 --- /dev/null +++ b/tests-upgrade/mysql/common-types/resource-management/v1/types.json @@ -0,0 +1,467 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "Resource": { + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the resource" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts." + } + }, + "x-ms-azure-resource": true + }, + "AzureEntityResource": { + "x-ms-client-name": "AzureEntityResource", + "description": "The resource model definition for a Azure Resource Manager resource with an etag.", + "properties": { + "etag": { + "type": "string", + "readOnly": true, + "description": "Resource Etag." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "TrackedResource": { + "description": "The resource model definition for a ARM tracked top level resource", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags." + }, + "location": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + } + }, + "required": [ + "location" + ], + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "ProxyResource": { + "description": "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "ResourceModelWithAllowedPropertySet": { + "description": "The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the resource" + }, + "type": { + "readOnly": true, + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.." + }, + "location": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + }, + "managedBy": { + "type": "string", + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource." + }, + "kind": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.", + "pattern": "^[-\\w\\._,\\(\\)]+$" + }, + "etag": { + "readOnly": true, + "type": "string", + "description": "The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. " + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags." + }, + "identity": { + "allOf": [ + { + "$ref": "#/definitions/Identity" + } + ] + }, + "sku": { + "allOf": [ + { + "$ref": "#/definitions/Sku" + } + ] + }, + "plan": { + "allOf": [ + { + "$ref": "#/definitions/Plan" + } + ] + } + }, + "x-ms-azure-resource": true + }, + "Sku": { + "description": "The resource model definition representing SKU", + "properties": { + "name": { + "type": "string", + "description": "The name of the SKU. Ex - P3. It is typically a letter+number code" + }, + "tier": { + "type": "string", + "enum": [ + "Free", + "Basic", + "Standard", + "Premium" + ], + "x-ms-enum": { + "name": "SkuTier", + "modelAsString": false + }, + "description": "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT." + }, + "size": { + "type": "string", + "description": "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. " + }, + "family": { + "type": "string", + "description": "If the service has different generations of hardware, for the same SKU, then that can be captured here." + }, + "capacity": { + "type": "integer", + "format": "int32", + "description": "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted." + } + }, + "required": [ + "name" + ] + }, + "Identity": { + "description": "Identity for the resource.", + "properties": { + "principalId": { + "readOnly": true, + "type": "string", + "description": "The principal ID of resource identity." + }, + "tenantId": { + "readOnly": true, + "type": "string", + "description": "The tenant ID of resource." + }, + "type": { + "type": "string", + "description": "The identity type.", + "enum": [ + "SystemAssigned" + ], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": false + } + } + } + }, + "Plan": { + "properties": { + "name": { + "type": "string", + "description": "A user defined name of the 3rd Party Artifact that is being procured." + }, + "publisher": { + "type": "string", + "description": "The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic" + }, + "product": { + "type": "string", + "description": "The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. " + }, + "promotionCode": { + "type": "string", + "description": "A publisher provided promotion code as provisioned in Data Market for the said product/artifact." + }, + "version": { + "type": "string", + "description": "The version of the desired product/artifact." + } + }, + "description": "Plan for the resource.", + "required": [ + "name", + "publisher", + "product" + ] + }, + "ErrorResponse": { + "properties": { + "code": { + "readOnly": true, + "type": "string", + "description": "The error code." + }, + "message": { + "readOnly": true, + "type": "string", + "description": "The error message." + }, + "target": { + "readOnly": true, + "type": "string", + "description": "The error target." + }, + "details": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResponse" + }, + "description": "The error details." + }, + "additionalInfo": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorAdditionalInfo" + }, + "description": "The error additional info." + } + }, + "description": "The resource management error response." + }, + "ErrorAdditionalInfo": { + "properties": { + "type": { + "readOnly": true, + "type": "string", + "description": "The additional info type." + }, + "info": { + "readOnly": true, + "type": "object", + "description": "The additional info." + } + }, + "description": "The resource management error additional info." + }, + "locationData": { + "description": "Metadata pertaining to the geographic location of the resource.", + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 256, + "description": "A canonical name for the geographic or physical location." + }, + "city": { + "type": "string", + "description": "The city or locality where the resource is located." + }, + "district": { + "type": "string", + "description": "The district, state, or province where the resource is located." + }, + "countryOrRegion": { + "type": "string", + "description": "The country or region where the resource is located" + } + }, + "required": [ + "name" + ] + }, + "systemData": { + "description": "Metadata pertaining to creation and last modification of the resource.", + "type": "object", + "readOnly": true, + "properties": { + "createdBy": { + "type": "string", + "description": "The identity that created the resource." + }, + "createdByType": { + "type": "string", + "description": "The type of identity that created the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource creation (UTC)." + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified the resource." + }, + "lastModifiedByType": { + "type": "string", + "description": "The type of identity that last modified the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The type of identity that last modified the resource." + } + } + }, + "encryptionProperties": { + "description": "Configuration of key for data encryption", + "type": "object", + "properties": { + "status": { + "description": "Indicates whether or not the encryption is enabled for container registry.", + "enum": [ + "enabled", + "disabled" + ], + "type": "string", + "x-ms-enum": { + "name": "EncryptionStatus", + "modelAsString": true + } + }, + "keyVaultProperties": { + "$ref": "#/definitions/KeyVaultProperties", + "description": "Key vault properties." + } + } + }, + "KeyVaultProperties": { + "type": "object", + "properties": { + "keyIdentifier": { + "description": "Key vault uri to access the encryption key.", + "type": "string" + }, + "identity": { + "description": "The client id of the identity which will be used to access key vault.", + "type": "string" + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription.", + "minLength": 1 + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for this operation.", + "minLength": 1 + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group. The name is case insensitive.", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file diff --git a/tests-upgrade/mysql/common-types/resource-management/v2/types.json b/tests-upgrade/mysql/common-types/resource-management/v2/types.json new file mode 100644 index 00000000000..7ee7093af3e --- /dev/null +++ b/tests-upgrade/mysql/common-types/resource-management/v2/types.json @@ -0,0 +1,473 @@ +{ + "swagger": "2.0", + "info": { + "version": "2.0", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "Resource": { + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the resource" + }, + "type": { + "readOnly": true, + "type": "string", + "description": "The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts." + } + }, + "x-ms-azure-resource": true + }, + "AzureEntityResource": { + "x-ms-client-name": "AzureEntityResource", + "description": "The resource model definition for a Azure Resource Manager resource with an etag.", + "properties": { + "etag": { + "type": "string", + "readOnly": true, + "description": "Resource Etag." + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "TrackedResource": { + "description": "The resource model definition for a ARM tracked top level resource", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags." + }, + "location": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + } + }, + "required": [ + "location" + ], + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "ProxyResource": { + "description": "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ] + }, + "ResourceModelWithAllowedPropertySet": { + "description": "The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + }, + "name": { + "readOnly": true, + "type": "string", + "description": "The name of the resource" + }, + "type": { + "readOnly": true, + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.." + }, + "location": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "The geo-location where the resource lives" + }, + "managedBy": { + "type": "string", + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource." + }, + "kind": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.", + "pattern": "^[-\\w\\._,\\(\\)]+$" + }, + "etag": { + "readOnly": true, + "type": "string", + "description": "The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. " + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags." + }, + "identity": { + "allOf": [ + { + "$ref": "#/definitions/Identity" + } + ] + }, + "sku": { + "allOf": [ + { + "$ref": "#/definitions/Sku" + } + ] + }, + "plan": { + "allOf": [ + { + "$ref": "#/definitions/Plan" + } + ] + } + }, + "x-ms-azure-resource": true + }, + "Sku": { + "description": "The resource model definition representing SKU", + "properties": { + "name": { + "type": "string", + "description": "The name of the SKU. Ex - P3. It is typically a letter+number code" + }, + "tier": { + "type": "string", + "enum": [ + "Free", + "Basic", + "Standard", + "Premium" + ], + "x-ms-enum": { + "name": "SkuTier", + "modelAsString": false + }, + "description": "This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT." + }, + "size": { + "type": "string", + "description": "The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. " + }, + "family": { + "type": "string", + "description": "If the service has different generations of hardware, for the same SKU, then that can be captured here." + }, + "capacity": { + "type": "integer", + "format": "int32", + "description": "If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted." + } + }, + "required": [ + "name" + ] + }, + "Identity": { + "description": "Identity for the resource.", + "properties": { + "principalId": { + "readOnly": true, + "type": "string", + "description": "The principal ID of resource identity." + }, + "tenantId": { + "readOnly": true, + "type": "string", + "description": "The tenant ID of resource." + }, + "type": { + "type": "string", + "description": "The identity type.", + "enum": [ + "SystemAssigned" + ], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": false + } + } + } + }, + "Plan": { + "properties": { + "name": { + "type": "string", + "description": "A user defined name of the 3rd Party Artifact that is being procured." + }, + "publisher": { + "type": "string", + "description": "The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic" + }, + "product": { + "type": "string", + "description": "The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. " + }, + "promotionCode": { + "type": "string", + "description": "A publisher provided promotion code as provisioned in Data Market for the said product/artifact." + }, + "version": { + "type": "string", + "description": "The version of the desired product/artifact." + } + }, + "description": "Plan for the resource.", + "required": [ + "name", + "publisher", + "product" + ] + }, + "ErrorResponse": { + "properties": { + "error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "readOnly": true, + "type": "string", + "description": "The error code." + }, + "message": { + "readOnly": true, + "type": "string", + "description": "The error message." + }, + "target": { + "readOnly": true, + "type": "string", + "description": "The error target." + }, + "details": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResponse" + }, + "description": "The error details." + }, + "additionalInfo": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ErrorAdditionalInfo" + }, + "description": "The error additional info." + } + } + } + }, + "description": "The resource management error response." + }, + "ErrorAdditionalInfo": { + "properties": { + "type": { + "readOnly": true, + "type": "string", + "description": "The additional info type." + }, + "info": { + "readOnly": true, + "type": "object", + "description": "The additional info." + } + }, + "description": "The resource management error additional info." + }, + "locationData": { + "description": "Metadata pertaining to the geographic location of the resource.", + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 256, + "description": "A canonical name for the geographic or physical location." + }, + "city": { + "type": "string", + "description": "The city or locality where the resource is located." + }, + "district": { + "type": "string", + "description": "The district, state, or province where the resource is located." + }, + "countryOrRegion": { + "type": "string", + "description": "The country or region where the resource is located" + } + }, + "required": [ + "name" + ] + }, + "systemData": { + "description": "Metadata pertaining to creation and last modification of the resource.", + "type": "object", + "readOnly": true, + "properties": { + "createdBy": { + "type": "string", + "description": "The identity that created the resource." + }, + "createdByType": { + "type": "string", + "description": "The type of identity that created the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource creation (UTC)." + }, + "lastModifiedBy": { + "type": "string", + "description": "The identity that last modified the resource." + }, + "lastModifiedByType": { + "type": "string", + "description": "The type of identity that last modified the resource.", + "enum": [ + "User", + "Application", + "ManagedIdentity", + "Key" + ], + "x-ms-enum": { + "name": "createdByType", + "modelAsString": true + } + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The type of identity that last modified the resource." + } + } + }, + "encryptionProperties": { + "description": "Configuration of key for data encryption", + "type": "object", + "properties": { + "status": { + "description": "Indicates whether or not the encryption is enabled for container registry.", + "enum": [ + "enabled", + "disabled" + ], + "type": "string", + "x-ms-enum": { + "name": "EncryptionStatus", + "modelAsString": true + } + }, + "keyVaultProperties": { + "$ref": "#/definitions/KeyVaultProperties", + "description": "Key vault properties." + } + } + }, + "KeyVaultProperties": { + "type": "object", + "properties": { + "keyIdentifier": { + "description": "Key vault uri to access the encryption key.", + "type": "string" + }, + "identity": { + "description": "The client id of the identity which will be used to access key vault.", + "type": "string" + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The ID of the target subscription.", + "minLength": 1 + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "The API version to use for this operation.", + "minLength": 1 + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group. The name is case insensitive.", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "x-ms-parameter-location": "method" + } + } +} diff --git a/tests-upgrade/mysql/common-types/rfcs/rfc7517.json b/tests-upgrade/mysql/common-types/rfcs/rfc7517.json new file mode 100644 index 00000000000..f856d152f36 --- /dev/null +++ b/tests-upgrade/mysql/common-types/rfcs/rfc7517.json @@ -0,0 +1,104 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.0", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "JSONWebKey": { + "type": "object", + "required": [ + "use", + "kty", + "kid", + "alg" + ], + "properties": { + "alg": { + "description": "The \"alg\" (algorithm) parameter identifies the algorithm intended for\nuse with the key. The values used should either be registered in the\nIANA \"JSON Web Signature and Encryption Algorithms\" registry\nestablished by [JWA] or be a value that contains a Collision-\nResistant Name.", + "type": "string" + }, + "crv": { + "description": "The \"crv\" (curve) parameter identifies the curve type", + "type": "string" + }, + "d": { + "description": "RSA private exponent or ECC private key", + "type": "string" + }, + "dp": { + "description": "RSA Private Key Parameter", + "type": "string" + }, + "dq": { + "description": "RSA Private Key Parameter", + "type": "string" + }, + "e": { + "description": "RSA public exponent, in Base64", + "type": "string" + }, + "k": { + "description": "Symmetric key", + "type": "string" + }, + "kid": { + "description": "The \"kid\" (key ID) parameter is used to match a specific key. This\nis used, for instance, to choose among a set of keys within a JWK Set\nduring key rollover. The structure of the \"kid\" value is\nunspecified. When \"kid\" values are used within a JWK Set, different\nkeys within the JWK Set SHOULD use distinct \"kid\" values. (One\nexample in which different keys might use the same \"kid\" value is if\nthey have different \"kty\" (key type) values but are considered to be\nequivalent alternatives by the application using them.) The \"kid\"\nvalue is a case-sensitive string.", + "type": "string" + }, + "kty": { + "description": "The \"kty\" (key type) parameter identifies the cryptographic algorithm\nfamily used with the key, such as \"RSA\" or \"EC\". \"kty\" values should\neither be registered in the IANA \"JSON Web Key Types\" registry\nestablished by [JWA] or be a value that contains a Collision-\nResistant Name. The \"kty\" value is a case-sensitive string.", + "type": "string" + }, + "n": { + "description": "RSA modulus, in Base64", + "type": "string" + }, + "p": { + "description": "RSA secret prime", + "type": "string" + }, + "q": { + "description": "RSA secret prime, with p < q", + "type": "string" + }, + "qi": { + "description": "RSA Private Key Parameter", + "type": "string" + }, + "use": { + "description": "Use (\"public key use\") identifies the intended use of\nthe public key. The \"use\" parameter is employed to indicate whether\na public key is used for encrypting data or verifying the signature\non data. Values are commonly \"sig\" (signature) or \"enc\" (encryption).", + "type": "string" + }, + "x": { + "description": "X coordinate for the Elliptic Curve point", + "type": "string" + }, + "x5c": { + "description": "The \"x5c\" (X.509 certificate chain) parameter contains a chain of one\nor more PKIX certificates [RFC5280]. The certificate chain is\nrepresented as a JSON array of certificate value strings. Each\nstring in the array is a base64-encoded (Section 4 of [RFC4648] --\nnot base64url-encoded) DER [ITU.X690.1994] PKIX certificate value.\nThe PKIX certificate containing the key value MUST be the first\ncertificate.", + "type": "array", + "items": { + "type": "string" + } + }, + "y": { + "description": "Y coordinate for the Elliptic Curve point", + "type": "string" + } + } + }, + "JSONWebKeySet": { + "type": "object", + "properties": { + "keys": { + "description": "The value of the \"keys\" parameter is an array of JWK values. By\ndefault, the order of the JWK values within the array does not imply\nan order of preference among them, although applications of JWK Sets\ncan choose to assign a meaning to the order for their purposes, if\ndesired.", + "type": "array", + "items": { + "$ref": "#/definitions/JSONWebKey" + } + } + } + } + } +} diff --git a/tests-upgrade/mysql/custom/readme.md b/tests-upgrade/mysql/custom/readme.md new file mode 100644 index 00000000000..f8336dda153 --- /dev/null +++ b/tests-upgrade/mysql/custom/readme.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.MySql` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.MySql.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.MySql` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.MySql.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.MySql.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundemental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.MySql`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propegated to reference documentation via [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.MySql`. +- `Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.MySql`. For more information, see [readme.md](..\internal/readme.md) in the `..\internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/tests-upgrade/mysql/docs/readme.md b/tests-upgrade/mysql/docs/readme.md new file mode 100644 index 00000000000..62fb790569c --- /dev/null +++ b/tests-upgrade/mysql/docs/readme.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.MySql` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `..\examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.MySql` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/tests-upgrade/mysql/examples/readme.md b/tests-upgrade/mysql/examples/readme.md new file mode 100644 index 00000000000..ac871d71fc7 --- /dev/null +++ b/tests-upgrade/mysql/examples/readme.md @@ -0,0 +1,11 @@ +# Examples +This directory contains examples from the exported cmdlets of the module. When `build-module.ps1` is ran, example stub files will be generated here. If your module support Azure Profiles, the example stubs will be in individual profile folders. These example stubs should be updated to show how the cmdlet is used. The examples are imported into the documentation when `generate-help.ps1` is ran. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Purpose +This separates the example documentation details from the generated documentation information provided directly from the generated cmdlets. Since the cmdlets don't have examples from the REST spec, this provides a means to add examples easily. The example stubs provide the markdown format that is required. The 3 core elements are: the name of the example, the code information of the example, and the description of the example. That information, if the markdown format is followed, will be available to documentation generation and be part of the documents in the `..\docs` folder. \ No newline at end of file diff --git a/tests-upgrade/mysql/how-to.md b/tests-upgrade/mysql/how-to.md new file mode 100644 index 00000000000..8b7309794ce --- /dev/null +++ b/tests-upgrade/mysql/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.MySql`. + +## Building `Az.MySql` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [readme.md](exports/readme.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [readme.md](custom/readme.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [readme.md](examples/readme.md) in the `examples` folder. To read more about documentation, look at the [readme.md](docs/readme.md) in the `docs` folder. + +## Testing `Az.MySql` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [readme.md](examples/readme.md) in the `examples` folder. + +## Packing `Az.MySql` +To pack `Az.MySql` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/en-us/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.MySql`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.MySql.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.MySql.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.MySql`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.MySql` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/tests-upgrade/mysql/license.txt b/tests-upgrade/mysql/license.txt new file mode 100644 index 00000000000..b9f3180fb9a --- /dev/null +++ b/tests-upgrade/mysql/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/tests-upgrade/mysql/mysql.json b/tests-upgrade/mysql/mysql.json new file mode 100644 index 00000000000..78e0d429756 --- /dev/null +++ b/tests-upgrade/mysql/mysql.json @@ -0,0 +1,2576 @@ +{ + "swagger": "2.0", + "info": { + "title": "MySQLManagementClient", + "description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model.", + "version": "2017-12-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}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}": { + "put": { + "tags": [ + "Servers" + ], + "operationId": "Servers_Create", + "x-ms-examples": { + "Create a new server": { + "$ref": "./examples/ServerCreate.json" + }, + "Create a database as a point in time restore": { + "$ref": "./examples/ServerCreatePointInTimeRestore.json" + }, + "Create a server as a geo restore ": { + "$ref": "./examples/ServerCreateGeoRestoreMode.json" + }, + "Create a replica server": { + "$ref": "./examples/ServerCreateReplicaMode.json" + } + }, + "description": "Creates a new server or updates an existing server. The update action will overwrite the existing server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ServerForCreate" + }, + "description": "The required parameters for creating or updating a server." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Server" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/Server" + } + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true + }, + "patch": { + "tags": [ + "Servers" + ], + "operationId": "Servers_Update", + "x-ms-examples": { + "ServerUpdate": { + "$ref": "./examples/ServerUpdate.json" + } + }, + "description": "Updates an existing server. The request body can contain one to many of the properties present in the normal server definition.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ServerUpdateParameters" + }, + "description": "The required parameters for updating a server." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Server" + } + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "Servers" + ], + "operationId": "Servers_Delete", + "x-ms-examples": { + "ServerDelete": { + "$ref": "./examples/ServerDelete.json" + } + }, + "description": "Deletes a server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "NoContent" + } + }, + "x-ms-long-running-operation": true + }, + "get": { + "tags": [ + "Servers" + ], + "operationId": "Servers_Get", + "x-ms-examples": { + "ServerGet": { + "$ref": "./examples/ServerGet.json" + } + }, + "description": "Gets information about a server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Server" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers": { + "get": { + "tags": [ + "Servers" + ], + "operationId": "Servers_ListByResourceGroup", + "x-ms-examples": { + "ServerListByResourceGroup": { + "$ref": "./examples/ServerListByResourceGroup.json" + } + }, + "description": "List all the servers in a given resource group.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ServerListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/servers": { + "get": { + "tags": [ + "Servers" + ], + "operationId": "Servers_List", + "x-ms-examples": { + "ServerList": { + "$ref": "./examples/ServerList.json" + } + }, + "description": "List all the servers in a given subscription.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ServerListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/restart": { + "post": { + "tags": [ + "ServerRestart" + ], + "operationId": "Servers_Restart", + "x-ms-examples": { + "ServerRestart": { + "$ref": "./examples/ServerRestart.json" + } + }, + "description": "Restarts a server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/replicas": { + "get": { + "tags": [ + "Replicas" + ], + "operationId": "Replicas_ListByServer", + "x-ms-examples": { + "ReplicasListByServer": { + "$ref": "./examples/ReplicasListByServer.json" + } + }, + "description": "List all the replicas for a given server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ServerListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules/{firewallRuleName}": { + "put": { + "tags": [ + "FirewallRules" + ], + "operationId": "FirewallRules_CreateOrUpdate", + "x-ms-examples": { + "FirewallRuleCreate": { + "$ref": "./examples/FirewallRuleCreate.json" + } + }, + "description": "Creates a new firewall rule or updates an existing firewall rule.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/FirewallRuleNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FirewallRule" + }, + "description": "The required parameters for creating or updating a firewall rule." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FirewallRule" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/FirewallRule" + } + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "FirewallRules" + ], + "operationId": "FirewallRules_Delete", + "x-ms-examples": { + "FirewallRuleDelete": { + "$ref": "./examples/FirewallRuleDelete.json" + } + }, + "description": "Deletes a server firewall rule.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/FirewallRuleNameParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "NoContent" + } + }, + "x-ms-long-running-operation": true + }, + "get": { + "tags": [ + "FirewallRules" + ], + "operationId": "FirewallRules_Get", + "x-ms-examples": { + "FirewallRuleGet": { + "$ref": "./examples/FirewallRuleGet.json" + } + }, + "description": "Gets information about a server firewall rule.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/FirewallRuleNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FirewallRule" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/firewallRules": { + "get": { + "tags": [ + "FirewallRules" + ], + "operationId": "FirewallRules_ListByServer", + "x-ms-examples": { + "FirewallRuleList": { + "$ref": "./examples/FirewallRuleListByServer.json" + } + }, + "description": "List all the firewall rules in a given server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FirewallRuleListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}": { + "get": { + "tags": [ + "VirtualNetworkRules" + ], + "description": "Gets a virtual network rule.", + "operationId": "VirtualNetworkRules_Get", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/virtualNetworkRuleNameParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved a specified virtual network rule.", + "schema": { + "$ref": "#/definitions/VirtualNetworkRule" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." + } + }, + "x-ms-examples": { + "Gets a virtual network rule": { + "$ref": "./examples/VirtualNetworkRulesGet.json" + } + } + }, + "put": { + "tags": [ + "VirtualNetworkRules" + ], + "description": "Creates or updates an existing virtual network rule.", + "operationId": "VirtualNetworkRules_CreateOrUpdate", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/virtualNetworkRuleNameParameter" + }, + { + "name": "parameters", + "in": "body", + "description": "The requested virtual Network Rule Resource state.", + "required": true, + "schema": { + "$ref": "#/definitions/VirtualNetworkRule" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated a virtual network rule.", + "schema": { + "$ref": "#/definitions/VirtualNetworkRule" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidResourceId - Invalid resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 NullVirtualNetworkRequest - Virtual Network Request is Null\n\n * 400 NullVirtualNetworkRequestParameters - Virtual Network Request Parameters are Null\n\n * 400 NullVirtualNetworkSubnetId - The Virtual Network Subnet Id is null\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 VirtualNetworkRuleNotEnabled - Azure SQL Server Virtual Network Rule feature is not enabled\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation." + }, + "202": { + "description": "Accepted" + }, + "201": { + "description": "Successfully created a virtual network rule.", + "schema": { + "$ref": "#/definitions/VirtualNetworkRule" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Create or update a virtual network rule": { + "$ref": "./examples/VirtualNetworkRulesCreateOrUpdate.json" + } + } + }, + "delete": { + "tags": [ + "VirtualNetworkRules" + ], + "description": "Deletes the virtual network rule with the given name.", + "operationId": "VirtualNetworkRules_Delete", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/virtualNetworkRuleNameParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully deleted the virtual network rule." + }, + "default": { + "description": "*** Error Responses: ***\n\n * 400 InvalidResourceId - Invalid resource identifier.\n\n * 400 MismatchingSubscriptionWithUrl - The provided subscription did not match the subscription in the Url.\n\n * 400 MismatchingResourceGroupNameWithUrl - The provided resource group name did not match the name in the Url.\n\n * 400 MismatchingServerNameWithUrl - The provided server name did not match the name in the Url.\n\n * 400 NullVirtualNetworkRequest - Virtual Network Request is Null\n\n * 400 NullVirtualNetworkRequestParameters - Virtual Network Request Parameters are Null\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 OperationIdNotFound - The operation with Id does not exist.\n\n * 409 OperationCancelled - The operation has been cancelled by user.\n\n * 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.\n\n * 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation." + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "The specified virtual network rule does not exist." + } + }, + "x-ms-long-running-operation": true, + "x-ms-examples": { + "Delete a virtual network rule": { + "$ref": "./examples/VirtualNetworkRulesDelete.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/virtualNetworkRules": { + "get": { + "tags": [ + "VirtualNetworkRules" + ], + "description": "Gets a list of virtual network rules in a server.", + "operationId": "VirtualNetworkRules_ListByServer", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the list of virtual network rules.", + "schema": { + "$ref": "#/definitions/VirtualNetworkRuleListResult" + } + }, + "default": { + "description": "*** Error Responses: ***\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found." + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List virtual network rules": { + "$ref": "./examples/VirtualNetworkRulesList.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases/{databaseName}": { + "put": { + "tags": [ + "Databases" + ], + "operationId": "Databases_CreateOrUpdate", + "x-ms-examples": { + "DatabaseCreate": { + "$ref": "./examples/DatabaseCreate.json" + } + }, + "description": "Creates a new database or updates an existing database.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Database" + }, + "description": "The required parameters for creating or updating a database." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/Database" + } + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "Databases" + ], + "operationId": "Databases_Delete", + "x-ms-examples": { + "DatabaseDelete": { + "$ref": "./examples/DatabaseDelete.json" + } + }, + "description": "Deletes a database.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "NoContent" + } + }, + "x-ms-long-running-operation": true + }, + "get": { + "tags": [ + "Databases" + ], + "operationId": "Databases_Get", + "x-ms-examples": { + "DatabaseGet": { + "$ref": "./examples/DatabaseGet.json" + } + }, + "description": "Gets information about a database.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/DatabaseNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Database" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/databases": { + "get": { + "tags": [ + "Databases" + ], + "operationId": "Databases_ListByServer", + "x-ms-examples": { + "DatabaseList": { + "$ref": "./examples/DatabaseListByServer.json" + } + }, + "description": "List all the databases in a given server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DatabaseListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations/{configurationName}": { + "put": { + "tags": [ + "Configurations" + ], + "operationId": "Configurations_CreateOrUpdate", + "x-ms-examples": { + "ConfigurationCreateOrUpdate": { + "$ref": "./examples/ConfigurationCreateOrUpdate.json" + } + }, + "description": "Updates a configuration of a server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/ConfigurationNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Configuration" + }, + "description": "The required parameters for updating a server configuration." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Configuration" + } + }, + "202": { + "description": "Accepted" + } + }, + "x-ms-long-running-operation": true + }, + "get": { + "tags": [ + "Configurations" + ], + "operationId": "Configurations_Get", + "x-ms-examples": { + "ConfigurationGet": { + "$ref": "./examples/ConfigurationGet.json" + } + }, + "description": "Gets information about a configuration of server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "$ref": "#/parameters/ConfigurationNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Configuration" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/configurations": { + "get": { + "tags": [ + "Configurations" + ], + "operationId": "Configurations_ListByServer", + "x-ms-examples": { + "ConfigurationList": { + "$ref": "./examples/ConfigurationListByServer.json" + } + }, + "description": "List all the configurations in a given server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ConfigurationListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/logFiles": { + "get": { + "tags": [ + "LogFiles" + ], + "operationId": "LogFiles_ListByServer", + "x-ms-examples": { + "LogFileList": { + "$ref": "./examples/LogFileListByServer.json" + } + }, + "description": "List all the log files in a given server.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/LogFileListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/Administrators/activeDirectory": { + "get": { + "tags": [ + "ServerAdministrators" + ], + "operationId": "ServerAdministrators_Get", + "x-ms-examples": { + "ServerAdministratorGet": { + "$ref": "./examples/ServerAdminGet.json" + } + }, + "description": "Gets information about a AAD server administrator.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ServerAdministratorResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "put": { + "tags": [ + "ServerAdministrators" + ], + "operationId": "ServerAdministrators_CreateOrUpdate", + "x-ms-examples": { + "ServerAdministratorCreate": { + "$ref": "./examples/ServerAdminCreateUpdate.json" + } + }, + "description": "Creates or update active directory administrator on an existing server. The update action will overwrite the existing administrator.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + }, + { + "name": "properties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ServerAdministratorResource" + }, + "description": "The required parameters for creating or updating an AAD server administrator." + } + ], + "responses": { + "200": { + "description": "Successfully updated the active directory administrator", + "schema": { + "$ref": "#/definitions/ServerAdministratorResource" + } + }, + "202": { + "description": "Operation in progress", + "schema": { + "$ref": "#/definitions/ServerAdministratorResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "ServerAdministrators" + ], + "operationId": "ServerAdministrators_Delete", + "x-ms-examples": { + "ServerAdministratorsDelete": { + "$ref": "./examples/ServerAdminDelete.json" + } + }, + "description": "Deletes server active directory administrator.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "Successfully deleted the active directory administrator" + }, + "202": { + "description": "Operation in progress" + }, + "204": { + "description": "The specified Server active directory administrator does not exist" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers/{serverName}/administrators": { + "get": { + "tags": [ + "ServerAdministrators" + ], + "operationId": "ServerAdministrators_List", + "description": "Returns a list of server Administrators.", + "x-ms-examples": { + "get a list of server administrators": { + "$ref": "./examples/ServerAdminList.json" + } + }, + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ServerNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ServerAdministratorResourceListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/locations/{locationName}/performanceTiers": { + "get": { + "tags": [ + "LocationBasedPerformanceTier" + ], + "operationId": "LocationBasedPerformanceTier_List", + "x-ms-examples": { + "PerformanceTiersList": { + "$ref": "./examples/PerformanceTiersListByLocation.json" + } + }, + "description": "List all the performance tiers at specified location in a given subscription.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/LocationNameParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/PerformanceTierListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.DBforMySQL/checkNameAvailability": { + "post": { + "tags": [ + "CheckNameAvailability" + ], + "operationId": "CheckNameAvailability_Execute", + "x-ms-examples": { + "NameAvailability": { + "$ref": "./examples/CheckNameAvailability.json" + } + }, + "description": "Check the availability of name for resource", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "name": "nameAvailabilityRequest", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/NameAvailabilityRequest" + }, + "description": "The required parameters for checking if resource name is available." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/NameAvailability" + } + } + } + } + }, + "/providers/Microsoft.DBforMySQL/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "x-ms-examples": { + "OperationList": { + "$ref": "./examples/OperationList.json" + } + }, + "description": "Lists all of the available REST API operations.", + "parameters": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + } + } + } + } + }, + "definitions": { + "ServerVersion": { + "type": "string", + "description": "The version of a server.", + "enum": [ + "5.6", + "5.7", + "8.0" + ], + "x-ms-enum": { + "name": "ServerVersion", + "modelAsString": false + } + }, + "SslEnforcement": { + "type": "string", + "description": "Enable ssl enforcement or not when connect to server.", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "SslEnforcementEnum", + "modelAsString": false + } + }, + "MinimalTlsVersion": { + "type": "string", + "description": "Enforce a minimal Tls version for the server.", + "enum": [ + "TLS1_0", + "TLS1_1", + "TLS1_2", + "TLSEnforcementDisabled" + ], + "x-ms-enum": { + "name": "MinimalTlsVersionEnum", + "modelAsString": false + } + }, + "InfrastructureEncryption": { + "type": "string", + "description": "Add a second layer of encryption for your data using new encryption algorithm which gives additional data protection. Value is optional but if passed in, must be 'Disabled' or 'Enabled'.", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "InfrastructureEncryption", + "modelAsString": false, + "values": [ + { + "value": "Enabled", + "description": "Default value for single layer of encryption for data at rest." + }, + { + "value": "Disabled", + "description": "Additional (2nd) layer of encryption for data at rest" + } + ] + } + }, + "PublicNetworkAccess": { + "type": "string", + "description": "Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "PublicNetworkAccessEnum", + "modelAsString": false + } + }, + "ServerPrivateEndpointConnection": { + "description": "A private endpoint connection under a server", + "type": "object", + "properties": { + "id": { + "description": "Resource Id of the private endpoint connection.", + "type": "string", + "readOnly": true + }, + "properties": { + "$ref": "#/definitions/ServerPrivateEndpointConnectionProperties", + "description": "Private endpoint connection properties", + "readOnly": true + } + } + }, + "ServerPrivateEndpointConnectionProperties": { + "description": "Properties of a private endpoint connection.", + "type": "object", + "properties": { + "privateEndpoint": { + "$ref": "#/definitions/PrivateEndpointProperty", + "description": "Private endpoint which the connection belongs to." + }, + "privateLinkServiceConnectionState": { + "$ref": "#/definitions/ServerPrivateLinkServiceConnectionStateProperty", + "description": "Connection state of the private endpoint connection." + }, + "provisioningState": { + "description": "State of the private endpoint connection.", + "enum": [ + "Approving", + "Ready", + "Dropping", + "Failed", + "Rejecting" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "PrivateEndpointProvisioningState", + "modelAsString": false + } + } + } + }, + "PrivateEndpointProperty": { + "type": "object", + "properties": { + "id": { + "description": "Resource id of the private endpoint.", + "type": "string" + } + }, + "x-ms-azure-resource": true + }, + "ServerPrivateLinkServiceConnectionStateProperty": { + "required": [ + "status", + "description" + ], + "type": "object", + "properties": { + "status": { + "description": "The private link service connection status.", + "enum": [ + "Approved", + "Pending", + "Rejected", + "Disconnected" + ], + "type": "string", + "x-ms-enum": { + "name": "PrivateLinkServiceConnectionStateStatus", + "modelAsString": false + } + }, + "description": { + "description": "The private link service connection description.", + "type": "string" + }, + "actionsRequired": { + "description": "The actions required for private link service connection.", + "enum": [ + "None", + "app" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "PrivateLinkServiceConnectionStateActionsRequire", + "modelAsString": false + } + } + } + }, + "TrackedResource": { + "description": "Resource properties including location and tags for track resources.", + "properties": { + "location": { + "type": "string", + "description": "The location the resource resides in." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-specific metadata in the form of key-value pairs." + } + }, + "allOf": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "required": [ + "location" + ] + }, + "ServerProperties": { + "properties": { + "administratorLogin": { + "type": "string", + "description": "The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation)." + }, + "version": { + "$ref": "#/definitions/ServerVersion", + "description": "Server version." + }, + "sslEnforcement": { + "$ref": "#/definitions/SslEnforcement", + "description": "Enable ssl enforcement or not when connect to server." + }, + "minimalTlsVersion": { + "$ref": "#/definitions/MinimalTlsVersion", + "description": "Enforce a minimal Tls version for the server." + }, + "byokEnforcement": { + "type": "string", + "description": "Status showing whether the server data encryption is enabled with customer-managed keys.", + "readOnly": true + }, + "infrastructureEncryption": { + "$ref": "#/definitions/InfrastructureEncryption", + "description": "Status showing whether the server enabled infrastructure encryption." + }, + "userVisibleState": { + "type": "string", + "description": "A state of a server that is visible to user.", + "enum": [ + "Ready", + "Dropping", + "Disabled", + "Inaccessible" + ], + "x-ms-enum": { + "name": "ServerState", + "modelAsString": false + } + }, + "fullyQualifiedDomainName": { + "type": "string", + "description": "The fully qualified domain name of a server." + }, + "earliestRestoreDate": { + "type": "string", + "format": "date-time", + "description": "Earliest restore point creation time (ISO8601 format)" + }, + "storageProfile": { + "$ref": "#/definitions/StorageProfile", + "description": "Storage profile of a server." + }, + "replicationRole": { + "type": "string", + "description": "The replication role of the server." + }, + "masterServerId": { + "type": "string", + "description": "The master server id of a replica server." + }, + "replicaCapacity": { + "type": "integer", + "format": "int32", + "minimum": 0, + "description": "The maximum number of replicas that a master server can have." + }, + "publicNetworkAccess": { + "$ref": "#/definitions/PublicNetworkAccess", + "description": "Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'" + }, + "privateEndpointConnections": { + "description": "List of private endpoint connections on a server", + "type": "array", + "items": { + "$ref": "#/definitions/ServerPrivateEndpointConnection" + }, + "readOnly": true + } + }, + "description": "The properties of a server." + }, + "StorageProfile": { + "properties": { + "backupRetentionDays": { + "type": "integer", + "description": "Backup retention days for the server." + }, + "geoRedundantBackup": { + "type": "string", + "description": "Enable Geo-redundant or not for server backup.", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "GeoRedundantBackup", + "modelAsString": false + } + }, + "storageMB": { + "type": "integer", + "format": "int32", + "description": "Max storage allowed for a server." + }, + "storageAutogrow": { + "type": "string", + "description": "Enable Storage Auto Grow.", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "StorageAutogrow", + "modelAsString": false + } + } + }, + "description": "Storage Profile properties of a server" + }, + "ServerPropertiesForCreate": { + "discriminator": "createMode", + "required": [ + "createMode" + ], + "properties": { + "version": { + "$ref": "#/definitions/ServerVersion", + "description": "Server version." + }, + "sslEnforcement": { + "$ref": "#/definitions/SslEnforcement", + "description": "Enable ssl enforcement or not when connect to server." + }, + "minimalTlsVersion": { + "$ref": "#/definitions/MinimalTlsVersion", + "description": "Enforce a minimal Tls version for the server." + }, + "infrastructureEncryption": { + "$ref": "#/definitions/InfrastructureEncryption", + "description": "Status showing whether the server enabled infrastructure encryption." + }, + "publicNetworkAccess": { + "$ref": "#/definitions/PublicNetworkAccess", + "description": "Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'" + }, + "storageProfile": { + "$ref": "#/definitions/StorageProfile", + "description": "Storage profile of a server." + }, + "createMode": { + "type": "string", + "description": "The mode to create a new server.", + "enum": [ + "Default", + "PointInTimeRestore", + "GeoRestore", + "Replica" + ], + "x-ms-enum": { + "name": "CreateMode", + "modelAsString": false + } + } + }, + "description": "The properties used to create a new server." + }, + "ServerPropertiesForDefaultCreate": { + "x-ms-discriminator-value": "Default", + "allOf": [ + { + "$ref": "#/definitions/ServerPropertiesForCreate" + } + ], + "properties": { + "administratorLogin": { + "type": "string", + "description": "The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation)." + }, + "administratorLoginPassword": { + "type": "string", + "format": "password", + "description": "The password of the administrator login." + } + }, + "required": [ + "administratorLogin", + "administratorLoginPassword" + ], + "description": "The properties used to create a new server." + }, + "ServerPropertiesForRestore": { + "x-ms-discriminator-value": "PointInTimeRestore", + "allOf": [ + { + "$ref": "#/definitions/ServerPropertiesForCreate" + } + ], + "properties": { + "sourceServerId": { + "type": "string", + "description": "The source server id to restore from." + }, + "restorePointInTime": { + "type": "string", + "format": "date-time", + "description": "Restore point creation time (ISO8601 format), specifying the time to restore from." + } + }, + "required": [ + "sourceServerId", + "restorePointInTime" + ], + "description": "The properties used to create a new server by restoring from a backup." + }, + "ServerPropertiesForGeoRestore": { + "x-ms-discriminator-value": "GeoRestore", + "allOf": [ + { + "$ref": "#/definitions/ServerPropertiesForCreate" + } + ], + "properties": { + "sourceServerId": { + "type": "string", + "description": "The source server id to restore from." + } + }, + "required": [ + "sourceServerId" + ], + "description": "The properties used to create a new server by restoring to a different region from a geo replicated backup." + }, + "ServerPropertiesForReplica": { + "x-ms-discriminator-value": "Replica", + "allOf": [ + { + "$ref": "#/definitions/ServerPropertiesForCreate" + } + ], + "properties": { + "sourceServerId": { + "type": "string", + "description": "The master server id to create replica from." + } + }, + "required": [ + "sourceServerId" + ], + "description": "The properties to create a new replica." + }, + "Sku": { + "properties": { + "name": { + "type": "string", + "description": "The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8." + }, + "tier": { + "type": "string", + "description": "The tier of the particular SKU, e.g. Basic.", + "enum": [ + "Basic", + "GeneralPurpose", + "MemoryOptimized" + ], + "x-ms-enum": { + "name": "SkuTier", + "modelAsString": false + } + }, + "capacity": { + "type": "integer", + "format": "int32", + "minimum": 0, + "description": "The scale up/out capacity, representing server's compute units." + }, + "size": { + "type": "string", + "description": "The size code, to be interpreted by resource as appropriate." + }, + "family": { + "type": "string", + "description": "The family of hardware." + } + }, + "description": "Billing information related properties of a server." + }, + "ResourceIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "type": "object", + "properties": { + "principalId": { + "format": "uuid", + "description": "The Azure Active Directory principal id.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.", + "enum": [ + "SystemAssigned", + "app" + ], + "type": "string", + "x-ms-enum": { + "name": "IdentityType", + "modelAsString": false + } + }, + "tenantId": { + "format": "uuid", + "description": "The Azure Active Directory tenant id.", + "type": "string", + "readOnly": true + } + } + }, + "Server": { + "properties": { + "identity": { + "$ref": "#/definitions/ResourceIdentity", + "description": "The Azure Active Directory identity of the server." + }, + "sku": { + "$ref": "#/definitions/Sku", + "description": "The SKU (pricing tier) of the server." + }, + "properties": { + "$ref": "#/definitions/ServerProperties", + "x-ms-client-flatten": true, + "description": "Properties of the server." + } + }, + "allOf": [ + { + "$ref": "#/definitions/TrackedResource" + } + ], + "description": "Represents a server." + }, + "ServerForCreate": { + "properties": { + "identity": { + "$ref": "#/definitions/ResourceIdentity", + "description": "The Azure Active Directory identity of the server." + }, + "sku": { + "$ref": "#/definitions/Sku", + "description": "The SKU (pricing tier) of the server." + }, + "properties": { + "$ref": "#/definitions/ServerPropertiesForCreate", + "x-ms-client-flatten": false, + "description": "Properties of the server." + }, + "location": { + "type": "string", + "description": "The location the resource resides in." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-specific metadata in the form of key-value pairs." + } + }, + "required": [ + "properties", + "location" + ], + "description": "Represents a server to be created." + }, + "ServerUpdateParameters": { + "properties": { + "identity": { + "$ref": "#/definitions/ResourceIdentity", + "description": "The Azure Active Directory identity of the server." + }, + "sku": { + "$ref": "#/definitions/Sku", + "description": "The SKU (pricing tier) of the server." + }, + "properties": { + "properties": { + "storageProfile": { + "$ref": "#/definitions/StorageProfile", + "description": "Storage profile of a server." + }, + "administratorLoginPassword": { + "type": "string", + "format": "password", + "description": "The password of the administrator login." + }, + "version": { + "$ref": "#/definitions/ServerVersion", + "description": "The version of a server." + }, + "sslEnforcement": { + "$ref": "#/definitions/SslEnforcement", + "description": "Enable ssl enforcement or not when connect to server." + }, + "minimalTlsVersion": { + "$ref": "#/definitions/MinimalTlsVersion", + "description": "Enforce a minimal Tls version for the server." + }, + "publicNetworkAccess": { + "$ref": "#/definitions/PublicNetworkAccess", + "description": "Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'" + }, + "replicationRole": { + "type": "string", + "description": "The replication role of the server." + } + }, + "x-ms-client-flatten": true, + "description": "The properties that can be updated for a server." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Application-specific metadata in the form of key-value pairs." + } + }, + "description": "Parameters allowed to update for a server." + }, + "ServerListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Server" + }, + "description": "The list of servers" + } + }, + "description": "A list of servers." + }, + "FirewallRuleProperties": { + "properties": { + "startIpAddress": { + "type": "string", + "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$", + "description": "The start IP address of the server firewall rule. Must be IPv4 format." + }, + "endIpAddress": { + "type": "string", + "pattern": "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$", + "description": "The end IP address of the server firewall rule. Must be IPv4 format." + } + }, + "required": [ + "startIpAddress", + "endIpAddress" + ], + "description": "The properties of a server firewall rule." + }, + "FirewallRule": { + "properties": { + "properties": { + "$ref": "#/definitions/FirewallRuleProperties", + "x-ms-client-flatten": true, + "description": "The properties of a firewall rule." + } + }, + "allOf": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "required": [ + "properties" + ], + "description": "Represents a server firewall rule." + }, + "FirewallRuleListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + }, + "description": "The list of firewall rules in a server." + } + }, + "description": "A list of firewall rules." + }, + "VirtualNetworkRuleProperties": { + "description": "Properties of a virtual network rule.", + "required": [ + "virtualNetworkSubnetId" + ], + "type": "object", + "properties": { + "virtualNetworkSubnetId": { + "description": "The ARM resource id of the virtual network subnet.", + "type": "string" + }, + "ignoreMissingVnetServiceEndpoint": { + "description": "Create firewall rule before the virtual network has vnet service endpoint enabled.", + "type": "boolean" + }, + "state": { + "description": "Virtual Network Rule State", + "enum": [ + "Initializing", + "InProgress", + "Ready", + "Deleting", + "Unknown" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "VirtualNetworkRuleState", + "modelAsString": false + } + } + } + }, + "VirtualNetworkRule": { + "description": "A virtual network rule.", + "type": "object", + "allOf": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/VirtualNetworkRuleProperties", + "description": "Resource properties.", + "x-ms-client-flatten": true + } + } + }, + "VirtualNetworkRuleListResult": { + "description": "A list of virtual network rules.", + "type": "object", + "properties": { + "value": { + "description": "Array of results.", + "type": "array", + "items": { + "$ref": "#/definitions/VirtualNetworkRule" + }, + "readOnly": true + }, + "nextLink": { + "description": "Link to retrieve next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "DatabaseProperties": { + "properties": { + "charset": { + "type": "string", + "description": "The charset of the database." + }, + "collation": { + "type": "string", + "description": "The collation of the database." + } + }, + "description": "The properties of a database." + }, + "Database": { + "properties": { + "properties": { + "$ref": "#/definitions/DatabaseProperties", + "x-ms-client-flatten": true, + "description": "The properties of a database." + } + }, + "allOf": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a Database." + }, + "DatabaseListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Database" + }, + "description": "The list of databases housed in a server" + } + }, + "description": "A List of databases." + }, + "ConfigurationProperties": { + "properties": { + "value": { + "type": "string", + "description": "Value of the configuration." + }, + "description": { + "type": "string", + "readOnly": true, + "description": "Description of the configuration." + }, + "defaultValue": { + "type": "string", + "readOnly": true, + "description": "Default value of the configuration." + }, + "dataType": { + "type": "string", + "readOnly": true, + "description": "Data type of the configuration." + }, + "allowedValues": { + "type": "string", + "readOnly": true, + "description": "Allowed values of the configuration." + }, + "source": { + "type": "string", + "description": "Source of the configuration." + } + }, + "description": "The properties of a configuration." + }, + "Configuration": { + "properties": { + "properties": { + "$ref": "#/definitions/ConfigurationProperties", + "x-ms-client-flatten": true, + "description": "The properties of a configuration." + } + }, + "allOf": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a Configuration." + }, + "ConfigurationListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Configuration" + }, + "description": "The list of server configurations." + } + }, + "description": "A list of server configurations." + }, + "OperationDisplay": { + "properties": { + "provider": { + "type": "string", + "readOnly": true, + "description": "Operation resource provider name." + }, + "resource": { + "type": "string", + "readOnly": true, + "description": "Resource on which the operation is performed." + }, + "operation": { + "type": "string", + "readOnly": true, + "description": "Localized friendly name for the operation." + }, + "description": { + "type": "string", + "readOnly": true, + "description": "Operation description." + } + }, + "description": "Display metadata associated with the operation." + }, + "Operation": { + "properties": { + "name": { + "type": "string", + "readOnly": true, + "description": "The name of the operation being performed on this particular object." + }, + "display": { + "$ref": "#/definitions/OperationDisplay", + "readOnly": true, + "description": "The localized display information for this particular operation or action." + }, + "origin": { + "type": "string", + "readOnly": true, + "description": "The intended executor of the operation.", + "enum": [ + "NotSpecified", + "user", + "system" + ], + "x-ms-enum": { + "name": "OperationOrigin", + "modelAsString": false + } + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "readOnly": true, + "x-ms-client-flatten": false, + "description": "Additional descriptions for the operation." + } + }, + "description": "REST API operation definition." + }, + "OperationListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "description": "The list of resource provider operations." + } + }, + "description": "A list of resource provider operations." + }, + "LogFileProperties": { + "properties": { + "sizeInKB": { + "type": "integer", + "format": "int64", + "description": "Size of the log file." + }, + "createdTime": { + "type": "string", + "readOnly": true, + "format": "date-time", + "description": "Creation timestamp of the log file." + }, + "lastModifiedTime": { + "type": "string", + "readOnly": true, + "format": "date-time", + "description": "Last modified timestamp of the log file." + }, + "type": { + "type": "string", + "description": "Type of the log file." + }, + "url": { + "type": "string", + "description": "The url to download the log file from." + } + }, + "description": "The properties of a log file." + }, + "LogFile": { + "properties": { + "name": { + "type": "string", + "description": "The name of the log file." + }, + "properties": { + "$ref": "#/definitions/LogFileProperties", + "x-ms-client-flatten": true, + "description": "The properties of the log file." + } + }, + "allOf": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ], + "description": "Represents a log file." + }, + "LogFileListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/LogFile" + }, + "description": "The list of log files." + } + }, + "description": "A list of log files." + }, + "PerformanceTierServiceLevelObjectives": { + "properties": { + "id": { + "type": "string", + "description": "ID for the service level objective." + }, + "edition": { + "type": "string", + "description": "Edition of the performance tier." + }, + "vCore": { + "type": "integer", + "description": "vCore associated with the service level objective" + }, + "hardwareGeneration": { + "type": "string", + "description": "Hardware generation associated with the service level objective" + }, + "maxBackupRetentionDays": { + "type": "integer", + "description": "Maximum Backup retention in days for the performance tier edition" + }, + "minBackupRetentionDays": { + "type": "integer", + "description": "Minimum Backup retention in days for the performance tier edition" + }, + "maxStorageMB": { + "type": "integer", + "format": "int32", + "description": "Max storage allowed for a server." + }, + "minStorageMB": { + "type": "integer", + "format": "int32", + "description": "Max storage allowed for a server." + } + }, + "description": "Service level objectives for performance tier." + }, + "PerformanceTierProperties": { + "properties": { + "id": { + "type": "string", + "description": "ID of the performance tier." + }, + "serviceLevelObjectives": { + "type": "array", + "items": { + "$ref": "#/definitions/PerformanceTierServiceLevelObjectives" + }, + "description": "Service level objectives associated with the performance tier" + } + }, + "description": "Performance tier properties" + }, + "PerformanceTierListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/PerformanceTierProperties" + }, + "description": "The list of performance tiers" + } + }, + "description": "A list of performance tiers." + }, + "NameAvailabilityRequest": { + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Resource name to verify." + }, + "type": { + "type": "string", + "description": "Resource type used for verification." + } + }, + "description": "Request from client to check resource name availability." + }, + "NameAvailability": { + "properties": { + "message": { + "type": "string", + "description": "Error Message." + }, + "nameAvailable": { + "type": "boolean", + "description": "Indicates whether the resource name is available." + }, + "reason": { + "type": "string", + "description": "Reason for name being unavailable." + } + }, + "description": "Represents a resource name availability." + }, + "CloudError": { + "x-ms-external": true, + "properties": { + "error": { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ErrorResponse" + } + }, + "description": "An error response from the Batch service." + }, + "ServerAdministratorProperties": { + "properties": { + "administratorType": { + "type": "string", + "description": "The type of administrator.", + "enum": [ + "ActiveDirectory", + "app" + ], + "x-ms-enum": { + "name": "AdministratorType" + } + }, + "login": { + "type": "string", + "description": "The server administrator login account name." + }, + "sid": { + "type": "string", + "description": "The server administrator Sid (Secure ID).", + "format": "uuid" + }, + "tenantId": { + "type": "string", + "description": "The server Active Directory Administrator tenant id.", + "format": "uuid" + } + }, + "required": [ + "tenantId", + "administratorType", + "login", + "sid" + ], + "description": "The properties of an server Administrator." + }, + "ServerAdministratorResource": { + "properties": { + "properties": { + "$ref": "#/definitions/ServerAdministratorProperties", + "x-ms-client-flatten": true, + "description": "Properties of the server AAD administrator." + } + }, + "description": "Represents a and external administrator to be created.", + "allOf": [ + { + "$ref": "./common-types/resource-management/v1/types.json#/definitions/ProxyResource" + } + ] + }, + "ServerAdministratorResourceListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ServerAdministratorResource" + }, + "description": "The list of server Active Directory Administrators for the server." + } + }, + "description": "The response to a list Active Directory Administrators request." + } + }, + "parameters": { + "ServerNameParameter": { + "name": "serverName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server.", + "x-ms-parameter-location": "method" + }, + "FirewallRuleNameParameter": { + "name": "firewallRuleName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server firewall rule.", + "x-ms-parameter-location": "method" + }, + "virtualNetworkRuleNameParameter": { + "name": "virtualNetworkRuleName", + "in": "path", + "description": "The name of the virtual network rule.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "DatabaseNameParameter": { + "name": "databaseName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the database.", + "x-ms-parameter-location": "method" + }, + "ConfigurationNameParameter": { + "name": "configurationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the server configuration.", + "x-ms-parameter-location": "method" + }, + "LocationNameParameter": { + "name": "locationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the location.", + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file diff --git a/tests-upgrade/mysql/readme.md b/tests-upgrade/mysql/readme.md new file mode 100644 index 00000000000..59a155a136f --- /dev/null +++ b/tests-upgrade/mysql/readme.md @@ -0,0 +1,139 @@ + +# Az.MySql +This directory contains the PowerShell module for the MySql service. + +--- +## Status +[![Az.MySql](https://img.shields.io/powershellgallery/v/Az.MySql.svg?style=flat-square&label=Az.MySql "Az.MySql")](https://www.powershellgallery.com/packages/Az.MySql/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.7.4 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.MySql`, see [how-to.md](how-to.md). + + +--- +## Generation Requirements +Use of the beta version of `autorest.powershell` generator requires the following: +- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred) + - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes. +> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended. +- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@beta`
  +- PowerShell 6.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
  +- .NET Core SDK 2.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
  + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../readme.azure.noprofile.md +input-file: + - ./mysql.json +module-version: 0.1.0 +title: MySQL +subject-prefix: 'MySQL' + +directive: + - from: mysql.json + where: $.definitions.VirtualNetworkRule + transform: $['required'] = ['properties'] + - where: + verb: Set + subject: Configuration$|FirewallRule$|VirtualNetworkRule$ + set: + verb: Update + - where: + verb: ^New$|^Set$|^Remove$|^Get|^Update$|^Invoke$ + subject: Database$|SecurityAlertPolicy$|Administrator$|LocationBasedPerformanceTier$|LogFile$|ExecuteCheckNameAvailability$ + hide: true + - where: + verb: New$|Update$ + subject: Server$ + hide: true + - where: + verb: New$ + variant: ^Create$ + hide: true + - where: + verb: New$ + variant: ^CreateViaIdentity + hide: true + - where: + verb: New$|Update$ + variant: ^(?!.*?Expanded) + hide: true + - where: + verb: New + subject: Configuration + hide: true + - where: + parameter-name: VirtualNetworkSubnetId + subject: VirtualNetworkRule + set: + parameter-name: SubnetId + - where: + model-name: Server + set: + format-table: + properties: + - Name + - Location + - AdministratorLogin + - Version + - StorageProfileStorageMb + - SkuName + - SkuSize + - SkuTier + - SslEnforcement + - where: + model-name: Configuration + set: + format-table: + properties: + - Name + - Value + - where: + model-name: FirewallRule + set: + format-table: + properties: + - Name + - StartIPAddress + - EndIPAddress + - where: + parameter-name: StorageProfileBackupRetentionDay + subject: Server + set: + parameter-description: Backup retention days for the server. Day count is between 7 and 35. + - from: source-file-csharp + where: $ + transform: $ = $.replace(/OperationOrigin System/, 'OperationOrigin System1'); + - from: source-file-csharp + where: $ + transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServerPropertiesForCreate Property', 'public Microsoft.Azure.PowerShell.Cmdlets.MySql.Models.Api20171201.IServerPropertiesForCreate Property'); + - from: source-file-csharp + where: $ + transform: $ = $.replace('public int StorageProfileBackupRetentionDay', '[System.Management.Automation.ValidateRangeAttribute(7,35)]\n public int StorageProfileBackupRetentionDay'); +``` diff --git a/tests-upgrade/mysql/resources/readme.md b/tests-upgrade/mysql/resources/readme.md new file mode 100644 index 00000000000..937f07f8fec --- /dev/null +++ b/tests-upgrade/mysql/resources/readme.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/tests-upgrade/mysql/test/loadEnv.ps1 b/tests-upgrade/mysql/test/loadEnv.ps1 new file mode 100644 index 00000000000..c4ebf2e8310 --- /dev/null +++ b/tests-upgrade/mysql/test/loadEnv.ps1 @@ -0,0 +1,28 @@ +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/tests-upgrade/mysql/test/readme.md b/tests-upgrade/mysql/test/readme.md new file mode 100644 index 00000000000..7c752b4c8c4 --- /dev/null +++ b/tests-upgrade/mysql/test/readme.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/.gitattributes b/tests-upgrade/mysql/tools/Resources/.gitattributes new file mode 100644 index 00000000000..2125666142e --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/.gitignore b/tests-upgrade/mysql/tools/Resources/.gitignore new file mode 100644 index 00000000000..649721c69ce --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/.gitignore @@ -0,0 +1,14 @@ +bin +obj +.vs +generated +internal +exports +custom/*.psm1 +test/*-TestResults.xml +/*.ps1 +/*.ps1xml +/*.psm1 +/*.snk +/*.csproj +/*.nuspec \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/custom/New-AzDeployment.ps1 b/tests-upgrade/mysql/tools/Resources/custom/New-AzDeployment.ps1 new file mode 100644 index 00000000000..4ece0d887e4 --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/custom/New-AzDeployment.ps1 @@ -0,0 +1,231 @@ +function New-AzDeployment { + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Resources.Models.Api20180501.IDeploymentExtended')] + [CmdletBinding(DefaultParameterSetName='CreateWithTemplateFileParameterFile', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Description('You can provide the template and parameters directly in the request or link to JSON files.')] + param( + [Parameter(HelpMessage='The name of the deployment. If not provided, the name of the template file will be used. If a template file is not used, a random GUID will be used for the name.')] + [Alias('DeploymentName')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Runtime.Info(SerializedName='deploymentName', Required, PossibleTypes=([System.String]), Description='The name of the deployment.')] + [System.String] + # The name of the deployment. If not provided, the name of the template file will be used. If a template file is not used, a random GUID will be used for the name. + ${Name}, + + [Parameter(Mandatory, HelpMessage='The ID of the target subscription.')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Runtime.Info(SerializedName='subscriptionId', Required, PossibleTypes=([System.String]), Description='The ID of the target subscription.')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterFile', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterJson', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterObject', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterFile', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterJson', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterObject', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterFile', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterJson', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterObject', Mandatory, HelpMessage='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Runtime.Info(SerializedName='resourceGroupName', Required, PossibleTypes=([System.String]), Description='The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.')] + [System.String] + # The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='CreateWithTemplateFileParameterFile', Mandatory, HelpMessage='Local path to the JSON template file.')] + [Parameter(ParameterSetName='CreateWithTemplateFileParameterJson', Mandatory, HelpMessage='Local path to the JSON template file.')] + [Parameter(ParameterSetName='CreateWithTemplateFileParameterObject', Mandatory, HelpMessage='Local path to the JSON template file.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterFile', Mandatory, HelpMessage='Local path to the JSON template file.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterJson', Mandatory, HelpMessage='Local path to the JSON template file.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterObject', Mandatory, HelpMessage='Local path to the JSON template file.')] + [System.String] + # Local path to the JSON template file. + ${TemplateFile}, + + [Parameter(ParameterSetName='CreateWithTemplateJsonParameterFile', Mandatory, HelpMessage='The string representation of the JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateJsonParameterJson', Mandatory, HelpMessage='The string representation of the JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateJsonParameterObject', Mandatory, HelpMessage='The string representation of the JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterFile', Mandatory, HelpMessage='The string representation of the JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterJson', Mandatory, HelpMessage='The string representation of the JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterObject', Mandatory, HelpMessage='The string representation of the JSON template.')] + [System.String] + # The string representation of the JSON template. + ${TemplateJson}, + + [Parameter(ParameterSetName='CreateWithTemplateObjectParameterFile', Mandatory, HelpMessage='The hashtable representation of the JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterFile', Mandatory, HelpMessage='The hashtable representation of the JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateObjectParameterJson', Mandatory, HelpMessage='The hashtable representation of the JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterJson', Mandatory, HelpMessage='The hashtable representation of the JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateObjectParameterObject', Mandatory, HelpMessage='The hashtable representation of the JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterObject', Mandatory, HelpMessage='The hashtable representation of the JSON template.')] + [System.Collections.Hashtable] + # The hashtable representation of the JSON template. + ${TemplateObject}, + + [Parameter(ParameterSetName='CreateWithTemplateFileParameterFile', Mandatory, HelpMessage='Local path to the parameter JSON template file.')] + [Parameter(ParameterSetName='CreateWithTemplateJsonParameterFile', Mandatory, HelpMessage='Local path to the parameter JSON template file.')] + [Parameter(ParameterSetName='CreateWithTemplateObjectParameterFile', Mandatory, HelpMessage='Local path to the parameter JSON template file.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterFile', Mandatory, HelpMessage='Local path to the parameter JSON template file.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterFile', Mandatory, HelpMessage='Local path to the parameter JSON template file.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterFile', Mandatory, HelpMessage='Local path to the parameter JSON template file.')] + [System.String] + # Local path to the parameter JSON template file. + ${TemplateParameterFile}, + + [Parameter(ParameterSetName='CreateWithTemplateFileParameterJson', Mandatory, HelpMessage='The string representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateJsonParameterJson', Mandatory, HelpMessage='The string representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateObjectParameterJson', Mandatory, HelpMessage='The string representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterJson', Mandatory, HelpMessage='The string representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterJson', Mandatory, HelpMessage='The string representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterJson', Mandatory, HelpMessage='The string representation of the parameter JSON template.')] + [System.String] + # The string representation of the parameter JSON template. + ${TemplateParameterJson}, + + [Parameter(ParameterSetName='CreateWithTemplateFileParameterObject', Mandatory, HelpMessage='The hashtable representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateFileParameterObject', Mandatory, HelpMessage='The hashtable representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateJsonParameterObject', Mandatory, HelpMessage='The hashtable representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateJsonParameterObject', Mandatory, HelpMessage='The hashtable representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateWithTemplateObjectParameterObject', Mandatory, HelpMessage='The hashtable representation of the parameter JSON template.')] + [Parameter(ParameterSetName='CreateRGWithTemplateObjectParameterObject', Mandatory, HelpMessage='The hashtable representation of the parameter JSON template.')] + [System.Collections.Hashtable] + # The hashtable representation of the parameter JSON template. + ${TemplateParameterObject}, + + [Parameter(Mandatory, HelpMessage='The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources.')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.Support.DeploymentMode])] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Runtime.Info(SerializedName='mode', Required, PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Resources.Support.DeploymentMode]), Description='The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources.')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Support.DeploymentMode] + # The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. + ${Mode}, + + [Parameter(HelpMessage='Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations.')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Runtime.Info(SerializedName='detailLevel', PossibleTypes=([System.String]), Description='Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations.')] + [System.String] + # Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations. + ${DeploymentDebugLogLevel}, + + [Parameter(HelpMessage='The location to store the deployment data.')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Runtime.Info(SerializedName='location', PossibleTypes=([System.String]), Description='The location to store the deployment data.')] + [System.String] + # The location to store the deployment data. + ${Location}, + + [Parameter(HelpMessage='The credentials, account, tenant, and subscription used for communication with Azure.')] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(HelpMessage='Run the command as a job')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(HelpMessage='Run the command asynchronously')] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait} + + ) + + process { + if ($PSBoundParameters.ContainsKey("TemplateFile")) + { + if (!(Test-Path -Path $TemplateFile)) + { + throw "Unable to find template file '$TemplateFile'." + } + + if (!$PSBoundParameters.ContainsKey("Name")) + { + $DeploymentName = (Get-Item -Path $TemplateFile).BaseName + $null = $PSBoundParameters.Add("Name", $DeploymentName) + } + + $TemplateJson = [System.IO.File]::ReadAllText($TemplateFile) + $null = $PSBoundParameters.Add("Template", $TemplateJson) + $null = $PSBoundParameters.Remove("TemplateFile") + } + elseif ($PSBoundParameters.ContainsKey("TemplateJson")) + { + $null = $PSBoundParameters.Add("Template", $TemplateJson) + $null = $PSBoundParameters.Remove("TemplateJson") + } + elseif ($PSBoundParameters.ContainsKey("TemplateObject")) + { + $TemplateJson = ConvertTo-Json -InputObject $TemplateObject + $null = $PSBoundParameters.Add("Template", $TemplateJson) + $null = $PSBoundParameters.Remove("TemplateObject") + } + + if ($PSBoundParameters.ContainsKey("TemplateParameterFile")) + { + if (!(Test-Path -Path $TemplateParameterFile)) + { + throw "Unable to find template parameter file '$TemplateParameterFile'." + } + + $ParameterJson = [System.IO.File]::ReadAllText($TemplateParameterFile) + $ParameterObject = ConvertFrom-Json -InputObject $ParameterJson + $ParameterHashtable = @{} + $ParameterObject.PSObject.Properties | ForEach-Object { $ParameterHashtable[$_.Name] = $_.Value } + $ParameterHashtable.Remove("`$schema") + $ParameterHashtable.Remove("contentVersion") + $NestedValues = $ParameterHashtable.parameters + if ($null -ne $NestedValues) + { + $ParameterHashtable.Remove("parameters") + $NestedValues.PSObject.Properties | ForEach-Object { $ParameterHashtable[$_.Name] = $_.Value } + } + + $ParameterJson = ConvertTo-Json -InputObject $ParameterHashtable + $null = $PSBoundParameters.Add("DeploymentPropertyParameter", $ParameterJson) + $null = $PSBoundParameters.Remove("TemplateParameterFile") + } + elseif ($PSBoundParameters.ContainsKey("TemplateParameterJson")) + { + $null = $PSBoundParameters.Add("DeploymentPropertyParameter", $TemplateParameterJson) + $null = $PSBoundParameters.Remove("TemplateParameterJson") + } + elseif ($PSBoundParameters.ContainsKey("TemplateParameterObject")) + { + $TemplateParameterObject.Remove("`$schema") + $TemplateParameterObject.Remove("contentVersion") + $NestedValues = $TemplateParameterObject.parameters + if ($null -ne $NestedValues) + { + $TemplateParameterObject.Remove("parameters") + $NestedValues.PSObject.Properties | ForEach-Object { $TemplateParameterObject[$_.Name] = $_.Value } + } + + $TemplateParameterJson = ConvertTo-Json -InputObject $TemplateParameterObject + $null = $PSBoundParameters.Add("DeploymentPropertyParameter", $TemplateParameterJson) + $null = $PSBoundParameters.Remove("TemplateParameterObject") + } + + if (!$PSBoundParameters.ContainsKey("Name")) + { + $DeploymentName = (New-Guid).Guid + $null = $PSBoundParameters.Add("Name", $DeploymentName) + } + + if ($PSBoundParameters.ContainsKey("ResourceGroupName")) + { + Az.Resources.TestSupport.private\New-AzDeployment_CreateExpanded @PSBoundParameters + } + else + { + Az.Resources.TestSupport.private\New-AzDeployment_CreateExpanded @PSBoundParameters + } + } +} \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/docs/readme.md b/tests-upgrade/mysql/tools/Resources/docs/readme.md new file mode 100644 index 00000000000..95fb0e21daf --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/docs/readme.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.Resources` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overriden on regeneration*. To update documentation examples, please use the `..\examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.Resources` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/examples/readme.md b/tests-upgrade/mysql/tools/Resources/examples/readme.md new file mode 100644 index 00000000000..ac871d71fc7 --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/examples/readme.md @@ -0,0 +1,11 @@ +# Examples +This directory contains examples from the exported cmdlets of the module. When `build-module.ps1` is ran, example stub files will be generated here. If your module support Azure Profiles, the example stubs will be in individual profile folders. These example stubs should be updated to show how the cmdlet is used. The examples are imported into the documentation when `generate-help.ps1` is ran. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Purpose +This separates the example documentation details from the generated documentation information provided directly from the generated cmdlets. Since the cmdlets don't have examples from the REST spec, this provides a means to add examples easily. The example stubs provide the markdown format that is required. The 3 core elements are: the name of the example, the code information of the example, and the description of the example. That information, if the markdown format is followed, will be available to documentation generation and be part of the documents in the `..\docs` folder. \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/how-to.md b/tests-upgrade/mysql/tools/Resources/how-to.md new file mode 100644 index 00000000000..c4daf2b254c --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.Resources`. + +## Building `Az.Resources` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [readme.md](exports/readme.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [readme.md](custom/readme.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [readme.md](examples/readme.md) in the `examples` folder. To read more about documentation, look at the [readme.md](docs/readme.md) in the `docs` folder. + +## Testing `Az.Resources` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [readme.md](examples/readme.md) in the `examples` folder. + +## Packing `Az.Resources` +To pack `Az.Resources` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/en-us/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.Resources`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.Resources.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.Resources.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.Resources`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.Resources` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/license.txt b/tests-upgrade/mysql/tools/Resources/license.txt new file mode 100644 index 00000000000..3d3f8f90d5d --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/license.txt @@ -0,0 +1,203 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/tests-upgrade/mysql/tools/Resources/readme.md b/tests-upgrade/mysql/tools/Resources/readme.md new file mode 100644 index 00000000000..aa61ef906c4 --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/readme.md @@ -0,0 +1,440 @@ + +# Az.Resources.TestSupport +This directory contains the PowerShell module for the Resources service. + +--- +## Status +[![Az.Resources.TestSupport](https://img.shields.io/powershellgallery/v/Az.Resources.TestSupport.svg?style=flat-square&label=Az.Resources.TestSupport "Az.Resources.TestSupport")](https://www.powershellgallery.com/packages/Az.Resources.TestSupport/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.7.4 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.Resources.TestSupport`, see [how-to.md](how-to.md). + + +--- +## Generation Requirements +Use of the beta version of `autorest.powershell` generator requires the following: +- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred) + - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes. +> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended. +- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g @autorest/autorest`
  +- PowerShell 6.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
  +- .NET Core SDK 2.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
  + +## Run Generation +In this directory, run AutoRest: +> `autorest` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +> Values +``` yaml +azure: true +powershell: true +branch: master +repo: https://github.com/Azure/azure-rest-api-specs/blob/master +metadata: + authors: Microsoft Corporation + owners: Microsoft Corporation + copyright: Microsoft Corporation. All rights reserved. + companyName: Microsoft Corporation + requireLicenseAcceptance: true + licenseUri: https://aka.ms/azps-license + projectUri: https://github.com/Azure/azure-powershell +``` + +> Names +``` yaml +prefix: Az +``` + +> Folders +``` yaml +clear-output-folder: true +``` + +``` yaml +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/resources/resource-manager/Microsoft.Resources/stable/2018-05-01/resources.json +module-name: Az.Resources.TestSupport +namespace: Microsoft.Azure.PowerShell.Cmdlets.Resources + +subject-prefix: '' +module-version: 0.0.1 +title: Resources + +directive: + - where: + subject: Operation + hide: true + - where: + parameter-name: SubscriptionId + set: + default: + script: '(Get-AzContext).Subscription.Id' + - from: swagger-document + where: $..parameters[?(@.name=='$filter')] + transform: $['x-ms-skip-url-encoding'] = true + - from: swagger-document + where: $..[?( /Resources_(CreateOrUpdate|Update|Delete|Get|GetById|CheckExistence|CheckExistenceById)/g.exec(@.operationId))] + transform: "$.parameters = $.parameters.map( each => { each.name = each.name === 'api-version' ? 'explicit-api-version' : each.name; return each; } );" + - from: source-file-csharp + where: $ + transform: $ = $.replace(/explicit-api-version/g, 'api-version'); + - where: + parameter-name: ExplicitApiVersion + set: + parameter-name: ApiVersion + - from: source-file-csharp + where: $ + transform: > + $ = $.replace(/result.OdataNextLink/g,'nextLink' ); + return $.replace( /(^\s*)(if\s*\(\s*nextLink\s*!=\s*null\s*\))/gm, '$1var nextLink = Module.Instance.FixNextLink(responseMessage, result.OdataNextLink);\n$1$2' ); + - from: swagger-document + where: + - $..DeploymentProperties.properties.template + - $..DeploymentProperties.properties.parameters + - $..ResourceGroupExportResult.properties.template + - $..PolicyDefinitionProperties.properties.policyRule + transform: $.additionalProperties = true; + - where: + verb: Set + subject: Resource + remove: true + - where: + verb: Set + subject: Deployment + remove: true + - where: + subject: Resource + parameter-name: GroupName + set: + parameter-name: ResourceGroupName + clear-alias: true + - where: + subject: Resource + parameter-name: Id + set: + parameter-name: ResourceId + clear-alias: true + - where: + subject: Resource + parameter-name: Type + set: + parameter-name: ResourceType + clear-alias: true + - where: + subject: Appliance* + remove: true + - where: + verb: Test + subject: CheckNameAvailability + set: + subject: NameAvailability + - where: + verb: Export + subject: ResourceGroupTemplate + set: + subject: ResourceGroup + alias: Export-AzResourceGroupTemplate + - where: + parameter-name: Filter + set: + alias: ODataQuery + - where: + verb: Test + subject: ResourceGroupExistence + set: + subject: ResourceGroup + alias: Test-AzResourceGroupExistence + - where: + verb: Export + subject: DeploymentTemplate + set: + alias: [Save-AzDeploymentTemplate, Save-AzResourceGroupDeploymentTemplate] + - where: + subject: Deployment + set: + alias: ${verb}-AzResourceGroupDeployment + - where: + verb: Get + subject: DeploymentOperation + set: + alias: Get-AzResourceGroupDeploymentOperation + - where: + verb: New + subject: Deployment + variant: Create.*Expanded.* + parameter-name: Parameter + set: + parameter-name: DeploymentPropertyParameter + - where: + verb: New + subject: Deployment + hide: true + - where: + verb: Test + subject: Deployment + variant: Validate.*Expanded.* + parameter-name: Parameter + set: + parameter-name: DeploymentPropertyParameter + - where: + verb: New + subject: Deployment + parameter-name: DebugSettingDetailLevel + set: + parameter-name: DeploymentDebugLogLevel + - where: + subject: Provider + set: + subject: ResourceProvider + - where: + subject: ProviderFeature|ResourceProvider|ResourceLock + parameter-name: ResourceProviderNamespace + set: + alias: ProviderNamespace + - where: + verb: Update + subject: ResourceGroup + parameter-name: Name + clear-alias: true + - where: + parameter-name: UpnOrObjectId + set: + alias: ['UserPrincipalName', 'Upn', 'ObjectId'] + - where: + subject: Deployment + variant: (.*)Expanded(.*) + parameter-name: Parameter + set: + parameter-name: DeploymentParameter + # Format output + - where: + model-name: GenericResource + set: + format-table: + properties: + - Name + - ResourceGroupName + - Type + - Location + labels: + Type: ResourceType + - where: + model-name: ResourceGroup + set: + format-table: + properties: + - Name + - Location + - ProvisioningState + - where: + model-name: DeploymentExtended + set: + format-table: + properties: + - Name + - ProvisioningState + - Timestamp + - Mode + - where: + model-name: PolicyAssignment + set: + format-table: + properties: + - Name + - DisplayName + - Id + - where: + model-name: PolicyDefinition + set: + format-table: + properties: + - Name + - DisplayName + - Id + - where: + model-name: PolicySetDefinition + set: + format-table: + properties: + - Name + - DisplayName + - Id + - where: + model-name: Provider + set: + format-table: + properties: + - Namespace + - RegistrationState + - where: + model-name: ProviderResourceType + set: + format-table: + properties: + - ResourceType + - Location + - ApiVersion + - where: + model-name: FeatureResult + set: + format-table: + properties: + - Name + - State + - where: + model-name: TagDetails + set: + format-table: + properties: + - TagName + - CountValue + - where: + model-name: Application + set: + format-table: + properties: + - DisplayName + - ObjectId + - AppId + - Homepage + - AvailableToOtherTenant + - where: + model-name: KeyCredential + set: + format-table: + properties: + - StartDate + - EndDate + - KeyId + - Type + - where: + model-name: PasswordCredential + set: + format-table: + properties: + - StartDate + - EndDate + - KeyId + - where: + model-name: User + set: + format-table: + properties: + - PrincipalName + - DisplayName + - ObjectId + - Type + - where: + model-name: AdGroup + set: + format-table: + properties: + - DisplayName + - Mail + - ObjectId + - SecurityEnabled + - where: + model-name: ServicePrincipal + set: + format-table: + properties: + - DisplayName + - ObjectId + - AppDisplayName + - AppId + - where: + model-name: Location + set: + format-table: + properties: + - Name + - DisplayName + - where: + model-name: ManagementLockObject + set: + format-table: + properties: + - Name + - Level + - ResourceId + - where: + model-name: RoleAssignment + set: + format-table: + properties: + - DisplayName + - ObjectId + - ObjectType + - RoleDefinitionName + - Scope + - where: + model-name: RoleDefinition + set: + format-table: + properties: + - RoleName + - Name + - Action +# To remove cmdlets not used in the test frame + - where: + subject: Operation + remove: true + - where: + subject: Deployment + variant: (.*)1|Cancel(.*)|Validate(.*)|Export(.*)|List(.*)|Delete(.*)|Check(.*)|Calculate(.*) + remove: true + - where: + subject: ResourceProvider + variant: Register(.*)|Unregister(.*)|Get(.*) + remove: true + - where: + subject: ResourceGroup + variant: List(.*)|Update(.*)|Export(.*)|Move(.*) + remove: true + - where: + subject: Resource + remove: true + - where: + subject: Tag|TagValue + remove: true + - where: + subject: DeploymentOperation + remove: true + - where: + subject: DeploymentTemplate + remove: true + - where: + subject: Calculate(.*) + remove: true + - where: + subject: ResourceExistence + remove: true + - where: + subject: ResourceMoveResource + remove: true + - where: + subject: DeploymentExistence + remove: true +``` diff --git a/tests-upgrade/mysql/tools/Resources/resources/CmdletSurface-latest-2019-04-30.md b/tests-upgrade/mysql/tools/Resources/resources/CmdletSurface-latest-2019-04-30.md new file mode 100644 index 00000000000..278ea694e0f --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/resources/CmdletSurface-latest-2019-04-30.md @@ -0,0 +1,598 @@ +### AzADApplication [Get, New, Remove, Update] `IApplication, Boolean` + - TenantId `String` + - ObjectId `String` + - IncludeDeleted `SwitchParameter` + - InputObject `IResourcesIdentity` + - HardDelete `SwitchParameter` + - Filter `String` + - IdentifierUri `String` + - DisplayNameStartWith `String` + - DisplayName `String` + - ApplicationId `String` + - AllowGuestsSignIn `SwitchParameter` + - AllowPassthroughUser `SwitchParameter` + - AppLogoUrl `String` + - AppPermission `String[]` + - AppRole `IAppRole[]` + - AvailableToOtherTenants `SwitchParameter` + - ErrorUrl `String` + - GroupMembershipClaim `GroupMembershipClaimTypes` + - Homepage `String` + - InformationalUrlMarketing `String` + - InformationalUrlPrivacy `String` + - InformationalUrlSupport `String` + - InformationalUrlTermsOfService `String` + - IsDeviceOnlyAuthSupported `SwitchParameter` + - KeyCredentials `IKeyCredential[]` + - KnownClientApplication `String[]` + - LogoutUrl `String` + - Oauth2AllowImplicitFlow `SwitchParameter` + - Oauth2AllowUrlPathMatching `SwitchParameter` + - Oauth2Permission `IOAuth2Permission[]` + - Oauth2RequirePostResponse `SwitchParameter` + - OptionalClaimAccessToken `IOptionalClaim[]` + - OptionalClaimIdToken `IOptionalClaim[]` + - OptionalClaimSamlToken `IOptionalClaim[]` + - OrgRestriction `String[]` + - PasswordCredentials `IPasswordCredential[]` + - PreAuthorizedApplication `IPreAuthorizedApplication[]` + - PublicClient `SwitchParameter` + - PublisherDomain `String` + - ReplyUrl `String[]` + - RequiredResourceAccess `IRequiredResourceAccess[]` + - SamlMetadataUrl `String` + - SignInAudience `String` + - WwwHomepage `String` + - Parameter `IApplicationCreateParameters` + - PassThru `SwitchParameter` + - AvailableToOtherTenant `SwitchParameter` + +### AzADApplicationOwner [Add, Get, Remove] `Boolean, IDirectoryObject` + - ObjectId `String` + - TenantId `String` + - InputObject `IResourcesIdentity` + - OwnerObjectId `String` + - AdditionalProperties `Hashtable` + - Url `String` + - Parameter `IAddOwnerParameters` + +### AzADDeletedApplication [Restore] `IApplication` + - ObjectId `String` + - TenantId `String` + - InputObject `IResourcesIdentity` + +### AzADGroup [Get, New, Remove] `IAdGroup, Boolean` + - TenantId `String` + - ObjectId `String` + - InputObject `IResourcesIdentity` + - Filter `String` + - DisplayNameStartsWith `String` + - DisplayName `String` + - AdditionalProperties `Hashtable` + - MailNickname `String` + - Parameter `IGroupCreateParameters` + - PassThru `SwitchParameter` + +### AzADGroupMember [Add, Get, Remove, Test] `Boolean, IDirectoryObject, SwitchParameter` + - GroupObjectId `String` + - TenantId `String` + - MemberObjectId `String[]` + - MemberUserPrincipalName `String[]` + - GroupObject `IAdGroup` + - GroupDisplayName `String` + - InputObject `IResourcesIdentity` + - ObjectId `String` + - ShowOwner `SwitchParameter` + - PassThru `SwitchParameter` + - AdditionalProperties `Hashtable` + - Url `String` + - Parameter `IGroupAddMemberParameters` + - DisplayName `String` + - GroupId `String` + - MemberId `String` + +### AzADGroupMemberGroup [Get] `String` + - ObjectId `String` + - TenantId `String` + - InputObject `IResourcesIdentity` + - AdditionalProperties `Hashtable` + - SecurityEnabledOnly `SwitchParameter` + - Parameter `IGroupGetMemberGroupsParameters` + +### AzADGroupOwner [Add, Remove] `Boolean` + - ObjectId `String` + - TenantId `String` + - GroupObjectId `String` + - MemberObjectId `String[]` + - InputObject `IResourcesIdentity` + - OwnerObjectId `String` + - PassThru `SwitchParameter` + - AdditionalProperties `Hashtable` + - Url `String` + - Parameter `IAddOwnerParameters` + +### AzADObject [Get] `IDirectoryObject` + - TenantId `String` + - InputObject `IResourcesIdentity` + - AdditionalProperties `Hashtable` + - IncludeDirectoryObjectReference `SwitchParameter` + - ObjectId `String[]` + - Type `String[]` + - Parameter `IGetObjectsParameters` + +### AzADServicePrincipal [Get, New, Remove, Update] `IServicePrincipal, Boolean` + - TenantId `String` + - ObjectId `String` + - InputObject `IResourcesIdentity` + - Filter `String` + - ApplicationObject `IApplication` + - ServicePrincipalName `String` + - DisplayNameBeginsWith `String` + - DisplayName `String` + - ApplicationId `String` + - AccountEnabled `SwitchParameter` + - AppId `String` + - AppRoleAssignmentRequired `SwitchParameter` + - KeyCredentials `IKeyCredential[]` + - PasswordCredentials `IPasswordCredential[]` + - ServicePrincipalType `String` + - Tag `String[]` + - Parameter `IServicePrincipalCreateParameters` + - PassThru `SwitchParameter` + +### AzADServicePrincipalOwner [Get] `IDirectoryObject` + - ObjectId `String` + - TenantId `String` + +### AzADUser [Get, New, Remove, Update] `IUser, Boolean` + - TenantId `String` + - UpnOrObjectId `String` + - InputObject `IResourcesIdentity` + - Filter `String` + - DisplayName `String` + - StartsWith `String` + - Mail `String` + - MailNickname `String` + - Parameter `IUserCreateParameters` + - AccountEnabled `SwitchParameter` + - GivenName `String` + - ImmutableId `String` + - PasswordProfile `IPasswordProfile` + - Surname `String` + - UsageLocation `String` + - UserPrincipalName `String` + - UserType `UserType` + - PassThru `SwitchParameter` + - EnableAccount `SwitchParameter` + +### AzADUserMemberGroup [Get] `String` + - ObjectId `String` + - TenantId `String` + - InputObject `IResourcesIdentity` + - AdditionalProperties `Hashtable` + - SecurityEnabledOnly `SwitchParameter` + - Parameter `IUserGetMemberGroupsParameters` + +### AzApplicationKeyCredentials [Get, Update] `IKeyCredential, Boolean` + - ObjectId `String` + - TenantId `String` + - InputObject `IResourcesIdentity` + - Parameter `IKeyCredentialsUpdateParameters` + - Value `IKeyCredential[]` + +### AzApplicationPasswordCredentials [Get, Update] `IPasswordCredential, Boolean` + - ObjectId `String` + - TenantId `String` + - InputObject `IResourcesIdentity` + - Parameter `IPasswordCredentialsUpdateParameters` + - Value `IPasswordCredential[]` + +### AzAuthorizationOperation [Get] `IOperation` + +### AzClassicAdministrator [Get] `IClassicAdministrator` + - SubscriptionId `String[]` + +### AzDenyAssignment [Get] `IDenyAssignment` + - Id `String` + - Scope `String` + - InputObject `IResourcesIdentity` + - ParentResourcePath `String` + - ResourceGroupName `String` + - ResourceName `String` + - ResourceProviderNamespace `String` + - ResourceType `String` + - SubscriptionId `String[]` + - Filter `String` + +### AzDeployment [Get, New, Remove, Set, Stop, Test] `IDeploymentExtended, Boolean, IDeploymentValidateResult` + - SubscriptionId `String[]` + - Name `String` + - ResourceGroupName `String` + - Id `String` + - InputObject `IResourcesIdentity` + - Filter `String` + - Top `Int32` + - Parameter `IDeployment` + - DebugSettingDetailLevel `String` + - Location `String` + - Mode `DeploymentMode` + - OnErrorDeploymentName `String` + - OnErrorDeploymentType `OnErrorDeploymentType` + - ParameterLinkContentVersion `String` + - ParameterLinkUri `String` + - Template `IDeploymentPropertiesTemplate` + - TemplateLinkContentVersion `String` + - TemplateLinkUri `String` + - PassThru `SwitchParameter` + +### AzDeploymentExistence [Test] `Boolean` + - DeploymentName `String` + - SubscriptionId `String` + - ResourceGroupName `String` + - InputObject `IResourcesIdentity` + +### AzDeploymentOperation [Get] `IDeploymentOperation` + - DeploymentName `String` + - SubscriptionId `String[]` + - ResourceGroupName `String` + - OperationId `String` + - DeploymentObject `IDeploymentExtended` + - InputObject `IResourcesIdentity` + - Top `Int32` + +### AzDeploymentTemplate [Export] `IDeploymentExportResultTemplate` + - DeploymentName `String` + - SubscriptionId `String` + - ResourceGroupName `String` + - InputObject `IResourcesIdentity` + +### AzDomain [Get] `IDomain` + - TenantId `String` + - Name `String` + - InputObject `IResourcesIdentity` + - Filter `String` + +### AzElevateGlobalAdministratorAccess [Invoke] `Boolean` + +### AzEntity [Get] `IEntityInfo` + - Filter `String` + - GroupName `String` + - Search `String` + - Select `String` + - Skip `Int32` + - Skiptoken `String` + - Top `Int32` + - View `String` + - CacheControl `String` + +### AzManagedApplication [Get, New, Remove, Set, Update] `IApplication, Boolean` + - Id `String` + - Name `String` + - ResourceGroupName `String` + - SubscriptionId `String[]` + - InputObject `IResourcesIdentity` + - Parameter `IApplication` + - ApplicationDefinitionId `String` + - IdentityType `ResourceIdentityType` + - Kind `String` + - Location `String` + - ManagedBy `String` + - ManagedResourceGroupId `String` + - PlanName `String` + - PlanProduct `String` + - PlanPromotionCode `String` + - PlanPublisher `String` + - PlanVersion `String` + - SkuCapacity `Int32` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `Hashtable` + +### AzManagedApplicationDefinition [Get, New, Remove, Set] `IApplicationDefinition, Boolean` + - Id `String` + - Name `String` + - ResourceGroupName `String` + - SubscriptionId `String[]` + - InputObject `IResourcesIdentity` + - Parameter `IApplicationDefinition` + - Artifact `IApplicationArtifact[]` + - Authorization `IApplicationProviderAuthorization[]` + - CreateUiDefinition `IApplicationDefinitionPropertiesCreateUiDefinition` + - Description `String` + - DisplayName `String` + - IdentityType `ResourceIdentityType` + - IsEnabled `String` + - Location `String` + - LockLevel `ApplicationLockLevel` + - MainTemplate `IApplicationDefinitionPropertiesMainTemplate` + - ManagedBy `String` + - PackageFileUri `String` + - SkuCapacity `Int32` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `Hashtable` + +### AzManagementGroup [Get, New, Remove, Set, Update] `IManagementGroup, IManagementGroupInfo, Boolean` + - GroupId `String` + - InputObject `IResourcesIdentity` + - Skiptoken `String` + - Expand `String` + - Filter `String` + - Recurse `SwitchParameter` + - CacheControl `String` + - DisplayName `String` + - Name `String` + - ParentId `String` + - CreateManagementGroupRequest `ICreateManagementGroupRequest` + - PatchGroupRequest `IPatchManagementGroupRequest` + +### AzManagementGroupDescendant [Get] `IDescendantInfo` + - GroupId `String` + - InputObject `IResourcesIdentity` + - Skiptoken `String` + - Top `Int32` + +### AzManagementGroupSubscription [New, Remove] `Boolean` + - GroupId `String` + - SubscriptionId `String` + - InputObject `IResourcesIdentity` + - CacheControl `String` + +### AzManagementLock [Get, New, Remove, Set] `IManagementLockObject, Boolean` + - SubscriptionId `String[]` + - LockName `String` + - ResourceGroupName `String` + - ParentResourcePath `String` + - ResourceName `String` + - ResourceProviderNamespace `String` + - ResourceType `String` + - Scope `String` + - InputObject `IResourcesIdentity` + - Filter `String` + - Level `LockLevel` + - Note `String` + - Owner `IManagementLockOwner[]` + - Parameter `IManagementLockObject` + +### AzNameAvailability [Test] `ICheckNameAvailabilityResult` + - Name `String` + - Type `Type` + - CheckNameAvailabilityRequest `ICheckNameAvailabilityRequest` + +### AzOAuth2PermissionGrant [Get, New, Remove] `IOAuth2PermissionGrant, Boolean` + - TenantId `String` + - InputObject `IResourcesIdentity` + - Filter `String` + - ClientId `String` + - ConsentType `ConsentType` + - ExpiryTime `String` + - ObjectId `String` + - OdataType `String` + - PrincipalId `String` + - ResourceId `String` + - Scope `String` + - StartTime `String` + - Body `IOAuth2PermissionGrant` + +### AzPermission [Get] `IPermission` + - ResourceGroupName `String` + - SubscriptionId `String[]` + - ParentResourcePath `String` + - ResourceName `String` + - ResourceProviderNamespace `String` + - ResourceType `String` + +### AzPolicyAssignment [Get, New, Remove] `IPolicyAssignment` + - Id `String` + - Name `String` + - Scope `String` + - InputObject `IResourcesIdentity` + - ParentResourcePath `String` + - ResourceGroupName `String` + - ResourceName `String` + - ResourceProviderNamespace `String` + - ResourceType `String` + - SubscriptionId `String[]` + - PolicyDefinitionId `String` + - IncludeDescendent `SwitchParameter` + - Filter `String` + - Parameter `IPolicyAssignment` + - Description `String` + - DisplayName `String` + - IdentityType `ResourceIdentityType` + - Location `String` + - Metadata `IPolicyAssignmentPropertiesMetadata` + - NotScope `String[]` + - SkuName `String` + - SkuTier `String` + - PropertiesScope `String` + +### AzPolicyDefinition [Get, New, Remove, Set] `IPolicyDefinition, Boolean` + - SubscriptionId `String[]` + - Name `String` + - ManagementGroupName `String` + - Id `String` + - InputObject `IResourcesIdentity` + - BuiltIn `SwitchParameter` + - Parameter `IPolicyDefinition` + - Description `String` + - DisplayName `String` + - Metadata `IPolicyDefinitionPropertiesMetadata` + - Mode `PolicyMode` + - PolicyRule `IPolicyDefinitionPropertiesPolicyRule` + - PolicyType `PolicyType` + - PassThru `SwitchParameter` + +### AzPolicySetDefinition [Get, New, Remove, Set] `IPolicySetDefinition, Boolean` + - SubscriptionId `String[]` + - Name `String` + - ManagementGroupName `String` + - Id `String` + - InputObject `IResourcesIdentity` + - BuiltIn `SwitchParameter` + - Parameter `IPolicySetDefinition` + - Description `String` + - DisplayName `String` + - Metadata `IPolicySetDefinitionPropertiesMetadata` + - PolicyDefinition `IPolicyDefinitionReference[]` + - PolicyType `PolicyType` + - PassThru `SwitchParameter` + +### AzProviderFeature [Get, Register] `IFeatureResult` + - SubscriptionId `String[]` + - Name `String` + - ResourceProviderNamespace `String` + - InputObject `IResourcesIdentity` + +### AzProviderOperationsMetadata [Get] `IProviderOperationsMetadata` + - ResourceProviderNamespace `String` + - InputObject `IResourcesIdentity` + - Expand `String` + +### AzResource [Get, Move, New, Remove, Set, Test, Update] `IGenericResource, Boolean` + - ResourceId `String` + - Name `String` + - ParentResourcePath `String` + - ProviderNamespace `String` + - ResourceGroupName `String` + - ResourceType `String` + - SubscriptionId `String[]` + - InputObject `IResourcesIdentity` + - SourceResourceGroupName `String` + - ResourceName `String` + - ResourceProviderNamespace `String` + - Expand `String` + - Top `Int32` + - TagName `String` + - TagValue `String` + - Tag `Hashtable` + - Filter `String` + - PassThru `SwitchParameter` + - Resource `String[]` + - TargetResourceGroup `String` + - TargetSubscriptionId `String` + - TargetResourceGroupName `String` + - Parameter `IResourcesMoveInfo` + - IdentityType `ResourceIdentityType` + - IdentityUserAssignedIdentity `Hashtable` + - Kind `String` + - Location `String` + - ManagedBy `String` + - PlanName `String` + - PlanProduct `String` + - PlanPromotionCode `String` + - PlanPublisher `String` + - PlanVersion `String` + - Property `IGenericResourceProperties` + - SkuCapacity `Int32` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + +### AzResourceGroup [Export, Get, New, Remove, Set, Test, Update] `IResourceGroupExportResult, IResourceGroup, Boolean` + - ResourceGroupName `String` + - SubscriptionId `String` + - InputObject `IResourcesIdentity` + - Name `String` + - Id `String` + - Filter `String` + - Top `Int32` + - TagName `String` + - TagValue `String` + - Tag `Hashtable` + - Option `String` + - Resource `String[]` + - Parameter `IExportTemplateRequest` + - Location `String` + - ManagedBy `String` + +### AzResourceLink [Get, New, Remove, Set] `IResourceLink, Boolean` + - ResourceId `String` + - InputObject `IResourcesIdentity` + - SubscriptionId `String[]` + - Scope `String` + - FilterById `String` + - FilterByScope `Filter` + - Note `String` + - TargetId `String` + - Parameter `IResourceLink` + +### AzResourceMove [Test] `Boolean` + - SourceResourceGroupName `String` + - SubscriptionId `String` + - InputObject `IResourcesIdentity` + - PassThru `SwitchParameter` + - Resource `String[]` + - TargetResourceGroup `String` + - TargetSubscriptionId `String` + - TargetResourceGroupName `String` + - Parameter `IResourcesMoveInfo` + +### AzResourceProvider [Get, Register, Unregister] `IProvider` + - SubscriptionId `String[]` + - ResourceProviderNamespace `String` + - InputObject `IResourcesIdentity` + - Expand `String` + - Top `Int32` + +### AzResourceProviderOperationDetail [Get] `IResourceProviderOperationDefinition` + - ResourceProviderNamespace `String` + +### AzRoleAssignment [Get, New, Remove] `IRoleAssignment` + - Id `String` + - Name `String` + - Scope `String` + - RoleId `String` + - InputObject `IResourcesIdentity` + - ParentResourceId `String` + - ResourceGroupName `String` + - ResourceName `String` + - ResourceProviderNamespace `String` + - ResourceType `String` + - SubscriptionId `String[]` + - ExpandPrincipalGroups `String` + - ServicePrincipalName `String` + - SignInName `String` + - Filter `String` + - CanDelegate `SwitchParameter` + - PrincipalId `String` + - RoleDefinitionId `String` + - Parameter `IRoleAssignmentCreateParameters` + - PrincipalType `PrincipalType` + +### AzRoleDefinition [Get, New, Remove, Set] `IRoleDefinition` + - Id `String` + - Scope `String` + - InputObject `IResourcesIdentity` + - Name `String` + - Custom `SwitchParameter` + - Filter `String` + - AssignableScope `String[]` + - Description `String` + - Permission `IPermission[]` + - RoleName `String` + - RoleType `String` + - RoleDefinition `IRoleDefinition` + +### AzSubscriptionLocation [Get] `ILocation` + - SubscriptionId `String[]` + +### AzTag [Get, New, Remove] `ITagDetails, Boolean` + - SubscriptionId `String[]` + - Name `String` + - Value `String` + - InputObject `IResourcesIdentity` + - PassThru `SwitchParameter` + +### AzTenantBackfill [Start] `ITenantBackfillStatusResult` + +### AzTenantBackfillStatus [Invoke] `ITenantBackfillStatusResult` + diff --git a/tests-upgrade/mysql/tools/Resources/resources/ModelSurface.md b/tests-upgrade/mysql/tools/Resources/resources/ModelSurface.md new file mode 100644 index 00000000000..378e3ec418a --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/resources/ModelSurface.md @@ -0,0 +1,1645 @@ +### AddOwnerParameters \ [Api16] + - Url `String` + +### AdGroup \ [Api16] + - DeletionTimestamp `DateTime?` **{MinValue, MaxValue}** + - DisplayName `String` + - Mail `String` + - MailEnabled `Boolean?` + - MailNickname `String` + - ObjectId `String` + - ObjectType `String` + - SecurityEnabled `Boolean?` + +### AliasPathType [Api20180501] + - ApiVersion `String[]` + - Path `String` + +### AliasType [Api20180501] + - Name `String` + - Path `IAliasPathType[]` + +### Appliance [Api20160901Preview] + - DefinitionId `String` + - Id `String` + - Identity `IIdentity` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - Kind `String` + - Location `String` + - ManagedBy `String` + - ManagedResourceGroupId `String` + - Name `String` + - Output `IAppliancePropertiesOutputs` + - Parameter `IAppliancePropertiesParameters` + - PlanName `String` + - PlanProduct `String` + - PlanPromotionCode `String` + - PlanPublisher `String` + - PlanVersion `String` + - ProvisioningState `String` + - Sku `ISku` + - SkuCapacity `Int32?` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `IResourceTags ` + - Type `String` + - UiDefinitionUri `String` + +### ApplianceArtifact [Api20160901Preview] + - Name `String` + - Type `ApplianceArtifactType?` **{Custom, Template}** + - Uri `String` + +### ApplianceDefinition [Api20160901Preview] + - Artifact `IApplianceArtifact[]` + - Authorization `IApplianceProviderAuthorization[]` + - Description `String` + - DisplayName `String` + - Id `String` + - Identity `IIdentity` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - Location `String` + - LockLevel `ApplianceLockLevel` **{CanNotDelete, None, ReadOnly}** + - ManagedBy `String` + - Name `String` + - PackageFileUri `String` + - Sku `ISku` + - SkuCapacity `Int32?` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `IResourceTags ` + - Type `String` + +### ApplianceDefinitionListResult [Api20160901Preview] + - NextLink `String` + - Value `IApplianceDefinition[]` + +### ApplianceDefinitionProperties [Api20160901Preview] + - Artifact `IApplianceArtifact[]` + - Authorization `IApplianceProviderAuthorization[]` + - Description `String` + - DisplayName `String` + - LockLevel `ApplianceLockLevel` **{CanNotDelete, None, ReadOnly}** + - PackageFileUri `String` + +### ApplianceListResult [Api20160901Preview] + - NextLink `String` + - Value `IAppliance[]` + +### AppliancePatchable [Api20160901Preview] + - ApplianceDefinitionId `String` + - Id `String` + - Identity `IIdentity` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - Kind `String` + - Location `String` + - ManagedBy `String` + - ManagedResourceGroupId `String` + - Name `String` + - Output `IAppliancePropertiesPatchableOutputs` + - Parameter `IAppliancePropertiesPatchableParameters` + - PlanName `String` + - PlanProduct `String` + - PlanPromotionCode `String` + - PlanPublisher `String` + - PlanVersion `String` + - ProvisioningState `String` + - Sku `ISku` + - SkuCapacity `Int32?` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `IResourceTags ` + - Type `String` + - UiDefinitionUri `String` + +### ApplianceProperties [Api20160901Preview] + - ApplianceDefinitionId `String` + - ManagedResourceGroupId `String` + - Output `IAppliancePropertiesOutputs` + - Parameter `IAppliancePropertiesParameters` + - ProvisioningState `String` + - UiDefinitionUri `String` + +### AppliancePropertiesPatchable [Api20160901Preview] + - ApplianceDefinitionId `String` + - ManagedResourceGroupId `String` + - Output `IAppliancePropertiesPatchableOutputs` + - Parameter `IAppliancePropertiesPatchableParameters` + - ProvisioningState `String` + - UiDefinitionUri `String` + +### ApplianceProviderAuthorization [Api20160901Preview] + - PrincipalId `String` + - RoleDefinitionId `String` + +### Application \ [Api16, Api20170901, Api20180601] + - AllowGuestsSignIn `Boolean?` + - AllowPassthroughUser `Boolean?` + - AppId `String` + - AppLogoUrl `String` + - AppPermission `String[]` + - AppRole `IAppRole[]` + - AvailableToOtherTenant `Boolean?` + - DefinitionId `String` + - DeletionTimestamp `DateTime?` **{MinValue, MaxValue}** + - DisplayName `String` + - ErrorUrl `String` + - GroupMembershipClaim `GroupMembershipClaimTypes?` **{All, None, SecurityGroup}** + - Homepage `String` + - Id `String` + - IdentifierUri `String[]` + - Identity `IIdentity` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - InformationalUrlMarketing `String` + - InformationalUrlPrivacy `String` + - InformationalUrlSupport `String` + - InformationalUrlTermsOfService `String` + - IsDeviceOnlyAuthSupported `Boolean?` + - KeyCredentials `IKeyCredential[]` + - Kind `String` + - KnownClientApplication `String[]` + - Location `String` + - LogoutUrl `String` + - ManagedBy `String` + - ManagedResourceGroupId `String` + - Name `String` + - Oauth2AllowImplicitFlow `Boolean?` + - Oauth2AllowUrlPathMatching `Boolean?` + - Oauth2Permission `IOAuth2Permission[]` + - Oauth2RequirePostResponse `Boolean?` + - ObjectId `String` + - ObjectType `String` + - OptionalClaimAccessToken `IOptionalClaim[]` + - OptionalClaimIdToken `IOptionalClaim[]` + - OptionalClaimSamlToken `IOptionalClaim[]` + - OrgRestriction `String[]` + - Output `IApplicationPropertiesOutputs` + - Parameter `IApplicationPropertiesParameters` + - PasswordCredentials `IPasswordCredential[]` + - PlanName `String` + - PlanProduct `String` + - PlanPromotionCode `String` + - PlanPublisher `String` + - PlanVersion `String` + - PreAuthorizedApplication `IPreAuthorizedApplication[]` + - ProvisioningState `String` + - PublicClient `Boolean?` + - PublisherDomain `String` + - ReplyUrl `String[]` + - RequiredResourceAccess `IRequiredResourceAccess[]` + - SamlMetadataUrl `String` + - SignInAudience `String` + - Sku `ISku` + - SkuCapacity `Int32?` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `IResourceTags ` + - Type `String` + - UiDefinitionUri `String` + - WwwHomepage `String` + +### ApplicationArtifact [Api20170901] + - Name `String` + - Type `ApplicationArtifactType?` **{Custom, Template}** + - Uri `String` + +### ApplicationBase [Api16] + - AllowGuestsSignIn `Boolean?` + - AllowPassthroughUser `Boolean?` + - AppLogoUrl `String` + - AppPermission `String[]` + - AppRole `IAppRole[]` + - AvailableToOtherTenant `Boolean?` + - ErrorUrl `String` + - GroupMembershipClaim `GroupMembershipClaimTypes?` **{All, None, SecurityGroup}** + - Homepage `String` + - InformationalUrlMarketing `String` + - InformationalUrlPrivacy `String` + - InformationalUrlSupport `String` + - InformationalUrlTermsOfService `String` + - IsDeviceOnlyAuthSupported `Boolean?` + - KeyCredentials `IKeyCredential[]` + - KnownClientApplication `String[]` + - LogoutUrl `String` + - Oauth2AllowImplicitFlow `Boolean?` + - Oauth2AllowUrlPathMatching `Boolean?` + - Oauth2Permission `IOAuth2Permission[]` + - Oauth2RequirePostResponse `Boolean?` + - OptionalClaimAccessToken `IOptionalClaim[]` + - OptionalClaimIdToken `IOptionalClaim[]` + - OptionalClaimSamlToken `IOptionalClaim[]` + - OrgRestriction `String[]` + - PasswordCredentials `IPasswordCredential[]` + - PreAuthorizedApplication `IPreAuthorizedApplication[]` + - PublicClient `Boolean?` + - PublisherDomain `String` + - ReplyUrl `String[]` + - RequiredResourceAccess `IRequiredResourceAccess[]` + - SamlMetadataUrl `String` + - SignInAudience `String` + - WwwHomepage `String` + +### ApplicationCreateParameters [Api16] + - AllowGuestsSignIn `Boolean?` + - AllowPassthroughUser `Boolean?` + - AppLogoUrl `String` + - AppPermission `String[]` + - AppRole `IAppRole[]` + - AvailableToOtherTenant `Boolean?` + - DisplayName `String` + - ErrorUrl `String` + - GroupMembershipClaim `GroupMembershipClaimTypes?` **{All, None, SecurityGroup}** + - Homepage `String` + - IdentifierUri `String[]` + - InformationalUrl `IInformationalUrl` + - InformationalUrlMarketing `String` + - InformationalUrlPrivacy `String` + - InformationalUrlSupport `String` + - InformationalUrlTermsOfService `String` + - IsDeviceOnlyAuthSupported `Boolean?` + - KeyCredentials `IKeyCredential[]` + - KnownClientApplication `String[]` + - LogoutUrl `String` + - Oauth2AllowImplicitFlow `Boolean?` + - Oauth2AllowUrlPathMatching `Boolean?` + - Oauth2Permission `IOAuth2Permission[]` + - Oauth2RequirePostResponse `Boolean?` + - OptionalClaim `IOptionalClaims` + - OptionalClaimAccessToken `IOptionalClaim[]` + - OptionalClaimIdToken `IOptionalClaim[]` + - OptionalClaimSamlToken `IOptionalClaim[]` + - OrgRestriction `String[]` + - PasswordCredentials `IPasswordCredential[]` + - PreAuthorizedApplication `IPreAuthorizedApplication[]` + - PublicClient `Boolean?` + - PublisherDomain `String` + - ReplyUrl `String[]` + - RequiredResourceAccess `IRequiredResourceAccess[]` + - SamlMetadataUrl `String` + - SignInAudience `String` + - WwwHomepage `String` + +### ApplicationDefinition [Api20170901] + - Artifact `IApplicationArtifact[]` + - Authorization `IApplicationProviderAuthorization[]` + - CreateUiDefinition `IApplicationDefinitionPropertiesCreateUiDefinition` + - Description `String` + - DisplayName `String` + - Id `String` + - Identity `IIdentity` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - IsEnabled `String` + - Location `String` + - LockLevel `ApplicationLockLevel` **{CanNotDelete, None, ReadOnly}** + - MainTemplate `IApplicationDefinitionPropertiesMainTemplate` + - ManagedBy `String` + - Name `String` + - PackageFileUri `String` + - Sku `ISku` + - SkuCapacity `Int32?` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `IResourceTags ` + - Type `String` + +### ApplicationDefinitionListResult [Api20180601] + - NextLink `String` + - Value `IApplicationDefinition[]` + +### ApplicationDefinitionProperties [Api20170901] + - Artifact `IApplicationArtifact[]` + - Authorization `IApplicationProviderAuthorization[]` + - CreateUiDefinition `IApplicationDefinitionPropertiesCreateUiDefinition` + - Description `String` + - DisplayName `String` + - IsEnabled `String` + - LockLevel `ApplicationLockLevel` **{CanNotDelete, None, ReadOnly}** + - MainTemplate `IApplicationDefinitionPropertiesMainTemplate` + - PackageFileUri `String` + +### ApplicationListResult [Api16, Api20180601] + - NextLink `String` + - OdataNextLink `String` + - Value `IApplication[]` + +### ApplicationPatchable [Api20170901, Api20180601] + - ApplicationDefinitionId `String` + - Id `String` + - Identity `IIdentity` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - Kind `String` + - Location `String` + - ManagedBy `String` + - ManagedResourceGroupId `String` + - Name `String` + - Output `IApplicationPropertiesPatchableOutputs` + - Parameter `IApplicationPropertiesPatchableParameters` + - PlanName `String` + - PlanProduct `String` + - PlanPromotionCode `String` + - PlanPublisher `String` + - PlanVersion `String` + - ProvisioningState `String` + - Sku `ISku` + - SkuCapacity `Int32?` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `IResourceTags ` + - Type `String` + - UiDefinitionUri `String` + +### ApplicationProperties [Api20170901, Api20180601] + - ApplicationDefinitionId `String` + - ManagedResourceGroupId `String` + - Output `IApplicationPropertiesOutputs` + - Parameter `IApplicationPropertiesParameters` + - ProvisioningState `String` + - UiDefinitionUri `String` + +### ApplicationPropertiesPatchable [Api20170901, Api20180601] + - ApplicationDefinitionId `String` + - ManagedResourceGroupId `String` + - Output `IApplicationPropertiesPatchableOutputs` + - Parameter `IApplicationPropertiesPatchableParameters` + - ProvisioningState `String` + - UiDefinitionUri `String` + +### ApplicationProviderAuthorization [Api20170901] + - PrincipalId `String` + - RoleDefinitionId `String` + +### ApplicationUpdateParameters [Api16] + - AllowGuestsSignIn `Boolean?` + - AllowPassthroughUser `Boolean?` + - AppLogoUrl `String` + - AppPermission `String[]` + - AppRole `IAppRole[]` + - AvailableToOtherTenant `Boolean?` + - DisplayName `String` + - ErrorUrl `String` + - GroupMembershipClaim `GroupMembershipClaimTypes?` **{All, None, SecurityGroup}** + - Homepage `String` + - IdentifierUri `String[]` + - InformationalUrl `IInformationalUrl` + - InformationalUrlMarketing `String` + - InformationalUrlPrivacy `String` + - InformationalUrlSupport `String` + - InformationalUrlTermsOfService `String` + - IsDeviceOnlyAuthSupported `Boolean?` + - KeyCredentials `IKeyCredential[]` + - KnownClientApplication `String[]` + - LogoutUrl `String` + - Oauth2AllowImplicitFlow `Boolean?` + - Oauth2AllowUrlPathMatching `Boolean?` + - Oauth2Permission `IOAuth2Permission[]` + - Oauth2RequirePostResponse `Boolean?` + - OptionalClaim `IOptionalClaims` + - OptionalClaimAccessToken `IOptionalClaim[]` + - OptionalClaimIdToken `IOptionalClaim[]` + - OptionalClaimSamlToken `IOptionalClaim[]` + - OrgRestriction `String[]` + - PasswordCredentials `IPasswordCredential[]` + - PreAuthorizedApplication `IPreAuthorizedApplication[]` + - PublicClient `Boolean?` + - PublisherDomain `String` + - ReplyUrl `String[]` + - RequiredResourceAccess `IRequiredResourceAccess[]` + - SamlMetadataUrl `String` + - SignInAudience `String` + - WwwHomepage `String` + +### AppRole [Api16] + - AllowedMemberType `String[]` + - Description `String` + - DisplayName `String` + - Id `String` + - IsEnabled `Boolean?` + - Value `String` + +### BasicDependency [Api20180501] + - Id `String` + - ResourceName `String` + - ResourceType `String` + +### CheckGroupMembershipParameters \ [Api16] + - GroupId `String` + - MemberId `String` + +### CheckGroupMembershipResult \ [Api16] + - Value `Boolean?` + +### CheckNameAvailabilityRequest [Api20180301Preview] + - Name `String` + - Type `Type?` **{ProvidersMicrosoftManagementGroups}** + +### CheckNameAvailabilityResult [Api20180301Preview] + - Message `String` + - NameAvailable `Boolean?` + - Reason `Reason?` **{AlreadyExists, Invalid}** + +### ClassicAdministrator [Api20150701] + - EmailAddress `String` + - Id `String` + - Name `String` + - Role `String` + - Type `String` + +### ClassicAdministratorListResult [Api20150701] + - NextLink `String` + - Value `IClassicAdministrator[]` + +### ClassicAdministratorProperties [Api20150701] + - EmailAddress `String` + - Role `String` + +### ComponentsSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties [Api20180501] + - ClientId `String` + - PrincipalId `String` + +### CreateManagementGroupChildInfo [Api20180301Preview] + - Child `ICreateManagementGroupChildInfo[]` + - DisplayName `String` + - Id `String` + - Name `String` + - Role `String[]` + - Type `String` + +### CreateManagementGroupDetails [Api20180301Preview] + - ParentDisplayName `String` + - ParentId `String` + - ParentName `String` + - UpdatedBy `String` + - UpdatedTime `DateTime?` **{MinValue, MaxValue}** + - Version `Single?` + +### CreateManagementGroupProperties [Api20180301Preview] + - Child `ICreateManagementGroupChildInfo[]` + - DetailUpdatedBy `String` + - DetailUpdatedTime `DateTime?` **{MinValue, MaxValue}** + - DetailVersion `Single?` + - DisplayName `String` + - ParentDisplayName `String` + - ParentId `String` + - ParentName `String` + - Role `String[]` + - TenantId `String` + +### CreateManagementGroupRequest [Api20180301Preview] + - Child `ICreateManagementGroupChildInfo[]` + - DetailUpdatedBy `String` + - DetailUpdatedTime `DateTime?` **{MinValue, MaxValue}** + - DetailVersion `Single?` + - DisplayName `String` + - Id `String` + - Name `String` + - ParentDisplayName `String` + - ParentId `String` + - ParentName `String` + - Role `String[]` + - TenantId `String` + - Type `String` + +### CreateParentGroupInfo [Api20180301Preview] + - DisplayName `String` + - Id `String` + - Name `String` + +### DebugSetting [Api20180501] + - DetailLevel `String` + +### DenyAssignment [Api20180701Preview] + - DenyAssignmentName `String` + - Description `String` + - DoNotApplyToChildScope `Boolean?` + - ExcludePrincipal `IPrincipal[]` + - Id `String` + - IsSystemProtected `Boolean?` + - Name `String` + - Permission `IDenyAssignmentPermission[]` + - Principal `IPrincipal[]` + - Scope `String` + - Type `String` + +### DenyAssignmentListResult [Api20180701Preview] + - NextLink `String` + - Value `IDenyAssignment[]` + +### DenyAssignmentPermission [Api20180701Preview] + - Action `String[]` + - DataAction `String[]` + - NotAction `String[]` + - NotDataAction `String[]` + +### DenyAssignmentProperties [Api20180701Preview] + - DenyAssignmentName `String` + - Description `String` + - DoNotApplyToChildScope `Boolean?` + - ExcludePrincipal `IPrincipal[]` + - IsSystemProtected `Boolean?` + - Permission `IDenyAssignmentPermission[]` + - Principal `IPrincipal[]` + - Scope `String` + +### Dependency [Api20180501] + - DependsOn `IBasicDependency[]` + - Id `String` + - ResourceName `String` + - ResourceType `String` + +### Deployment [Api20180501] + - DebugSettingDetailLevel `String` + - Location `String` + - Mode `DeploymentMode` **{Complete, Incremental}** + - OnErrorDeploymentName `String` + - OnErrorDeploymentType `OnErrorDeploymentType?` **{LastSuccessful, SpecificDeployment}** + - Parameter `IDeploymentPropertiesParameters` + - ParameterLinkContentVersion `String` + - ParameterLinkUri `String` + - Template `IDeploymentPropertiesTemplate` + - TemplateLinkContentVersion `String` + - TemplateLinkUri `String` + +### DeploymentExportResult [Api20180501] + - Template `IDeploymentExportResultTemplate` + +### DeploymentExtended [Api20180501] + - CorrelationId `String` + - DebugSettingDetailLevel `String` + - Dependency `IDependency[]` + - Id `String` + - Location `String` + - Mode `DeploymentMode?` **{Complete, Incremental}** + - Name `String` + - OnErrorDeploymentName `String` + - OnErrorDeploymentProvisioningState `String` + - OnErrorDeploymentType `OnErrorDeploymentType?` **{LastSuccessful, SpecificDeployment}** + - Output `IDeploymentPropertiesExtendedOutputs` + - Parameter `IDeploymentPropertiesExtendedParameters` + - ParameterLinkContentVersion `String` + - ParameterLinkUri `String` + - Provider `IProvider[]` + - ProvisioningState `String` + - Template `IDeploymentPropertiesExtendedTemplate` + - TemplateLinkContentVersion `String` + - TemplateLinkUri `String` + - Timestamp `DateTime?` **{MinValue, MaxValue}** + - Type `String` + +### DeploymentListResult [Api20180501] + - NextLink `String` + - Value `IDeploymentExtended[]` + +### DeploymentOperation [Api20180501] + - Id `String` + - OperationId `String` + - ProvisioningState `String` + - RequestContent `IHttpMessageContent` + - ResponseContent `IHttpMessageContent` + - ServiceRequestId `String` + - StatusCode `String` + - StatusMessage `IDeploymentOperationPropertiesStatusMessage` + - TargetResourceId `String` + - TargetResourceName `String` + - TargetResourceType `String` + - Timestamp `DateTime?` **{MinValue, MaxValue}** + +### DeploymentOperationProperties [Api20180501] + - ProvisioningState `String` + - RequestContent `IHttpMessageContent` + - ResponseContent `IHttpMessageContent` + - ServiceRequestId `String` + - StatusCode `String` + - StatusMessage `IDeploymentOperationPropertiesStatusMessage` + - TargetResourceId `String` + - TargetResourceName `String` + - TargetResourceType `String` + - Timestamp `DateTime?` **{MinValue, MaxValue}** + +### DeploymentOperationsListResult [Api20180501] + - NextLink `String` + - Value `IDeploymentOperation[]` + +### DeploymentProperties [Api20180501] + - DebugSettingDetailLevel `String` + - Mode `DeploymentMode` **{Complete, Incremental}** + - OnErrorDeploymentName `String` + - OnErrorDeploymentType `OnErrorDeploymentType?` **{LastSuccessful, SpecificDeployment}** + - Parameter `IDeploymentPropertiesParameters` + - ParameterLinkContentVersion `String` + - ParameterLinkUri `String` + - Template `IDeploymentPropertiesTemplate` + - TemplateLinkContentVersion `String` + - TemplateLinkUri `String` + +### DeploymentPropertiesExtended [Api20180501] + - CorrelationId `String` + - DebugSettingDetailLevel `String` + - Dependency `IDependency[]` + - Mode `DeploymentMode?` **{Complete, Incremental}** + - OnErrorDeploymentName `String` + - OnErrorDeploymentProvisioningState `String` + - OnErrorDeploymentType `OnErrorDeploymentType?` **{LastSuccessful, SpecificDeployment}** + - Output `IDeploymentPropertiesExtendedOutputs` + - Parameter `IDeploymentPropertiesExtendedParameters` + - ParameterLinkContentVersion `String` + - ParameterLinkUri `String` + - Provider `IProvider[]` + - ProvisioningState `String` + - Template `IDeploymentPropertiesExtendedTemplate` + - TemplateLinkContentVersion `String` + - TemplateLinkUri `String` + - Timestamp `DateTime?` **{MinValue, MaxValue}** + +### DeploymentValidateResult [Api20180501] + - CorrelationId `String` + - DebugSettingDetailLevel `String` + - Dependency `IDependency[]` + - ErrorCode `String` + - ErrorDetail `IResourceManagementErrorWithDetails[]` + - ErrorMessage `String` + - ErrorTarget `String` + - Mode `DeploymentMode?` **{Complete, Incremental}** + - OnErrorDeploymentName `String` + - OnErrorDeploymentProvisioningState `String` + - OnErrorDeploymentType `OnErrorDeploymentType?` **{LastSuccessful, SpecificDeployment}** + - Output `IDeploymentPropertiesExtendedOutputs` + - Parameter `IDeploymentPropertiesExtendedParameters` + - ParameterLinkContentVersion `String` + - ParameterLinkUri `String` + - Provider `IProvider[]` + - ProvisioningState `String` + - Template `IDeploymentPropertiesExtendedTemplate` + - TemplateLinkContentVersion `String` + - TemplateLinkUri `String` + - Timestamp `DateTime?` **{MinValue, MaxValue}** + +### DescendantInfo [Api20180301Preview] + - DisplayName `String` + - Id `String` + - Name `String` + - ParentId `String` + - Type `String` + +### DescendantInfoProperties [Api20180301Preview] + - DisplayName `String` + - ParentId `String` + +### DescendantListResult [Api20180301Preview] + - NextLink `String` + - Value `IDescendantInfo[]` + +### DescendantParentGroupInfo [Api20180301Preview] + - Id `String` + +### DirectoryObject \ [Api16] + - DeletionTimestamp `DateTime?` **{MinValue, MaxValue}** + - ObjectId `String` + - ObjectType `String` + +### DirectoryObjectListResult [Api16] + - OdataNextLink `String` + - Value `IDirectoryObject[]` + +### Domain \ [Api16] + - AuthenticationType `String` + - IsDefault `Boolean?` + - IsVerified `Boolean?` + - Name `String` + +### DomainListResult [Api16] + - Value `IDomain[]` + +### EntityInfo [Api20180301Preview] + - DisplayName `String` + - Id `String` + - InheritedPermission `String` + - Name `String` + - NumberOfChild `Int32?` + - NumberOfChildGroup `Int32?` + - NumberOfDescendant `Int32?` + - ParentDisplayNameChain `String[]` + - ParentId `String` + - ParentNameChain `String[]` + - Permission `String` + - TenantId `String` + - Type `String` + +### EntityInfoProperties [Api20180301Preview] + - DisplayName `String` + - InheritedPermission `String` + - NumberOfChild `Int32?` + - NumberOfChildGroup `Int32?` + - NumberOfDescendant `Int32?` + - ParentDisplayNameChain `String[]` + - ParentId `String` + - ParentNameChain `String[]` + - Permission `String` + - TenantId `String` + +### EntityListResult [Api20180301Preview] + - Count `Int32?` + - NextLink `String` + - Value `IEntityInfo[]` + +### EntityParentGroupInfo [Api20180301Preview] + - Id `String` + +### ErrorDetails [Api20180301Preview] + - Code `String` + - Detail `String` + - Message `String` + +### ErrorMessage [Api16] + - Message `String` + +### ErrorResponse [Api20160901Preview, Api20180301Preview] + - ErrorCode `String` + - ErrorDetail `String` + - ErrorMessage `String` + - HttpStatus `String` + +### ExportTemplateRequest [Api20180501] + - Option `String` + - Resource `String[]` + +### FeatureOperationsListResult [Api20151201] + - NextLink `String` + - Value `IFeatureResult[]` + +### FeatureProperties [Api20151201] + - State `String` + +### FeatureResult [Api20151201] + - Id `String` + - Name `String` + - State `String` + - Type `String` + +### GenericResource [Api20160901Preview, Api20180501] + - Id `String` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - IdentityUserAssignedIdentity `IIdentityUserAssignedIdentities ` + - Kind `String` + - Location `String` + - ManagedBy `String` + - Name `String` + - PlanName `String` + - PlanProduct `String` + - PlanPromotionCode `String` + - PlanPublisher `String` + - PlanVersion `String` + - Property `IGenericResourceProperties` + - SkuCapacity `Int32?` + - SkuFamily `String` + - SkuModel `String` + - SkuName `String` + - SkuSize `String` + - SkuTier `String` + - Tag `IResourceTags ` + - Type `String` + +### GetObjectsParameters \ [Api16] + - IncludeDirectoryObjectReference `Boolean?` + - ObjectId `String[]` + - Type `String[]` + +### GraphError [Api16] + - ErrorMessageValueMessage `String` + - OdataErrorCode `String` + +### GroupAddMemberParameters \ [Api16] + - Url `String` + +### GroupCreateParameters \ [Api16] + - DisplayName `String` + - MailEnabled `Boolean` + - MailNickname `String` + - SecurityEnabled `Boolean` + +### GroupGetMemberGroupsParameters \ [Api16] + - SecurityEnabledOnly `Boolean` + +### GroupGetMemberGroupsResult [Api16] + - Value `String[]` + +### GroupListResult [Api16] + - OdataNextLink `String` + - Value `IAdGroup[]` + +### HttpMessage [Api20180501] + - Content `IHttpMessageContent` + +### Identity [Api20160901Preview, Api20180501] + - PrincipalId `String` + - TenantId `String` + - Type `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - UserAssignedIdentity `IIdentityUserAssignedIdentities ` + +### Identity1 [Api20180501] + - PrincipalId `String` + - TenantId `String` + - Type `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + +### InformationalUrl [Api16] + - Marketing `String` + - Privacy `String` + - Support `String` + - TermsOfService `String` + +### KeyCredential \ [Api16] + - CustomKeyIdentifier `String` + - EndDate `DateTime?` **{MinValue, MaxValue}** + - KeyId `String` + - StartDate `DateTime?` **{MinValue, MaxValue}** + - Type `String` + - Usage `String` + - Value `String` + +### KeyCredentialListResult [Api16] + - Value `IKeyCredential[]` + +### KeyCredentialsUpdateParameters [Api16] + - Value `IKeyCredential[]` + +### Location [Api20160601] + - DisplayName `String` + - Id `String` + - Latitude `String` + - Longitude `String` + - Name `String` + - SubscriptionId `String` + +### LocationListResult [Api20160601] + - Value `ILocation[]` + +### ManagementGroup [Api20180301Preview] + - Child `IManagementGroupChildInfo[]` + - DetailUpdatedBy `String` + - DetailUpdatedTime `DateTime?` **{MinValue, MaxValue}** + - DetailVersion `Single?` + - DisplayName `String` + - Id `String` + - Name `String` + - ParentDisplayName `String` + - ParentId `String` + - ParentName `String` + - Role `String[]` + - TenantId `String` + - Type `String` + +### ManagementGroupChildInfo [Api20180301Preview] + - Child `IManagementGroupChildInfo[]` + - DisplayName `String` + - Id `String` + - Name `String` + - Role `String[]` + - Type `String` + +### ManagementGroupDetails [Api20180301Preview] + - ParentDisplayName `String` + - ParentId `String` + - ParentName `String` + - UpdatedBy `String` + - UpdatedTime `DateTime?` **{MinValue, MaxValue}** + - Version `Single?` + +### ManagementGroupInfo [Api20180301Preview] + - DisplayName `String` + - Id `String` + - Name `String` + - TenantId `String` + - Type `String` + +### ManagementGroupInfoProperties [Api20180301Preview] + - DisplayName `String` + - TenantId `String` + +### ManagementGroupListResult [Api20180301Preview] + - NextLink `String` + - Value `IManagementGroupInfo[]` + +### ManagementGroupProperties [Api20180301Preview] + - Child `IManagementGroupChildInfo[]` + - DetailUpdatedBy `String` + - DetailUpdatedTime `DateTime?` **{MinValue, MaxValue}** + - DetailVersion `Single?` + - DisplayName `String` + - ParentDisplayName `String` + - ParentId `String` + - ParentName `String` + - Role `String[]` + - TenantId `String` + +### ManagementLockListResult [Api20160901] + - NextLink `String` + - Value `IManagementLockObject[]` + +### ManagementLockObject [Api20160901] + - Id `String` + - Level `LockLevel` **{CanNotDelete, NotSpecified, ReadOnly}** + - Name `String` + - Note `String` + - Owner `IManagementLockOwner[]` + - Type `String` + +### ManagementLockOwner [Api20160901] + - ApplicationId `String` + +### ManagementLockProperties [Api20160901] + - Level `LockLevel` **{CanNotDelete, NotSpecified, ReadOnly}** + - Note `String` + - Owner `IManagementLockOwner[]` + +### OAuth2Permission [Api16] + - AdminConsentDescription `String` + - AdminConsentDisplayName `String` + - Id `String` + - IsEnabled `Boolean?` + - Type `String` + - UserConsentDescription `String` + - UserConsentDisplayName `String` + - Value `String` + +### OAuth2PermissionGrant [Api16] + - ClientId `String` + - ConsentType `ConsentType?` **{AllPrincipals, Principal}** + - ExpiryTime `String` + - ObjectId `String` + - OdataType `String` + - PrincipalId `String` + - ResourceId `String` + - Scope `String` + - StartTime `String` + +### OAuth2PermissionGrantListResult [Api16] + - OdataNextLink `String` + - Value `IOAuth2PermissionGrant[]` + +### OdataError [Api16] + - Code `String` + - ErrorMessageValueMessage `String` + +### OnErrorDeployment [Api20180501] + - DeploymentName `String` + - Type `OnErrorDeploymentType?` **{LastSuccessful, SpecificDeployment}** + +### OnErrorDeploymentExtended [Api20180501] + - DeploymentName `String` + - ProvisioningState `String` + - Type `OnErrorDeploymentType?` **{LastSuccessful, SpecificDeployment}** + +### Operation [Api20151201, Api20180301Preview] + - DisplayDescription `String` + - DisplayOperation `String` + - DisplayProvider `String` + - DisplayResource `String` + - Name `String` + +### OperationDisplay [Api20151201] + - Operation `String` + - Provider `String` + - Resource `String` + +### OperationDisplayProperties [Api20180301Preview] + - Description `String` + - Operation `String` + - Provider `String` + - Resource `String` + +### OperationListResult [Api20151201, Api20180301Preview] + - NextLink `String` + - Value `IOperation[]` + +### OperationResults [Api20180301Preview] + - Id `String` + - Name `String` + - ProvisioningState `String` + - Type `String` + +### OperationResultsProperties [Api20180301Preview] + - ProvisioningState `String` + +### OptionalClaim [Api16] + - AdditionalProperty `IOptionalClaimAdditionalProperties` + - Essential `Boolean?` + - Name `String` + - Source `String` + +### OptionalClaims [Api16] + - AccessToken `IOptionalClaim[]` + - IdToken `IOptionalClaim[]` + - SamlToken `IOptionalClaim[]` + +### ParametersLink [Api20180501] + - ContentVersion `String` + - Uri `String` + +### ParentGroupInfo [Api20180301Preview] + - DisplayName `String` + - Id `String` + - Name `String` + +### PasswordCredential \ [Api16] + - CustomKeyIdentifier `Byte[]` + - EndDate `DateTime?` **{MinValue, MaxValue}** + - KeyId `String` + - StartDate `DateTime?` **{MinValue, MaxValue}** + - Value `String` + +### PasswordCredentialListResult [Api16] + - Value `IPasswordCredential[]` + +### PasswordCredentialsUpdateParameters [Api16] + - Value `IPasswordCredential[]` + +### PasswordProfile \ [Api16] + - ForceChangePasswordNextLogin `Boolean?` + - Password `String` + +### PatchManagementGroupRequest [Api20180301Preview] + - DisplayName `String` + - ParentId `String` + +### Permission [Api20150701, Api201801Preview] + - Action `String[]` + - DataAction `String[]` + - NotAction `String[]` + - NotDataAction `String[]` + +### PermissionGetResult [Api20150701, Api201801Preview] + - NextLink `String` + - Value `IPermission[]` + +### Plan [Api20160901Preview, Api20180501] + - Name `String` + - Product `String` + - PromotionCode `String` + - Publisher `String` + - Version `String` + +### PlanPatchable [Api20160901Preview] + - Name `String` + - Product `String` + - PromotionCode `String` + - Publisher `String` + - Version `String` + +### PolicyAssignment [Api20151101, Api20161201, Api20180501] + - Description `String` + - DisplayName `String` + - Id `String` + - IdentityPrincipalId `String` + - IdentityTenantId `String` + - IdentityType `ResourceIdentityType?` **{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}** + - Location `String` + - Metadata `IPolicyAssignmentPropertiesMetadata` + - Name `String` + - NotScope `String[]` + - Parameter `IPolicyAssignmentPropertiesParameters` + - PolicyDefinitionId `String` + - Scope `String` + - SkuName `String` + - SkuTier `String` + - Type `String` + +### PolicyAssignmentListResult [Api20151101, Api20161201, Api20180501] + - NextLink `String` + - Value `IPolicyAssignment[]` + +### PolicyAssignmentProperties [Api20151101, Api20161201, Api20180501] + - Description `String` + - DisplayName `String` + - Metadata `IPolicyAssignmentPropertiesMetadata` + - NotScope `String[]` + - Parameter `IPolicyAssignmentPropertiesParameters` + - PolicyDefinitionId `String` + - Scope `String` + +### PolicyDefinition [Api20161201, Api20180501] + - Description `String` + - DisplayName `String` + - Id `String` + - Metadata `IPolicyDefinitionPropertiesMetadata` + - Mode `PolicyMode?` **{All, Indexed, NotSpecified}** + - Name `String` + - Parameter `IPolicyDefinitionPropertiesParameters` + - PolicyRule `IPolicyDefinitionPropertiesPolicyRule` + - PolicyType `PolicyType?` **{BuiltIn, Custom, NotSpecified}** + - Property `IPolicyDefinitionProperties` + - Type `String` + +### PolicyDefinitionListResult [Api20161201, Api20180501] + - NextLink `String` + - Value `IPolicyDefinition[]` + +### PolicyDefinitionProperties [Api20161201] + - Description `String` + - DisplayName `String` + - Metadata `IPolicyDefinitionPropertiesMetadata` + - Mode `PolicyMode?` **{All, Indexed, NotSpecified}** + - Parameter `IPolicyDefinitionPropertiesParameters` + - PolicyRule `IPolicyDefinitionPropertiesPolicyRule` + - PolicyType `PolicyType?` **{BuiltIn, Custom, NotSpecified}** + +### PolicyDefinitionReference [Api20180501] + - Parameter `IPolicyDefinitionReferenceParameters` + - PolicyDefinitionId `String` + +### PolicySetDefinition [Api20180501] + - Description `String` + - DisplayName `String` + - Id `String` + - Metadata `IPolicySetDefinitionPropertiesMetadata` + - Name `String` + - Parameter `IPolicySetDefinitionPropertiesParameters` + - PolicyDefinition `IPolicyDefinitionReference[]` + - PolicyType `PolicyType?` **{BuiltIn, Custom, NotSpecified}** + - Type `String` + +### PolicySetDefinitionListResult [Api20180501] + - NextLink `String` + - Value `IPolicySetDefinition[]` + +### PolicySetDefinitionProperties [Api20180501] + - Description `String` + - DisplayName `String` + - Metadata `IPolicySetDefinitionPropertiesMetadata` + - Parameter `IPolicySetDefinitionPropertiesParameters` + - PolicyDefinition `IPolicyDefinitionReference[]` + - PolicyType `PolicyType?` **{BuiltIn, Custom, NotSpecified}** + +### PolicySku [Api20180501] + - Name `String` + - Tier `String` + +### PreAuthorizedApplication [Api16] + - AppId `String` + - Extension `IPreAuthorizedApplicationExtension[]` + - Permission `IPreAuthorizedApplicationPermission[]` + +### PreAuthorizedApplicationExtension [Api16] + - Condition `String[]` + +### PreAuthorizedApplicationPermission [Api16] + - AccessGrant `String[]` + - DirectAccessGrant `Boolean?` + +### Principal [Api20180701Preview] + - Id `String` + - Type `String` + +### Provider [Api20180501] + - Id `String` + - Namespace `String` + - RegistrationState `String` + - ResourceType `IProviderResourceType[]` + +### ProviderListResult [Api20180501] + - NextLink `String` + - Value `IProvider[]` + +### ProviderOperation [Api20150701, Api201801Preview] + - Description `String` + - DisplayName `String` + - IsDataAction `Boolean?` + - Name `String` + - Origin `String` + - Property `IProviderOperationProperties` + +### ProviderOperationsMetadata [Api20150701, Api201801Preview] + - DisplayName `String` + - Id `String` + - Name `String` + - Operation `IProviderOperation[]` + - ResourceType `IResourceType[]` + - Type `String` + +### ProviderOperationsMetadataListResult [Api20150701, Api201801Preview] + - NextLink `String` + - Value `IProviderOperationsMetadata[]` + +### ProviderResourceType [Api20180501] + - Alias `IAliasType[]` + - ApiVersion `String[]` + - Location `String[]` + - Property `IProviderResourceTypeProperties ` + - ResourceType `String` + +### RequiredResourceAccess \ [Api16] + - ResourceAccess `IResourceAccess[]` + - ResourceAppId `String` + +### Resource [Api20160901Preview] + - Id `String` + - Location `String` + - Name `String` + - Tag `IResourceTags ` + - Type `String` + +### ResourceAccess \ [Api16] + - Id `String` + - Type `String` + +### ResourceGroup [Api20180501] + - Id `String` + - Location `String` + - ManagedBy `String` + - Name `String` + - ProvisioningState `String` + - Tag `IResourceGroupTags ` + - Type `String` + +### ResourceGroupExportResult [Api20180501] + - ErrorCode `String` + - ErrorDetail `IResourceManagementErrorWithDetails[]` + - ErrorMessage `String` + - ErrorTarget `String` + - Template `IResourceGroupExportResultTemplate` + +### ResourceGroupListResult [Api20180501] + - NextLink `String` + - Value `IResourceGroup[]` + +### ResourceGroupPatchable [Api20180501] + - ManagedBy `String` + - Name `String` + - ProvisioningState `String` + - Tag `IResourceGroupPatchableTags ` + +### ResourceGroupProperties [Api20180501] + - ProvisioningState `String` + +### ResourceLink [Api20160901] + - Id `String` + - Name `String` + - Note `String` + - SourceId `String` + - TargetId `String` + - Type `IResourceLinkType` + +### ResourceLinkProperties [Api20160901] + - Note `String` + - SourceId `String` + - TargetId `String` + +### ResourceLinkResult [Api20160901] + - NextLink `String` + - Value `IResourceLink[]` + +### ResourceListResult [Api20180501] + - NextLink `String` + - Value `IGenericResource[]` + +### ResourceManagementErrorWithDetails [Api20180501] + - Code `String` + - Detail `IResourceManagementErrorWithDetails[]` + - Message `String` + - Target `String` + +### ResourceProviderOperationDefinition [Api20151101] + - DisplayDescription `String` + - DisplayOperation `String` + - DisplayProvider `String` + - DisplayPublisher `String` + - DisplayResource `String` + - Name `String` + +### ResourceProviderOperationDetailListResult [Api20151101] + - NextLink `String` + - Value `IResourceProviderOperationDefinition[]` + +### ResourceProviderOperationDisplayProperties [Api20151101] + - Description `String` + - Operation `String` + - Provider `String` + - Publisher `String` + - Resource `String` + +### ResourcesIdentity [Models] + - ApplianceDefinitionId `String` + - ApplianceDefinitionName `String` + - ApplianceId `String` + - ApplianceName `String` + - ApplicationDefinitionId `String` + - ApplicationDefinitionName `String` + - ApplicationId `String` + - ApplicationId1 `String` + - ApplicationName `String` + - ApplicationObjectId `String` + - DenyAssignmentId `String` + - DeploymentName `String` + - DomainName `String` + - FeatureName `String` + - GroupId `String` + - GroupObjectId `String` + - Id `String` + - LinkId `String` + - LockName `String` + - ManagementGroupId `String` + - MemberObjectId `String` + - ObjectId `String` + - OperationId `String` + - OwnerObjectId `String` + - ParentResourcePath `String` + - PolicyAssignmentId `String` + - PolicyAssignmentName `String` + - PolicyDefinitionName `String` + - PolicySetDefinitionName `String` + - ResourceGroupName `String` + - ResourceId `String` + - ResourceName `String` + - ResourceProviderNamespace `String` + - ResourceType `String` + - RoleAssignmentId `String` + - RoleAssignmentName `String` + - RoleDefinitionId `String` + - RoleId `String` + - Scope `String` + - SourceResourceGroupName `String` + - SubscriptionId `String` + - TagName `String` + - TagValue `String` + - TenantId `String` + - UpnOrObjectId `String` + +### ResourcesMoveInfo [Api20180501] + - Resource `String[]` + - TargetResourceGroup `String` + +### ResourceType [Api20150701, Api201801Preview] + - DisplayName `String` + - Name `String` + - Operation `IProviderOperation[]` + +### RoleAssignment [Api20150701, Api20171001Preview, Api20180901Preview] + - CanDelegate `Boolean?` + - Id `String` + - Name `String` + - PrincipalId `String` + - PrincipalType `PrincipalType?` **{Application, DirectoryObjectOrGroup, DirectoryRoleTemplate, Everyone, ForeignGroup, Group, Msi, ServicePrincipal, Unknown, User}** + - RoleDefinitionId `String` + - Scope `String` + - Type `String` + +### RoleAssignmentCreateParameters [Api20150701, Api20171001Preview, Api20180901Preview] + - CanDelegate `Boolean?` + - PrincipalId `String` + - PrincipalType `PrincipalType?` **{Application, DirectoryObjectOrGroup, DirectoryRoleTemplate, Everyone, ForeignGroup, Group, Msi, ServicePrincipal, Unknown, User}** + - RoleDefinitionId `String` + +### RoleAssignmentListResult [Api20150701, Api20180901Preview] + - NextLink `String` + - Value `IRoleAssignment[]` + +### RoleAssignmentProperties [Api20150701, Api20171001Preview, Api20180901Preview] + - CanDelegate `Boolean?` + - PrincipalId `String` + - PrincipalType `PrincipalType?` **{Application, DirectoryObjectOrGroup, DirectoryRoleTemplate, Everyone, ForeignGroup, Group, Msi, ServicePrincipal, Unknown, User}** + - RoleDefinitionId `String` + +### RoleAssignmentPropertiesWithScope [Api20150701, Api20171001Preview, Api20180901Preview] + - CanDelegate `Boolean?` + - PrincipalId `String` + - PrincipalType `PrincipalType?` **{Application, DirectoryObjectOrGroup, DirectoryRoleTemplate, Everyone, ForeignGroup, Group, Msi, ServicePrincipal, Unknown, User}** + - RoleDefinitionId `String` + - Scope `String` + +### RoleDefinition [Api20150701, Api201801Preview] + - AssignableScope `String[]` + - Description `String` + - Id `String` + - Name `String` + - Permission `IPermission[]` + - RoleName `String` + - RoleType `String` + - Type `String` + +### RoleDefinitionListResult [Api20150701, Api201801Preview] + - NextLink `String` + - Value `IRoleDefinition[]` + +### RoleDefinitionProperties [Api20150701, Api201801Preview] + - AssignableScope `String[]` + - Description `String` + - Permission `IPermission[]` + - RoleName `String` + - RoleType `String` + +### ServicePrincipal \ [Api16] + - AccountEnabled `Boolean?` + - AlternativeName `String[]` + - AppDisplayName `String` + - AppId `String` + - AppOwnerTenantId `String` + - AppRole `IAppRole[]` + - AppRoleAssignmentRequired `Boolean?` + - DeletionTimestamp `DateTime?` **{MinValue, MaxValue}** + - DisplayName `String` + - ErrorUrl `String` + - Homepage `String` + - KeyCredentials `IKeyCredential[]` + - LogoutUrl `String` + - Name `String[]` + - Oauth2Permission `IOAuth2Permission[]` + - ObjectId `String` + - ObjectType `String` + - PasswordCredentials `IPasswordCredential[]` + - PreferredTokenSigningKeyThumbprint `String` + - PublisherName `String` + - ReplyUrl `String[]` + - SamlMetadataUrl `String` + - Tag `String[]` + - Type `String` + +### ServicePrincipalBase [Api16] + - AccountEnabled `Boolean?` + - AppRoleAssignmentRequired `Boolean?` + - KeyCredentials `IKeyCredential[]` + - PasswordCredentials `IPasswordCredential[]` + - ServicePrincipalType `String` + - Tag `String[]` + +### ServicePrincipalCreateParameters [Api16] + - AccountEnabled `Boolean?` + - AppId `String` + - AppRoleAssignmentRequired `Boolean?` + - KeyCredentials `IKeyCredential[]` + - PasswordCredentials `IPasswordCredential[]` + - ServicePrincipalType `String` + - Tag `String[]` + +### ServicePrincipalListResult [Api16] + - OdataNextLink `String` + - Value `IServicePrincipal[]` + +### ServicePrincipalObjectResult [Api16] + - OdataMetadata `String` + - Value `String` + +### ServicePrincipalUpdateParameters [Api16] + - AccountEnabled `Boolean?` + - AppRoleAssignmentRequired `Boolean?` + - KeyCredentials `IKeyCredential[]` + - PasswordCredentials `IPasswordCredential[]` + - ServicePrincipalType `String` + - Tag `String[]` + +### SignInName \ [Api16] + - Type `String` + - Value `String` + +### Sku [Api20160901Preview, Api20180501] + - Capacity `Int32?` + - Family `String` + - Model `String` + - Name `String` + - Size `String` + - Tier `String` + +### Subscription [Api20160601] + - AuthorizationSource `String` + - DisplayName `String` + - Id `String` + - PolicyLocationPlacementId `String` + - PolicyQuotaId `String` + - PolicySpendingLimit `SpendingLimit?` **{CurrentPeriodOff, Off, On}** + - State `SubscriptionState?` **{Deleted, Disabled, Enabled, PastDue, Warned}** + - SubscriptionId `String` + +### SubscriptionPolicies [Api20160601] + - LocationPlacementId `String` + - QuotaId `String` + - SpendingLimit `SpendingLimit?` **{CurrentPeriodOff, Off, On}** + +### TagCount [Api20180501] + - Type `String` + - Value `Int32?` + +### TagDetails [Api20180501] + - CountType `String` + - CountValue `Int32?` + - Id `String` + - TagName `String` + - Value `ITagValue[]` + +### TagsListResult [Api20180501] + - NextLink `String` + - Value `ITagDetails[]` + +### TagValue [Api20180501] + - CountType `String` + - CountValue `Int32?` + - Id `String` + - TagValue1 `String` + +### TargetResource [Api20180501] + - Id `String` + - ResourceName `String` + - ResourceType `String` + +### TemplateLink [Api20180501] + - ContentVersion `String` + - Uri `String` + +### TenantBackfillStatusResult [Api20180301Preview] + - Status `Status?` **{Cancelled, Completed, Failed, NotStarted, NotStartedButGroupsExist, Started}** + - TenantId `String` + +### TenantIdDescription [Api20160601] + - Id `String` + - TenantId `String` + +### TenantListResult [Api20160601] + - NextLink `String` + - Value `ITenantIdDescription[]` + +### User \ [Api16] + - AccountEnabled `Boolean?` + - DeletionTimestamp `DateTime?` **{MinValue, MaxValue}** + - DisplayName `String` + - GivenName `String` + - ImmutableId `String` + - Mail `String` + - MailNickname `String` + - ObjectId `String` + - ObjectType `String` + - PrincipalName `String` + - SignInName `ISignInName[]` + - Surname `String` + - Type `UserType?` **{Guest, Member}** + - UsageLocation `String` + +### UserBase \ [Api16] + - GivenName `String` + - ImmutableId `String` + - Surname `String` + - UsageLocation `String` + - UserType `UserType?` **{Guest, Member}** + +### UserCreateParameters \ [Api16] + - AccountEnabled `Boolean` + - DisplayName `String` + - GivenName `String` + - ImmutableId `String` + - Mail `String` + - MailNickname `String` + - PasswordProfile `IPasswordProfile ` + - Surname `String` + - UsageLocation `String` + - UserPrincipalName `String` + - UserType `UserType?` **{Guest, Member}** + +### UserGetMemberGroupsParameters \ [Api16] + - SecurityEnabledOnly `Boolean` + +### UserGetMemberGroupsResult [Api16] + - Value `String[]` + +### UserListResult [Api16] + - OdataNextLink `String` + - Value `IUser[]` + +### UserUpdateParameters \ [Api16] + - AccountEnabled `Boolean?` + - DisplayName `String` + - GivenName `String` + - ImmutableId `String` + - MailNickname `String` + - PasswordProfile `IPasswordProfile ` + - Surname `String` + - UsageLocation `String` + - UserPrincipalName `String` + - UserType `UserType?` **{Guest, Member}** + diff --git a/tests-upgrade/mysql/tools/Resources/resources/readme.md b/tests-upgrade/mysql/tools/Resources/resources/readme.md new file mode 100644 index 00000000000..937f07f8fec --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/resources/readme.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/tests-upgrade/mysql/tools/Resources/test/readme.md b/tests-upgrade/mysql/tools/Resources/test/readme.md new file mode 100644 index 00000000000..7c752b4c8c4 --- /dev/null +++ b/tests-upgrade/mysql/tools/Resources/test/readme.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/tests-upgrade/tsi/readme.md b/tests-upgrade/tsi/readme.md new file mode 100644 index 00000000000..254dcdea73a --- /dev/null +++ b/tests-upgrade/tsi/readme.md @@ -0,0 +1,130 @@ + +# Az.TimeSeriesInsights +This directory contains the PowerShell module for the TimeSeriesInsights service. + +--- +## Status +[![Az.TimeSeriesInsights](https://img.shields.io/powershellgallery/v/Az.TimeSeriesInsights.svg?style=flat-square&label=Az.TimeSeriesInsights "Az.TimeSeriesInsights")](https://www.powershellgallery.com/packages/Az.TimeSeriesInsights/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 1.7.4 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.TimeSeriesInsights`, see [how-to.md](how-to.md). + + +--- +## Generation Requirements +Use of the beta version of `autorest.powershell` generator requires the following: +- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred) + - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes. +> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended. +- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@autorest`
  +- PowerShell 6.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
  +- .NET Core SDK 2.0 or greater + - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
  + +## Run Generation +In this directory, run AutoRest: +> `autorest-beta` + +--- +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +branch: powershell +require: + - $(this-folder)/../readme.azure.noprofile.md +input-file: + - ./timeseriesinsights.json + +module-version: 0.0.1 +title: TimeSeriesInsights +subject-prefix: $(service-name) + +directive: + # Fix errors in swagger + - from: swagger-document + where: $ + transform: return $.replace(/Microsoft.IotHub/g, "Microsoft.IoTHub") + - from: swagger-document + where: $ + transform: return $.replace(/\/eventSources\//g, "/eventsources/") + - from: swagger-document + where: $ + transform: return $.replace(/\/accessPolicies\//g, "/accesspolicies/") + # Remove the unneeded parameter set + - where: + variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ + remove: true + - where: + subject: ReferenceDataSet|AccessPolicy + variant: ^Create$ + remove: true + - where: + subject: EventSource|Environment + variant: ^Create$|^CreateExpanded$ + hide: true + # Remove the set-* cmdlet + - where: + verb: Set + remove: true + # Hide the operation cmdlet + - where: + subject: Operation + hide: true + # correct some names + - where: + parameter-name: SkuCapacity + set: + parameter-name: Capacity + - where: + parameter-name: SkuName + set: + parameter-name: Sku + # Suppress the table format + - where: + model-name: StandardEnvironmentResource + set: + suppress-format: true + - where: + model-name: LongTermEnvironmentResource + set: + suppress-format: true + - where: + model-name: EventHubEventSourceResource + set: + suppress-format: true + - where: + model-name: IoTHubEventSourceResource + set: + suppress-format: true + # Correct some generated code + - from: source-file-csharp + where: $ + transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IStandardEnvironmentCreationProperties Property', 'public Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IStandardEnvironmentCreationProperties Property'); + - from: source-file-csharp + where: $ + transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.ILongTermEnvironmentCreationProperties Property', 'public Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.ILongTermEnvironmentCreationProperties Property'); + - from: source-file-csharp + where: $ + transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IEventHubEventSourceCreationProperties Property', 'public Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IEventHubEventSourceCreationProperties Property'); + - from: source-file-csharp + where: $ + transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IIoTHubEventSourceCreationProperties Property', 'public Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IIoTHubEventSourceCreationProperties Property'); +``` diff --git a/tests-upgrade/tsi/timeseriesinsights.json b/tests-upgrade/tsi/timeseriesinsights.json new file mode 100644 index 00000000000..240dd0cb741 --- /dev/null +++ b/tests-upgrade/tsi/timeseriesinsights.json @@ -0,0 +1,2061 @@ +{ + "swagger": "2.0", + "info": { + "title": "TimeSeriesInsightsClient", + "description": "Time Series Insights client", + "version": "2017-02-28-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": { + "/providers/Microsoft.TimeSeriesInsights/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "description": "Lists all of the available Time Series Insights related operations.", + "x-ms-examples": { + "List available operations for the Time Series Insights resource provider": { + "$ref": "./examples/Operation_List.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successfully listed the available operations.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}": { + "put": { + "tags": [ + "Environments" + ], + "operationId": "Environments_CreateOrUpdate", + "x-ms-examples": { + "EnvironmentsCreate": { + "$ref": "./examples/EnvironmentsCreate.json" + } + }, + "x-ms-long-running-operation": true, + "description": "Create or update an environment in the specified subscription and resource group.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "name": "environmentName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "description": "Name of the environment" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EnvironmentCreateOrUpdateParameters" + }, + "description": "Parameters for creating an environment resource." + } + ], + "responses": { + "200": { + "description": "The existing environment definition was successfully updated.", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "201": { + "description": "The environment create request was accepted. Environment provisioning is an asynchronous operation. You can periodically get your environment definition and monitor progress via the provisioningState property.", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "404": { + "description": "The subscription or resource group could not be found." + }, + "default": { + "description": "HTTP 400 (Bad Request): The given environment request body is invalid; See the error code and message in the response for details.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "Environments" + ], + "operationId": "Environments_Get", + "x-ms-examples": { + "EnvironmentsGet": { + "$ref": "./examples/EnvironmentsGet.json" + } + }, + "description": "Gets the environment with the specified name in the specified subscription and resource group.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The environment definition was successfully retrieved and is in the response. If you are polling for the completion of a provisioning or scale operation, you can check its status via the provisioningState property.", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, or environment could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "patch": { + "tags": [ + "Environments" + ], + "operationId": "Environments_Update", + "x-ms-examples": { + "EnvironmentsUpdate": { + "$ref": "./examples/EnvironmentsPatchSkuCapacity.json" + } + }, + "x-ms-long-running-operation": true, + "description": "Updates the environment with the specified name in the specified subscription and resource group.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "name": "environmentUpdateParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EnvironmentUpdateParameters" + }, + "description": "Request object that contains the updated information for the environment." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The environment definition was successfully updated and is in the response. If the environment was updated synchronously, the response will include a provisioningState value of \"Succeeded\". If the environment was updated asynchronously, the response will include a provisioningState value of \"Updating\". You can periodically get your environment definition and monitor progress of the update via the provisioningState property.", + "schema": { + "$ref": "#/definitions/EnvironmentResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, or environment could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "delete": { + "tags": [ + "Environments" + ], + "operationId": "Environments_Delete", + "x-ms-examples": { + "EnvironmentsDelete": { + "$ref": "./examples/EnvironmentsDelete.json" + } + }, + "description": "Deletes the environment with the specified name in the specified subscription and resource group.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The environment was successfully deleted." + }, + "204": { + "description": "The environment was successfully deleted." + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, or environment could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments": { + "get": { + "tags": [ + "Environments" + ], + "operationId": "Environments_ListByResourceGroup", + "x-ms-examples": { + "EnvironmentsByResourceGroup": { + "$ref": "./examples/EnvironmentsListByResourceGroup.json" + } + }, + "description": "Lists all the available environments associated with the subscription and within the specified resource group.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Environments returned successfully.", + "schema": { + "$ref": "#/definitions/EnvironmentListResponse" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, or resource group could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments": { + "get": { + "tags": [ + "Environments" + ], + "operationId": "Environments_ListBySubscription", + "x-ms-examples": { + "EnvironmentsBySubscription": { + "$ref": "./examples/EnvironmentsListBySubscription.json" + } + }, + "description": "Lists all the available environments within a subscription, irrespective of the resource groups.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Environments returned successfully.", + "schema": { + "$ref": "#/definitions/EnvironmentListResponse" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}": { + "put": { + "tags": [ + "EventSources" + ], + "operationId": "EventSources_CreateOrUpdate", + "description": "Create or update an event source under the specified environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "name": "eventSourceName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "description": "Name of the event source." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EventSourceCreateOrUpdateParameters" + }, + "description": "Parameters for creating an event source resource." + } + ], + "responses": { + "200": { + "description": "The existing event source definition was successfully updated.", + "schema": { + "$ref": "#/definitions/EventSourceResource" + } + }, + "201": { + "description": "The event source was successfully created.", + "schema": { + "$ref": "#/definitions/EventSourceResource" + } + }, + "default": { + "description": "HTTP 400 (Bad Request): The given event source request body is invalid; See the error code and message in the response for details.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "EventSources" + ], + "operationId": "EventSources_Get", + "description": "Gets the event source with the specified name in the specified environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/EventSourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The event source definition was successfully retrieved and is in the response.", + "schema": { + "$ref": "#/definitions/EventSourceResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or event source could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "patch": { + "tags": [ + "EventSources" + ], + "operationId": "EventSources_Update", + "description": "Updates the event source with the specified name in the specified subscription, resource group, and environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/EventSourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "eventSourceUpdateParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/EventSourceUpdateParameters" + }, + "description": "Request object that contains the updated information for the event source." + } + ], + "responses": { + "200": { + "description": "The event source definition was successfully updated and is in the response.", + "schema": { + "$ref": "#/definitions/EventSourceResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or event source could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "delete": { + "tags": [ + "EventSources" + ], + "operationId": "EventSources_Delete", + "description": "Deletes the event source with the specified name in the specified subscription, resource group, and environment", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/EventSourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The event source was successfully deleted." + }, + "204": { + "description": "The event source was successfully deleted." + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or event source could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources": { + "get": { + "tags": [ + "EventSources" + ], + "operationId": "EventSources_ListByEnvironment", + "description": "Lists all the available event sources associated with the subscription and within the specified resource group and environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Environments returned successfully.", + "schema": { + "$ref": "#/definitions/EventSourceListResponse" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, or environment could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}": { + "put": { + "tags": [ + "ReferenceDataSets" + ], + "operationId": "ReferenceDataSets_CreateOrUpdate", + "x-ms-examples": { + "ReferenceDataSetsCreate": { + "$ref": "./examples/ReferenceDataSetsCreate.json" + } + }, + "description": "Create or update a reference data set in the specified environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "name": "referenceDataSetName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[A-Za-z0-9]", + "minLength": 3, + "maxLength": 63, + "description": "Name of the reference data set." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReferenceDataSetCreateOrUpdateParameters" + }, + "description": "Parameters for creating a reference data set." + } + ], + "responses": { + "200": { + "description": "The existing reference data set definition was successfully updated.", + "schema": { + "$ref": "#/definitions/ReferenceDataSetResource" + } + }, + "201": { + "description": "The reference data set was successfully created.", + "schema": { + "$ref": "#/definitions/ReferenceDataSetResource" + } + }, + "default": { + "description": "HTTP 400 (Bad Request): The given reference data set request body is invalid; See the error code and message in the response for details.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "ReferenceDataSets" + ], + "operationId": "ReferenceDataSets_Get", + "x-ms-examples": { + "ReferenceDataSetsGet": { + "$ref": "./examples/ReferenceDataSetsGet.json" + } + }, + "description": "Gets the reference data set with the specified name in the specified environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ReferenceDataSetNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The reference data set definition was successfully retrieved and is in the response.", + "schema": { + "$ref": "#/definitions/ReferenceDataSetResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or reference data set could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "patch": { + "tags": [ + "ReferenceDataSets" + ], + "operationId": "ReferenceDataSets_Update", + "x-ms-examples": { + "ReferenceDataSetsUpdate": { + "$ref": "./examples/ReferenceDataSetsPatchTags.json" + } + }, + "description": "Updates the reference data set with the specified name in the specified subscription, resource group, and environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ReferenceDataSetNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "referenceDataSetUpdateParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReferenceDataSetUpdateParameters" + }, + "description": "Request object that contains the updated information for the reference data set." + } + ], + "responses": { + "200": { + "description": "The reference data set definition was successfully updated and is in the response.", + "schema": { + "$ref": "#/definitions/ReferenceDataSetResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or reference data set could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "delete": { + "tags": [ + "ReferenceDataSets" + ], + "operationId": "ReferenceDataSets_Delete", + "x-ms-examples": { + "ReferenceDataSetsDelete": { + "$ref": "./examples/ReferenceDataSetsDelete.json" + } + }, + "description": "Deletes the reference data set with the specified name in the specified subscription, resource group, and environment", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ReferenceDataSetNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The reference data set was successfully deleted." + }, + "204": { + "description": "The reference data set was successfully deleted." + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or reference data set could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets": { + "get": { + "tags": [ + "ReferenceDataSets" + ], + "operationId": "ReferenceDataSets_ListByEnvironment", + "x-ms-examples": { + "ReferenceDataSetsListByEnvironment": { + "$ref": "./examples/ReferenceDataSetsListByEnvironment.json" + } + }, + "description": "Lists all the available reference data sets associated with the subscription and within the specified resource group and environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Reference data sets returned successfully.", + "schema": { + "$ref": "#/definitions/ReferenceDataSetListResponse" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, or environment could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}": { + "put": { + "tags": [ + "AccessPolicies" + ], + "operationId": "AccessPolicies_CreateOrUpdate", + "x-ms-examples": { + "AccessPoliciesCreate": { + "$ref": "./examples/AccessPoliciesCreate.json" + } + }, + "description": "Create or update an access policy in the specified environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "name": "accessPolicyName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[-\\w\\._\\(\\)]+$", + "minLength": 1, + "maxLength": 90, + "description": "Name of the access policy." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AccessPolicyCreateOrUpdateParameters" + }, + "description": "Parameters for creating an access policy." + } + ], + "responses": { + "200": { + "description": "The existing access policy definition was successfully updated.", + "schema": { + "$ref": "#/definitions/AccessPolicyResource" + } + }, + "201": { + "description": "The access policy was successfully created.", + "schema": { + "$ref": "#/definitions/AccessPolicyResource" + } + }, + "default": { + "description": "HTTP 400 (Bad Request): The given access policy request body is invalid; See the error code and message in the response for details.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "get": { + "tags": [ + "AccessPolicies" + ], + "operationId": "AccessPolicies_Get", + "x-ms-examples": { + "AccessPoliciesGet": { + "$ref": "./examples/AccessPoliciesGet.json" + } + }, + "description": "Gets the access policy with the specified name in the specified environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/AccessPolicyNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The access policy definition was successfully retrieved and is in the response.", + "schema": { + "$ref": "#/definitions/AccessPolicyResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or access policy could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "patch": { + "tags": [ + "AccessPolicies" + ], + "operationId": "AccessPolicies_Update", + "x-ms-examples": { + "AccessPoliciesUpdate": { + "$ref": "./examples/AccessPoliciesPatchRoles.json" + } + }, + "description": "Updates the access policy with the specified name in the specified subscription, resource group, and environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/AccessPolicyNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "accessPolicyUpdateParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AccessPolicyUpdateParameters" + }, + "description": "Request object that contains the updated information for the access policy." + } + ], + "responses": { + "200": { + "description": "The access policy definition was successfully updated and is in the response.", + "schema": { + "$ref": "#/definitions/AccessPolicyResource" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or access policy could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + }, + "delete": { + "tags": [ + "AccessPolicies" + ], + "operationId": "AccessPolicies_Delete", + "x-ms-examples": { + "AccessPoliciesDelete": { + "$ref": "./examples/AccessPoliciesDelete.json" + } + }, + "description": "Deletes the access policy with the specified name in the specified subscription, resource group, and environment", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/AccessPolicyNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The access policy was successfully deleted." + }, + "204": { + "description": "The access policy was successfully deleted." + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, environment, or access policy could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies": { + "get": { + "tags": [ + "AccessPolicies" + ], + "operationId": "AccessPolicies_ListByEnvironment", + "x-ms-examples": { + "AccessPoliciesByEnvironment": { + "$ref": "./examples/AccessPoliciesListByEnvironment.json" + } + }, + "description": "Lists all the available access policies associated with the environment.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/EnvironmentNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "access policies returned successfully.", + "schema": { + "$ref": "#/definitions/AccessPolicyListResponse" + } + }, + "default": { + "description": "HTTP 404 (Not Found): The subscription, resource group, or environment could not be found.", + "schema": { + "$ref": "#/definitions/CloudError" + } + } + } + } + } + }, + "definitions": { + "OperationListResult": { + "description": "Result of the request to list Time Series Insights operations. It contains a list of operations and a URL link to get the next set of results.", + "properties": { + "value": { + "description": "List of Time Series Insights operations supported by the Microsoft.TimeSeriesInsights resource provider.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Operation" + } + }, + "nextLink": { + "description": "URL to get the next set of operation list results if there are any.", + "type": "string", + "readOnly": true + } + } + }, + "Operation": { + "description": "A Time Series Insights REST API operation", + "type": "object", + "properties": { + "name": { + "description": "The name of the operation being performed on this particular object.", + "type": "string", + "readOnly": true + }, + "display": { + "description": "Contains the localized display information for this particular operation / action.", + "readOnly": true, + "properties": { + "provider": { + "description": "The localized friendly form of the resource provider name.", + "type": "string", + "readOnly": true + }, + "resource": { + "description": "The localized friendly form of the resource type related to this action/operation.", + "type": "string", + "readOnly": true + }, + "operation": { + "description": "The localized friendly name for the operation.", + "type": "string", + "readOnly": true + }, + "description": { + "description": "The localized friendly description for the operation.", + "type": "string", + "readOnly": true + } + } + } + } + }, + "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" + } + }, + "description": "Time Series Insights resource", + "x-ms-azure-resource": true + }, + "TrackedResource": { + "properties": { + "location": { + "type": "string", + "description": "Resource location" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "location" + ], + "description": "Time Series Insights resource that is tracked by Azure Resource Manager." + }, + "ResourceProperties": { + "properties": { + "provisioningState": { + "readOnly": true, + "type": "string", + "description": "Provisioning state of the resource.", + "enum": [ + "Accepted", + "Creating", + "Updating", + "Succeeded", + "Failed", + "Deleting" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": false + } + }, + "creationTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "The time the resource was created." + } + }, + "description": "Properties that are common to all tracked resources." + }, + "Sku": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of this SKU.", + "enum": [ + "S1", + "S2" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + } + }, + "capacity": { + "format": "int32", + "type": "integer", + "description": "The capacity of the sku. This value can be changed to support scale out of environments after they have been created.", + "minimum": 1, + "maximum": 10 + } + }, + "required": [ + "name", + "capacity" + ], + "description": "The sku determines the capacity of the environment, the SLA (in queries-per-minute and total capacity), and the billing rate." + }, + "CreateOrUpdateTrackedResourceProperties": { + "properties": { + "location": { + "type": "string", + "description": "The location of the resource." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key-value pairs of additional properties for the resource." + } + }, + "required": [ + "location" + ], + "description": "Properties required to create any resource tracked by Azure Resource Manager." + }, + "EnvironmentCreateOrUpdateParameters": { + "properties": { + "sku": { + "$ref": "#/definitions/Sku" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/EnvironmentCreationProperties" + } + }, + "required": [ + "sku", + "properties" + ], + "allOf": [ + { + "$ref": "#/definitions/CreateOrUpdateTrackedResourceProperties" + } + ], + "description": "Parameters supplied to the CreateOrUpdate Environment operation." + }, + "EnvironmentUpdateParameters": { + "type": "object", + "properties": { + "sku": { + "$ref": "#/definitions/Sku", + "description": "The sku of the environment." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key-value pairs of additional properties for the environment." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/EnvironmentMutableProperties", + "description": "Properties of the environment." + } + }, + "description": "Parameters supplied to the Update Environment operation." + }, + "EnvironmentListResponse": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentResource" + }, + "description": "Result of the List Environments operation." + } + }, + "description": "The response of the List Environments operation." + }, + "EnvironmentResource": { + "properties": { + "sku": { + "$ref": "#/definitions/Sku" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/EnvironmentResourceProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/TrackedResource" + } + ], + "description": "An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource." + }, + "EnvironmentCreationProperties": { + "properties": { + "dataRetentionTime": { + "type": "string", + "format": "duration", + "description": "ISO8601 timespan specifying the minimum number of days the environment's events will be available for query." + }, + "storageLimitExceededBehavior": { + "type": "string", + "description": "The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If \"PauseIngress\" is specified, new events will not be read from the event source. If \"PurgeOldData\" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData.", + "enum": [ + "PurgeOldData", + "PauseIngress" + ], + "x-ms-enum": { + "name": "StorageLimitExceededBehavior", + "modelAsString": false + } + } + }, + "required": [ + "dataRetentionTime" + ], + "description": "Properties used to create an environment." + }, + "EnvironmentResourceProperties": { + "properties": { + "dataAccessId": { + "readOnly": true, + "type": "string", + "format": "uuid", + "description": "An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment." + }, + "dataAccessFqdn": { + "readOnly": true, + "type": "string", + "description": "The fully qualified domain name used to access the environment data, e.g. to query the environment's events or upload reference data for the environment." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EnvironmentCreationProperties" + }, + { + "$ref": "#/definitions/ResourceProperties" + } + ], + "required": [ + "dataRetentionTime" + ], + "description": "Properties of the environment." + }, + "EnvironmentMutableProperties": { + "description": "An object that represents a set of mutable environment resource properties.", + "type": "object", + "properties": { + "dataRetentionTime": { + "type": "string", + "format": "duration", + "description": "ISO8601 timespan specifying the minimum number of days the environment's events will be available for query." + } + } + }, + "EventSourceCreateOrUpdateParameters": { + "discriminator": "kind", + "properties": { + "kind": { + "type": "string", + "description": "The kind of the event source.", + "enum": [ + "Microsoft.EventHub", + "Microsoft.IoTHub" + ], + "x-ms-enum": { + "name": "Kind", + "modelAsString": false + } + } + }, + "required": [ + "kind" + ], + "allOf": [ + { + "$ref": "#/definitions/CreateOrUpdateTrackedResourceProperties" + } + ], + "description": "Parameters supplied to the Create or Update Event Source operation." + }, + "EventHubEventSourceCreateOrUpdateParameters": { + "x-ms-discriminator-value": "Microsoft.EventHub", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/EventHubEventSourceCreationProperties" + } + }, + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "#/definitions/EventSourceCreateOrUpdateParameters" + } + ], + "description": "Parameters supplied to the Create or Update Event Source operation for an EventHub event source." + }, + "IoTHubEventSourceCreateOrUpdateParameters": { + "x-ms-discriminator-value": "Microsoft.IoTHub", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/IoTHubEventSourceCreationProperties" + } + }, + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "#/definitions/EventSourceCreateOrUpdateParameters" + } + ], + "description": "Parameters supplied to the Create or Update Event Source operation for an IoTHub event source." + }, + "EventSourceUpdateParameters": { + "type": "object", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key-value pairs of additional properties for the event source." + } + }, + "description": "Parameters supplied to the Update Event Source operation." + }, + "EventHubEventSourceUpdateParameters": { + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/EventHubEventSourceMutableProperties", + "description": "Properties of the EventHub event source." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EventSourceUpdateParameters" + } + ], + "description": "Parameters supplied to the Update Event Source operation to update an EventHub event source." + }, + "IoTHubEventSourceUpdateParameters": { + "type": "object", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/IoTHubEventSourceMutableProperties", + "description": "Properties of the IoTHub event source." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EventSourceUpdateParameters" + } + ], + "description": "Parameters supplied to the Update Event Source operation to update an IoTHub event source." + }, + "EventSourceListResponse": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/EventSourceResource" + }, + "description": "Result of the List EventSources operation." + } + }, + "description": "The response of the List EventSources operation." + }, + "EventSourceResource": { + "type": "object", + "discriminator": "kind", + "properties": { + "kind": { + "type": "string", + "description": "The kind of the event source.", + "enum": [ + "Microsoft.EventHub", + "Microsoft.IoTHub" + ] + } + }, + "required": [ + "kind" + ], + "allOf": [ + { + "$ref": "#/definitions/TrackedResource" + } + ], + "description": "An environment receives data from one or more event sources. Each event source has associated connection info that allows the Time Series Insights ingress pipeline to connect to and pull data from the event source" + }, + "EventHubEventSourceResource": { + "x-ms-discriminator-value": "Microsoft.EventHub", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/EventHubEventSourceResourceProperties" + } + }, + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "#/definitions/EventSourceResource" + } + ], + "description": "An event source that receives its data from an Azure EventHub." + }, + "IoTHubEventSourceResource": { + "x-ms-discriminator-value": "Microsoft.IotHub", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/IoTHubEventSourceResourceProperties" + } + }, + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "#/definitions/EventSourceResource" + } + ], + "description": "An event source that receives its data from an Azure IoTHub." + }, + "EventSourceCommonProperties": { + "properties": { + "timestampPropertyName": { + "type": "string", + "description": "The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used." + } + }, + "allOf": [ + { + "$ref": "#/definitions/ResourceProperties" + } + ], + "description": "Properties of the event source." + }, + "AzureEventSourceProperties": { + "properties": { + "eventSourceResourceId": { + "type": "string", + "description": "The resource id of the event source in Azure Resource Manager." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EventSourceCommonProperties" + } + ], + "required": [ + "eventSourceResourceId" + ], + "description": "Properties of an event source that reads events from an event broker in Azure." + }, + "EventHubEventSourceCommonProperties": { + "properties": { + "serviceBusNamespace": { + "type": "string", + "description": "The name of the service bus that contains the event hub." + }, + "eventHubName": { + "type": "string", + "description": "The name of the event hub." + }, + "consumerGroupName": { + "type": "string", + "description": "The name of the event hub's consumer group that holds the partitions from which events will be read." + }, + "keyName": { + "type": "string", + "description": "The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub." + } + }, + "allOf": [ + { + "$ref": "#/definitions/AzureEventSourceProperties" + } + ], + "required": [ + "serviceBusNamespace", + "eventHubName", + "consumerGroupName", + "keyName" + ], + "description": "Properties of the EventHub event source." + }, + "EventHubEventSourceCreationProperties": { + "properties": { + "sharedAccessKey": { + "type": "string", + "description": "The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EventHubEventSourceCommonProperties" + } + ], + "required": [ + "sharedAccessKey" + ], + "description": "Properties of the EventHub event source that are required on create or update requests." + }, + "EventHubEventSourceResourceProperties": { + "allOf": [ + { + "$ref": "#/definitions/EventHubEventSourceCommonProperties" + } + ], + "description": "Properties of the EventHub event source resource." + }, + "IoTHubEventSourceCommonProperties": { + "properties": { + "iotHubName": { + "type": "string", + "description": "The name of the iot hub." + }, + "consumerGroupName": { + "type": "string", + "description": "The name of the iot hub's consumer group that holds the partitions from which events will be read." + }, + "keyName": { + "type": "string", + "description": "The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub." + } + }, + "allOf": [ + { + "$ref": "#/definitions/AzureEventSourceProperties" + } + ], + "required": [ + "iotHubName", + "consumerGroupName", + "keyName" + ], + "description": "Properties of the IoTHub event source." + }, + "IoTHubEventSourceCreationProperties": { + "properties": { + "sharedAccessKey": { + "type": "string", + "description": "The value of the Shared Access Policy key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses." + } + }, + "allOf": [ + { + "$ref": "#/definitions/IoTHubEventSourceCommonProperties" + } + ], + "required": [ + "sharedAccessKey" + ], + "description": "Properties of the IoTHub event source that are required on create or update requests." + }, + "IoTHubEventSourceResourceProperties": { + "allOf": [ + { + "$ref": "#/definitions/IoTHubEventSourceCommonProperties" + } + ], + "description": "Properties of the IoTHub event source resource." + }, + "LocalTimestamp": { + "description": "An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events.", + "type": "object", + "properties": { + "format": { + "description": "An enum that represents the format of the local timestamp property that needs to be set.", + "type": "string", + "enum": [ + "Embedded", + "Iana", + "TimeSpan" + ], + "x-ms-enum": { + "name": "LocalTimestampFormat", + "modelAsString": false + } + }, + "timeZoneOffset": { + "description": "An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded.", + "type": "object", + "properties": { + "propertyName": { + "type": "string", + "description": "The event property that will be contain the offset information to calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). When LocalTimestampFormat is Timespan, it contains the name of property which contains values representing the offset (eg: P1D or 1.00:00:00)" + } + } + } + } + }, + "EventSourceMutableProperties": { + "description": "An object that represents a set of mutable event source resource properties.", + "type": "object", + "properties": { + "timestampPropertyName": { + "type": "string", + "description": "The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used." + }, + "localTimestamp": { + "$ref": "#/definitions/LocalTimestamp" + } + } + }, + "EventHubEventSourceMutableProperties": { + "description": "An object that represents a set of mutable EventHub event source resource properties.", + "type": "object", + "properties": { + "sharedAccessKey": { + "type": "string", + "description": "The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EventSourceMutableProperties" + } + ] + }, + "IoTHubEventSourceMutableProperties": { + "description": "An object that represents a set of mutable IoTHub event source resource properties.", + "type": "object", + "properties": { + "sharedAccessKey": { + "type": "string", + "description": "The value of the shared access key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses." + } + }, + "allOf": [ + { + "$ref": "#/definitions/EventSourceMutableProperties" + } + ] + }, + "ReferenceDataSetCreateOrUpdateParameters": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ReferenceDataSetCreationProperties" + } + }, + "required": [ + "properties" + ], + "allOf": [ + { + "$ref": "#/definitions/CreateOrUpdateTrackedResourceProperties" + } + ] + }, + "ReferenceDataSetUpdateParameters": { + "type": "object", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Key-value pairs of additional properties for the reference data set." + } + }, + "description": "Parameters supplied to the Update Reference Data Set operation." + }, + "ReferenceDataSetListResponse": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ReferenceDataSetResource" + }, + "description": "Result of the List Reference Data Sets operation." + } + }, + "description": "The response of the List Reference Data Sets operation." + }, + "ReferenceDataSetResource": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ReferenceDataSetResourceProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/TrackedResource" + } + ], + "description": "A reference data set provides metadata about the events in an environment. Metadata in the reference data set will be joined with events as they are read from event sources. The metadata that makes up the reference data set is uploaded or modified through the Time Series Insights data plane APIs." + }, + "ReferenceDataSetCreationProperties": { + "properties": { + "keyProperties": { + "type": "array", + "items": { + "$ref": "#/definitions/ReferenceDataSetKeyProperty" + }, + "description": "The list of key properties for the reference data set." + } + }, + "required": [ + "keyProperties" + ], + "description": "Properties used to create a reference data set." + }, + "ReferenceDataSetResourceProperties": { + "allOf": [ + { + "$ref": "#/definitions/ReferenceDataSetCreationProperties" + }, + { + "$ref": "#/definitions/ResourceProperties" + } + ], + "required": [ + "keyProperties" + ], + "description": "Properties of the reference data set." + }, + "ReferenceDataSetKeyProperty": { + "properties": { + "name": { + "type": "string", + "description": "The name of the key property." + }, + "type": { + "type": "string", + "description": "The type of the key property.", + "enum": [ + "String", + "Double", + "Bool", + "DateTime" + ], + "x-ms-enum": { + "name": "ReferenceDataKeyPropertyType", + "modelAsString": false + } + } + }, + "description": "A key property for the reference data set. A reference data set can have multiple key properties." + }, + "AccessPolicyCreateOrUpdateParameters": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AccessPolicyResourceProperties" + } + }, + "required": [ + "properties" + ] + }, + "AccessPolicyUpdateParameters": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AccessPolicyMutableProperties" + } + }, + "required": [ + "properties" + ] + }, + "AccessPolicyListResponse": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessPolicyResource" + }, + "description": "Result of the List access policies operation." + } + }, + "description": "The response of the List access policies operation." + }, + "AccessPolicyResource": { + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AccessPolicyResourceProperties" + } + }, + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "An access policy is used to grant users and applications access to the environment. Roles are assigned to service principals in Azure Active Directory. These roles define the actions the principal can perform through the Time Series Insights data plane APIs." + }, + "AccessPolicyResourceProperties": { + "properties": { + "principalObjectId": { + "type": "string", + "description": "The objectId of the principal in Azure Active Directory." + }, + "description": { + "type": "string", + "description": "An description of the access policy." + }, + "roles": { + "type": "array", + "items": { + "type": "string", + "description": "A role defining the data plane operations that a principal can perform on a Time Series Insights client.", + "enum": [ + "Reader", + "Contributor" + ], + "x-ms-enum": { + "name": "AccessPolicyRole", + "modelAsString": false + } + }, + "description": "The list of roles the principal is assigned on the environment." + } + } + }, + "AccessPolicyMutableProperties": { + "description": "An object that represents a set of mutable access policy resource properties.", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "An description of the access policy." + }, + "roles": { + "type": "array", + "items": { + "type": "string", + "description": "A role defining the data plane operations that a principal can perform on a Time Series Insights client.", + "enum": [ + "Reader", + "Contributor" + ], + "x-ms-enum": { + "name": "AccessPolicyRole", + "modelAsString": false + } + }, + "description": "The list of roles the principal is assigned on the environment." + } + } + }, + "CloudError": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/CloudErrorBody" + } + }, + "description": "Contains information about an API error.", + "x-ms-external": true + }, + "CloudErrorBody": { + "type": "object", + "description": "Describes a particular API error with an error code and a message.", + "properties": { + "code": { + "type": "string", + "description": "An error code that describes the error condition more precisely than an HTTP status code. Can be used to programmatically handle specific error cases." + }, + "message": { + "type": "string", + "description": "A message that describes the error in detail and provides debugging information." + }, + "target": { + "type": "string", + "description": "The target of the particular error (for example, the name of the property in error)." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudErrorBody" + }, + "description": "Contains nested errors that are related to this error." + } + }, + "x-ms-external": true + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "Azure Subscription ID.", + "required": true, + "type": "string" + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. Current version is 2017-02-28-preview." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Name of an Azure Resource group." + }, + "EnvironmentNameParameter": { + "name": "environmentName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Time Series Insights environment associated with the specified resource group.", + "x-ms-parameter-location": "method" + }, + "EventSourceNameParameter": { + "name": "eventSourceName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Time Series Insights event source associated with the specified environment.", + "x-ms-parameter-location": "method" + }, + "ReferenceDataSetNameParameter": { + "name": "referenceDataSetName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Time Series Insights reference data set associated with the specified environment.", + "x-ms-parameter-location": "method" + }, + "AccessPolicyNameParameter": { + "name": "accessPolicyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Time Series Insights access policy associated with the specified environment.", + "x-ms-parameter-location": "method" + } + } +}