From e097c54a04ee377649548503fea936d77b79d1b6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Feb 2023 07:33:19 +0000 Subject: [PATCH] CodeGen from PR 22595 in Azure/azure-rest-api-specs Merge ae13f2ee774ca076d87c0132e5629efda678e2cc into 6ffdee5a75188e52088ffa0f476fcef384e5ac1d --- common/config/rush/pnpm-lock.yaml | 14 +- sdk/appplatform/arm-appplatform/CHANGELOG.md | 59 ++- sdk/appplatform/arm-appplatform/_meta.json | 8 +- sdk/appplatform/arm-appplatform/package.json | 23 +- .../review/arm-appplatform.api.md | 114 +++++- .../src/appPlatformManagementClient.ts | 4 +- .../arm-appplatform/src/models/index.ts | 160 +++++++- .../arm-appplatform/src/models/mappers.ts | 384 ++++++++++++++++-- .../arm-appplatform/src/models/parameters.ts | 11 +- .../src/operations/buildpackBinding.ts | 170 ++++++++ .../src/operations/gateways.ts | 143 +++++++ .../operationsInterfaces/buildpackBinding.ts | 13 + .../src/operationsInterfaces/gateways.ts | 40 ++ .../arm-appplatform/test/sampleTest.ts | 43 ++ sdk/appplatform/arm-appplatform/tsconfig.json | 10 +- 15 files changed, 1075 insertions(+), 121 deletions(-) create mode 100644 sdk/appplatform/arm-appplatform/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index d06d29dd41f8..1da8e06f7278 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3928,7 +3928,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20230210 + typescript: 5.0.0-dev.20230214 dev: false /downlevel-dts/0.7.0: @@ -8712,8 +8712,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20230210: - resolution: {integrity: sha512-FjXPw8PFeIuT1cxouvP4LRu8J1G+FsWVEGwlJ9GcVywRNDfD3Hh6flQFUympS+3QnAIiG/+CHs9ZS2EQIT733g==} + /typescript/5.0.0-dev.20230214: + resolution: {integrity: sha512-CpXBmHZVBTjAslhkSqAaiR4zZgr5G46QvfKB51L4+alGm5F2Jqbdhy6+cIFzU3AiN1D/iEmA88E19N0/e5bttQ==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -10080,15 +10080,15 @@ packages: dev: false file:projects/arm-appplatform.tgz: - resolution: {integrity: sha512-QlO5IloyaT6RmxCHqZtfHgS7QNgrZjtdfakMyS8FLMvah1baFcmmycNdnWmlcHuV54ZH8j5bNfW7tyzs003MGA==, tarball: file:projects/arm-appplatform.tgz} + resolution: {integrity: sha512-VOU1HsCy6xcT1LoXiPOxwCISJJEV0wmp+DPssZCZ59Y/3XXXln805obsP6Rxpk9eBSi9Pawt4H5wXnzQfKOLIw==, tarball: file:projects/arm-appplatform.tgz} name: '@rush-temp/arm-appplatform' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.3_@types+node@14.18.36 - '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 - '@rollup/plugin-json': 6.0.0_rollup@2.79.1 - '@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1 + '@rollup/plugin-commonjs': 21.1.0_rollup@2.79.1 + '@rollup/plugin-json': 4.1.0_rollup@2.79.1 + '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 '@types/node': 14.18.36 diff --git a/sdk/appplatform/arm-appplatform/CHANGELOG.md b/sdk/appplatform/arm-appplatform/CHANGELOG.md index 3d14145be6f7..e9d9d057ad9f 100644 --- a/sdk/appplatform/arm-appplatform/CHANGELOG.md +++ b/sdk/appplatform/arm-appplatform/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 2.1.0-beta.6 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 2.1.0-beta.5 (2023-01-13) + +## 3.0.0-beta.1 (2023-02-14) **Features** @@ -25,6 +15,7 @@ - Added operation group Gateways - Added operation group PredefinedAccelerators - Added operation group Storages + - Added operation BuildpackBinding.listForCluster - Added operation BuildServiceBuilder.listDeployments - Added operation Deployments.beginDisableRemoteDebugging - Added operation Deployments.beginDisableRemoteDebuggingAndWait @@ -87,6 +78,8 @@ - Added Interface BindingResource - Added Interface Build - Added Interface BuilderResource + - Added Interface BuildpackBindingListForClusterNextOptionalParams + - Added Interface BuildpackBindingListForClusterOptionalParams - Added Interface BuildpackBindingResource - Added Interface BuildResourceRequests - Added Interface BuildResult @@ -114,6 +107,7 @@ - Added Interface CustomizedAcceleratorValidateResult - Added Interface CustomPersistentDiskProperties - Added Interface CustomPersistentDiskResource + - Added Interface CustomScaleRule - Added Interface DeploymentList - Added Interface DeploymentResource - Added Interface DeploymentsDisableRemoteDebuggingOptionalParams @@ -167,8 +161,11 @@ - Added Interface GatewaysListEnvSecretsOptionalParams - Added Interface GatewaysListNextOptionalParams - Added Interface GatewaysListOptionalParams + - Added Interface GatewaysUpdateCapacityHeaders + - Added Interface GatewaysUpdateCapacityOptionalParams - Added Interface GatewaysValidateDomainOptionalParams - Added Interface HttpGetAction + - Added Interface HttpScaleRule - Added Interface ImageRegistryCredential - Added Interface IngressConfig - Added Interface IngressSettings @@ -189,13 +186,19 @@ - Added Interface Probe - Added Interface ProbeAction - Added Interface ProxyResource + - Added Interface QueueScaleRule - Added Interface RemoteDebugging - Added Interface RemoteDebuggingPayload + - Added Interface Scale + - Added Interface ScaleRule + - Added Interface ScaleRuleAuth + - Added Interface Secret - Added Interface ServiceRegistryResource - Added Interface ServiceResource - Added Interface ServicesStartOptionalParams - Added Interface ServicesStopOptionalParams - Added Interface ServiceVNetAddons + - Added Interface SkuObject - Added Interface SourceUploadedUserSourceInfo - Added Interface SsoProperties - Added Interface StorageAccount @@ -209,6 +212,7 @@ - Added Interface StoragesListOptionalParams - Added Interface SupportedBuildpackResource - Added Interface SupportedStackResource + - Added Interface TcpScaleRule - Added Interface TCPSocketAction - Added Interface TrackedResource - Added Interface UploadedUserSourceInfo @@ -236,6 +240,8 @@ - Added Type Alias ApplicationLiveViewsListNextResponse - Added Type Alias ApplicationLiveViewsListResponse - Added Type Alias BackendProtocol + - Added Type Alias BuildpackBindingListForClusterNextResponse + - Added Type Alias BuildpackBindingListForClusterResponse - Added Type Alias BuildServiceBuilderListDeploymentsResponse - Added Type Alias CertificateResourceProvisioningState - Added Type Alias CustomDomainResourceProvisioningState @@ -271,6 +277,7 @@ - Added Type Alias GatewaysListEnvSecretsResponse - Added Type Alias GatewaysListNextResponse - Added Type Alias GatewaysListResponse + - Added Type Alias GatewaysUpdateCapacityResponse - Added Type Alias GatewaysValidateDomainResponse - Added Type Alias HttpSchemeType - Added Type Alias PowerState @@ -291,12 +298,15 @@ - Added Type Alias Type - Interface AppResourceProperties has a new optional parameter customPersistentDisks - Interface AppResourceProperties has a new optional parameter ingressSettings + - Interface AppResourceProperties has a new optional parameter secrets - Interface AppResourceProperties has a new optional parameter vnetAddons - Interface BuildProperties has a new optional parameter resourceRequests - Interface BuildResultProperties has a new optional parameter error - Interface BuildStageProperties has a new optional parameter exitCode - Interface BuildStageProperties has a new optional parameter reason - Interface CertificateProperties has a new optional parameter provisioningState + - Interface ClusterResourceProperties has a new optional parameter infraResourceGroup + - Interface ClusterResourceProperties has a new optional parameter managedEnvironmentId - Interface ClusterResourceProperties has a new optional parameter marketplaceResource - Interface ClusterResourceProperties has a new optional parameter powerState - Interface ClusterResourceProperties has a new optional parameter vnetAddons @@ -304,11 +314,13 @@ - Interface DeploymentSettings has a new optional parameter containerProbeSettings - Interface DeploymentSettings has a new optional parameter livenessProbe - Interface DeploymentSettings has a new optional parameter readinessProbe + - Interface DeploymentSettings has a new optional parameter scale - Interface DeploymentSettings has a new optional parameter startupProbe - Interface DeploymentSettings has a new optional parameter terminationGracePeriodSeconds - Interface ManagedIdentityProperties has a new optional parameter userAssignedIdentities - Interface NetworkProfile has a new optional parameter ingressConfig - Interface NetworkProfile has a new optional parameter outboundType + - Type of parameter type of interface UserSourceInfo is changed from "UploadedUserSourceInfo" | "Jar" | "Source" | "NetCoreZip" | "BuildResult" to "UploadedUserSourceInfo" | "Jar" | "Source" | "NetCoreZip" | "BuildResult" | "Container" - Added Enum KnownApiPortalProvisioningState - Added Enum KnownApmType - Added Enum KnownApplicationAcceleratorProvisioningState @@ -332,9 +344,30 @@ - Added Enum KnownType - Enum KnownBindingType has a new value CACertificates - Added function getContinuationToken + +**Breaking Changes** + - Interface DeploymentsListForClusterNextOptionalParams no longer has parameter version - Interface DeploymentsListNextOptionalParams no longer has parameter version - - Type of parameter type of interface UserSourceInfo is changed from "UploadedUserSourceInfo" | "Jar" | "Source" | "NetCoreZip" | "BuildResult" to "UploadedUserSourceInfo" | "Jar" | "Source" | "NetCoreZip" | "BuildResult" | "Container" + - Type of parameter addonConfigs of interface AppResourceProperties is changed from { + [propertyName: string]: { + [propertyName: string]: Record; + }; + } to { + [propertyName: string]: Record; + } + - Type of parameter bindingParameters of interface BindingResourceProperties is changed from { + [propertyName: string]: Record; + } to { + [propertyName: string]: string; + } + - Type of parameter addonConfigs of interface DeploymentSettings is changed from { + [propertyName: string]: { + [propertyName: string]: Record; + }; + } to { + [propertyName: string]: Record; + } ## 2.0.0 (2022-05-19) diff --git a/sdk/appplatform/arm-appplatform/_meta.json b/sdk/appplatform/arm-appplatform/_meta.json index 52e13413dba1..7d9ac5a6c2e6 100644 --- a/sdk/appplatform/arm-appplatform/_meta.json +++ b/sdk/appplatform/arm-appplatform/_meta.json @@ -1,8 +1,8 @@ { - "commit": "e7bf3adfa2d5e5cdbb804eec35279501794f461c", + "commit": "e115568703b0bc5765b07cbcb7d322e6fecdab2c", "readme": "specification/appplatform/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\appplatform\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/appplatform/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.7" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/package.json b/sdk/appplatform/arm-appplatform/package.json index 38529eb8c10c..cde5a33d9c20 100644 --- a/sdk/appplatform/arm-appplatform/package.json +++ b/sdk/appplatform/arm-appplatform/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AppPlatformManagementClient.", - "version": "2.1.0-beta.6", + "version": "3.0.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -29,9 +29,9 @@ "types": "./types/arm-appplatform.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", - "@rollup/plugin-commonjs": "^24.0.0", - "@rollup/plugin-json": "^6.0.0", - "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-commonjs": "^21.0.1", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-multi-entry": "^4.1.0", "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^1.0.4", "rollup": "^2.66.1", @@ -39,7 +39,6 @@ "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -50,6 +49,7 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -110,14 +110,5 @@ } ] }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-appplatform?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md b/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md index b74108eb05e7..a3270747eed7 100644 --- a/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md +++ b/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md @@ -484,9 +484,7 @@ export interface AppResourceCollection { // @public export interface AppResourceProperties { addonConfigs?: { - [propertyName: string]: { - [propertyName: string]: Record; - }; + [propertyName: string]: Record; }; customPersistentDisks?: CustomPersistentDiskResource[]; enableEndToEndTLS?: boolean; @@ -497,6 +495,7 @@ export interface AppResourceProperties { persistentDisk?: PersistentDisk; readonly provisioningState?: AppResourceProvisioningState; public?: boolean; + secrets?: Secret[]; temporaryDisk?: TemporaryDisk; readonly url?: string; vnetAddons?: AppVNetAddons; @@ -609,7 +608,7 @@ export interface AvailableRuntimeVersions { // @public export interface AzureFileVolume extends CustomPersistentDiskProperties { - shareName: string; + shareName?: string; type: "AzureFileVolume"; } @@ -630,7 +629,7 @@ export interface BindingResourceCollection { // @public export interface BindingResourceProperties { bindingParameters?: { - [propertyName: string]: Record; + [propertyName: string]: string; }; readonly createdAt?: string; readonly generatedProperties?: string; @@ -741,6 +740,7 @@ export interface BuildpackBinding { beginDeleteAndWait(resourceGroupName: string, serviceName: string, buildServiceName: string, builderName: string, buildpackBindingName: string, options?: BuildpackBindingDeleteOptionalParams): Promise; get(resourceGroupName: string, serviceName: string, buildServiceName: string, builderName: string, buildpackBindingName: string, options?: BuildpackBindingGetOptionalParams): Promise; list(resourceGroupName: string, serviceName: string, buildServiceName: string, builderName: string, options?: BuildpackBindingListOptionalParams): PagedAsyncIterableIterator; + listForCluster(resourceGroupName: string, serviceName: string, options?: BuildpackBindingListForClusterOptionalParams): PagedAsyncIterableIterator; } // @public @@ -775,6 +775,20 @@ export interface BuildpackBindingLaunchProperties { }; } +// @public +export interface BuildpackBindingListForClusterNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BuildpackBindingListForClusterNextResponse = BuildpackBindingResourceCollection; + +// @public +export interface BuildpackBindingListForClusterOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type BuildpackBindingListForClusterResponse = BuildpackBindingResourceCollection; + // @public export interface BuildpackBindingListNextOptionalParams extends coreClient.OperationOptions { } @@ -1249,6 +1263,8 @@ export interface CloudErrorBody { // @public export interface ClusterResourceProperties { readonly fqdn?: string; + infraResourceGroup?: string; + managedEnvironmentId?: string; marketplaceResource?: MarketplaceResource; networkProfile?: NetworkProfile; readonly powerState?: PowerState; @@ -1697,6 +1713,7 @@ export type CustomizedAcceleratorValidateResultState = string; // @public export interface CustomPersistentDiskProperties { + enableSubPath?: boolean; mountOptions?: string[]; mountPath: string; readOnly?: boolean; @@ -1712,6 +1729,15 @@ export interface CustomPersistentDiskResource { storageId: string; } +// @public +export interface CustomScaleRule { + auth?: ScaleRuleAuth[]; + metadata?: { + [propertyName: string]: string; + }; + type?: string; +} + // @public export interface DeploymentInstance { readonly discoveryStatus?: string; @@ -1823,9 +1849,7 @@ export type DeploymentsEnableRemoteDebuggingResponse = RemoteDebugging; // @public export interface DeploymentSettings { addonConfigs?: { - [propertyName: string]: { - [propertyName: string]: Record; - }; + [propertyName: string]: Record; }; containerProbeSettings?: ContainerProbeSettings; environmentVariables?: { @@ -1834,6 +1858,7 @@ export interface DeploymentSettings { livenessProbe?: Probe; readinessProbe?: Probe; resourceRequests?: ResourceRequests; + scale?: Scale; startupProbe?: Probe; terminationGracePeriodSeconds?: number; } @@ -2303,6 +2328,8 @@ export interface Gateways { beginCreateOrUpdateAndWait(resourceGroupName: string, serviceName: string, gatewayName: string, gatewayResource: GatewayResource, options?: GatewaysCreateOrUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, serviceName: string, gatewayName: string, options?: GatewaysDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, serviceName: string, gatewayName: string, options?: GatewaysDeleteOptionalParams): Promise; + beginUpdateCapacity(resourceGroupName: string, serviceName: string, gatewayName: string, gatewayCapacityResource: SkuObject, options?: GatewaysUpdateCapacityOptionalParams): Promise, GatewaysUpdateCapacityResponse>>; + beginUpdateCapacityAndWait(resourceGroupName: string, serviceName: string, gatewayName: string, gatewayCapacityResource: SkuObject, options?: GatewaysUpdateCapacityOptionalParams): Promise; get(resourceGroupName: string, serviceName: string, gatewayName: string, options?: GatewaysGetOptionalParams): Promise; list(resourceGroupName: string, serviceName: string, options?: GatewaysListOptionalParams): PagedAsyncIterableIterator; listEnvSecrets(resourceGroupName: string, serviceName: string, gatewayName: string, options?: GatewaysListEnvSecretsOptionalParams): Promise; @@ -2354,6 +2381,21 @@ export interface GatewaysListOptionalParams extends coreClient.OperationOptions // @public export type GatewaysListResponse = GatewayResourceCollection; +// @public +export interface GatewaysUpdateCapacityHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface GatewaysUpdateCapacityOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type GatewaysUpdateCapacityResponse = GatewayResource; + // @public export interface GatewaysValidateDomainOptionalParams extends coreClient.OperationOptions { } @@ -2386,6 +2428,14 @@ export interface HttpGetAction extends ProbeAction { type: "HTTPGetAction"; } +// @public +export interface HttpScaleRule { + auth?: ScaleRuleAuth[]; + metadata?: { + [propertyName: string]: string; + }; +} + // @public export type HttpSchemeType = string; @@ -3108,6 +3158,13 @@ export type ProvisioningState = string; export interface ProxyResource extends Resource { } +// @public +export interface QueueScaleRule { + auth?: ScaleRuleAuth[]; + queueLength?: number; + queueName?: string; +} + // @public export interface RegenerateTestKeyRequestPayload { keyType: TestKeyType; @@ -3221,6 +3278,34 @@ export interface RuntimeVersionsListRuntimeVersionsOptionalParams extends coreCl // @public export type RuntimeVersionsListRuntimeVersionsResponse = AvailableRuntimeVersions; +// @public +export interface Scale { + maxReplicas?: number; + minReplicas?: number; + rules?: ScaleRule[]; +} + +// @public +export interface ScaleRule { + azureQueue?: QueueScaleRule; + custom?: CustomScaleRule; + http?: HttpScaleRule; + name?: string; + tcp?: TcpScaleRule; +} + +// @public +export interface ScaleRuleAuth { + secretRef?: string; + triggerParameter?: string; +} + +// @public +export interface Secret { + name?: string; + value?: string; +} + // @public export interface ServiceRegistries { beginCreateOrUpdate(resourceGroupName: string, serviceName: string, serviceRegistryName: string, options?: ServiceRegistriesCreateOrUpdateOptionalParams): Promise, ServiceRegistriesCreateOrUpdateResponse>>; @@ -3467,6 +3552,11 @@ export interface SkuCapacity { scaleType?: SkuScaleType; } +// @public +export interface SkuObject { + sku?: Sku; +} + // @public export interface Skus { list(options?: SkusListOptionalParams): PagedAsyncIterableIterator; @@ -3641,6 +3731,14 @@ export interface SystemData { lastModifiedByType?: LastModifiedByType; } +// @public +export interface TcpScaleRule { + auth?: ScaleRuleAuth[]; + metadata?: { + [propertyName: string]: string; + }; +} + // @public export interface TCPSocketAction extends ProbeAction { type: "TCPSocketAction"; diff --git a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts index 061667286602..8a24db3d9783 100644 --- a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts +++ b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts @@ -109,7 +109,7 @@ export class AppPlatformManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-appplatform/2.1.0-beta.6`; + const packageDetails = `azsdk-js-arm-appplatform/3.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -162,7 +162,7 @@ export class AppPlatformManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-11-01-preview"; + this.apiVersion = options.apiVersion || "2023-01-01-preview"; this.services = new ServicesImpl(this); this.configServers = new ConfigServersImpl(this); this.configurationServices = new ConfigurationServicesImpl(this); diff --git a/sdk/appplatform/arm-appplatform/src/models/index.ts b/sdk/appplatform/arm-appplatform/src/models/index.ts index 8190d0613ce9..34afff7e9f03 100644 --- a/sdk/appplatform/arm-appplatform/src/models/index.ts +++ b/sdk/appplatform/arm-appplatform/src/models/index.ts @@ -58,6 +58,10 @@ export interface ClusterResourceProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly serviceId?: string; + /** The resource Id of the Managed Environment that the Spring Apps instance builds on */ + managedEnvironmentId?: string; + /** The name of the resource group that contains the infrastructure resources */ + infraResourceGroup?: string; /** * Power state of the Service * NOTE: This property will not be serialized. It can only be populated by the server. @@ -807,6 +811,17 @@ export interface BuildResourceRequests { memory?: string; } +/** Object that includes an array of BuildpackBinding resources and a possible link for next set */ +export interface BuildpackBindingResourceCollection { + /** Collection of BuildpackBinding resources */ + value?: BuildpackBindingResource[]; + /** + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + nextLink?: string; +} + /** Properties of a buildpack binding */ export interface BuildpackBindingProperties { /** Buildpack Binding Type */ @@ -828,17 +843,6 @@ export interface BuildpackBindingLaunchProperties { secrets?: { [propertyName: string]: string }; } -/** Object that includes an array of BuildpackBinding resources and a possible link for next set */ -export interface BuildpackBindingResourceCollection { - /** Collection of BuildpackBinding resources */ - value?: BuildpackBindingResource[]; - /** - * URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - */ - nextLink?: string; -} - /** Object that includes an array of Build result resources and a possible link for next set */ export interface BuildResultCollection { /** Collection of Build result resources */ @@ -1066,9 +1070,7 @@ export interface AppResourceProperties { */ readonly url?: string; /** Collection of addons */ - addonConfigs?: { - [propertyName: string]: { [propertyName: string]: Record }; - }; + addonConfigs?: { [propertyName: string]: Record }; /** * Provisioning state of the App * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1095,6 +1097,8 @@ export interface AppResourceProperties { vnetAddons?: AppVNetAddons; /** App ingress settings payload. */ ingressSettings?: IngressSettings; + /** Collection of auth secrets */ + secrets?: Secret[]; } /** Temporary disk payload */ @@ -1134,6 +1138,8 @@ export interface CustomPersistentDiskProperties { mountPath: string; /** Indicates whether the persistent disk is a readOnly one. */ readOnly?: boolean; + /** If set to true, it will create and mount a dedicated directory for every individual app instance. */ + enableSubPath?: boolean; /** These are the mount options for a persistent disk. */ mountOptions?: string[]; } @@ -1179,6 +1185,14 @@ export interface IngressSettingsClientAuth { certificates?: string[]; } +/** Secret definition. */ +export interface Secret { + /** Secret Name. */ + name?: string; + /** Secret Value. */ + value?: string; +} + /** Managed identity properties retrieved from ARM request headers. */ export interface ManagedIdentityProperties { /** Type of the managed identity */ @@ -1241,7 +1255,7 @@ export interface BindingResourceProperties { /** The key of the bound resource */ key?: string; /** Binding parameters of the Binding resource */ - bindingParameters?: { [propertyName: string]: Record }; + bindingParameters?: { [propertyName: string]: string }; /** * The generated Spring Boot property file for this binding. The secret will be deducted. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1442,9 +1456,7 @@ export interface DeploymentSettings { /** Collection of environment variables */ environmentVariables?: { [propertyName: string]: string }; /** Collection of addons */ - addonConfigs?: { - [propertyName: string]: { [propertyName: string]: Record }; - }; + addonConfigs?: { [propertyName: string]: Record }; /** Periodic probe of App Instance liveness. App Instance will be restarted if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes */ livenessProbe?: Probe; /** Periodic probe of App Instance service readiness. App Instance will be removed from service endpoints if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes */ @@ -1453,6 +1465,8 @@ export interface DeploymentSettings { startupProbe?: Probe; /** Optional duration in seconds the App Instance needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the App Instance are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 90 seconds. */ terminationGracePeriodSeconds?: number; + /** Scaling properties for the Azure Spring Apps App Instance. */ + scale?: Scale; /** Container liveness and readiness probe settings */ containerProbeSettings?: ContainerProbeSettings; } @@ -1489,6 +1503,77 @@ export interface ProbeAction { type: "HTTPGetAction" | "ExecAction" | "TCPSocketAction"; } +/** Azure Spring Apps scaling configurations. */ +export interface Scale { + /** Optional. Minimum number of container replicas. */ + minReplicas?: number; + /** Optional. Maximum number of container replicas. Defaults to 10 if not set. */ + maxReplicas?: number; + /** Scaling rules. */ + rules?: ScaleRule[]; +} + +/** Azure Spring Apps App Instance scaling rule. */ +export interface ScaleRule { + /** Scale Rule Name */ + name?: string; + /** Azure Queue based scaling. */ + azureQueue?: QueueScaleRule; + /** Custom scale rule. */ + custom?: CustomScaleRule; + /** HTTP requests based scaling. */ + http?: HttpScaleRule; + /** Tcp requests based scaling. */ + tcp?: TcpScaleRule; +} + +/** Azure Spring Apps App Instance Azure Queue based scaling rule. */ +export interface QueueScaleRule { + /** Queue name. */ + queueName?: string; + /** Queue length. */ + queueLength?: number; + /** Authentication secrets for the queue scale rule. */ + auth?: ScaleRuleAuth[]; +} + +/** Auth Secrets for Azure Spring Apps App Instance Scale Rule */ +export interface ScaleRuleAuth { + /** Name of the Azure Spring Apps App Instance secret from which to pull the auth params. */ + secretRef?: string; + /** Trigger Parameter that uses the secret */ + triggerParameter?: string; +} + +/** Azure Spring Apps App Instance Custom scaling rule. */ +export interface CustomScaleRule { + /** + * Type of the custom scale rule + * eg: azure-servicebus, redis etc. + */ + type?: string; + /** Metadata properties to describe custom scale rule. */ + metadata?: { [propertyName: string]: string }; + /** Authentication secrets for the custom scale rule. */ + auth?: ScaleRuleAuth[]; +} + +/** Azure Spring Apps App Instance Http scaling rule. */ +export interface HttpScaleRule { + /** Metadata properties to describe http scale rule. */ + metadata?: { [propertyName: string]: string }; + /** Authentication secrets for the custom scale rule. */ + auth?: ScaleRuleAuth[]; +} + +/** Azure Spring Apps App Instance Tcp scaling rule. */ +export interface TcpScaleRule { + /** Metadata properties to describe tcp scale rule. */ + metadata?: { [propertyName: string]: string }; + /** Authentication secrets for the tcp scale rule. */ + auth?: ScaleRuleAuth[]; +} + /** Container liveness and readiness probe settings */ export interface ContainerProbeSettings { /** Indicates whether disable the liveness and readiness probe */ @@ -1950,6 +2035,12 @@ export interface GatewayOperatorResourceRequests { readonly instanceCount?: number; } +/** Resource Sku object used for scaling out and scaling in. */ +export interface SkuObject { + /** Sku of the Spring Cloud Gateway resource */ + sku?: Sku; +} + /** Object that includes an array of gateway resources and a possible link for next set */ export interface GatewayResourceCollection { /** Collection of gateway resources */ @@ -2306,7 +2397,7 @@ export interface AzureFileVolume extends CustomPersistentDiskProperties { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "AzureFileVolume"; /** The share name of the Azure File share. */ - shareName: string; + shareName?: string; } /** storage resource of type Azure Storage Account. */ @@ -2649,6 +2740,11 @@ export interface NetCoreZipUploadedUserSourceInfo runtimeVersion?: string; } +/** Defines headers for Gateways_updateCapacity operation. */ +export interface GatewaysUpdateCapacityHeaders { + location?: string; +} + /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { /** Creating */ @@ -4203,6 +4299,13 @@ export interface BuildServiceListBuildResultsNextOptionalParams /** Contains response data for the listBuildResultsNext operation. */ export type BuildServiceListBuildResultsNextResponse = BuildResultCollection; +/** Optional parameters. */ +export interface BuildpackBindingListForClusterOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForCluster operation. */ +export type BuildpackBindingListForClusterResponse = BuildpackBindingResourceCollection; + /** Optional parameters. */ export interface BuildpackBindingGetOptionalParams extends coreClient.OperationOptions {} @@ -4238,6 +4341,13 @@ export interface BuildpackBindingListOptionalParams /** Contains response data for the list operation. */ export type BuildpackBindingListResponse = BuildpackBindingResourceCollection; +/** Optional parameters. */ +export interface BuildpackBindingListForClusterNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listForClusterNext operation. */ +export type BuildpackBindingListForClusterNextResponse = BuildpackBindingResourceCollection; + /** Optional parameters. */ export interface BuildpackBindingListNextOptionalParams extends coreClient.OperationOptions {} @@ -4850,6 +4960,18 @@ export interface GatewaysCreateOrUpdateOptionalParams /** Contains response data for the createOrUpdate operation. */ export type GatewaysCreateOrUpdateResponse = GatewayResource; +/** Optional parameters. */ +export interface GatewaysUpdateCapacityOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the updateCapacity operation. */ +export type GatewaysUpdateCapacityResponse = GatewayResource; + /** Optional parameters. */ export interface GatewaysDeleteOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/appplatform/arm-appplatform/src/models/mappers.ts b/sdk/appplatform/arm-appplatform/src/models/mappers.ts index 848e27cff3a1..09b76fa724c3 100644 --- a/sdk/appplatform/arm-appplatform/src/models/mappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/mappers.ts @@ -48,6 +48,18 @@ export const ClusterResourceProperties: coreClient.CompositeMapper = { name: "String" } }, + managedEnvironmentId: { + serializedName: "managedEnvironmentId", + type: { + name: "String" + } + }, + infraResourceGroup: { + serializedName: "infraResourceGroup", + type: { + name: "String" + } + }, powerState: { serializedName: "powerState", readOnly: true, @@ -1806,6 +1818,33 @@ export const BuildResourceRequests: coreClient.CompositeMapper = { } }; +export const BuildpackBindingResourceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "BuildpackBindingResourceCollection", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BuildpackBindingResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const BuildpackBindingProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1858,33 +1897,6 @@ export const BuildpackBindingLaunchProperties: coreClient.CompositeMapper = { } }; -export const BuildpackBindingResourceCollection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BuildpackBindingResourceCollection", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BuildpackBindingResource" - } - } - } - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String" - } - } - } - } -}; - export const BuildResultCollection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2418,12 +2430,7 @@ export const AppResourceProperties: coreClient.CompositeMapper = { type: { name: "Dictionary", value: { - type: { - name: "Dictionary", - value: { - type: { name: "Dictionary", value: { type: { name: "any" } } } - } - } + type: { name: "Dictionary", value: { type: { name: "any" } } } } } }, @@ -2506,6 +2513,18 @@ export const AppResourceProperties: coreClient.CompositeMapper = { name: "Composite", className: "IngressSettings" } + }, + secrets: { + serializedName: "secrets", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Secret" + } + } + } } } } @@ -2626,6 +2645,13 @@ export const CustomPersistentDiskProperties: coreClient.CompositeMapper = { name: "Boolean" } }, + enableSubPath: { + defaultValue: false, + serializedName: "enableSubPath", + type: { + name: "Boolean" + } + }, mountOptions: { serializedName: "mountOptions", type: { @@ -2753,6 +2779,27 @@ export const IngressSettingsClientAuth: coreClient.CompositeMapper = { } }; +export const Secret: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Secret", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + export const ManagedIdentityProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2897,9 +2944,7 @@ export const BindingResourceProperties: coreClient.CompositeMapper = { serializedName: "bindingParameters", type: { name: "Dictionary", - value: { - type: { name: "Dictionary", value: { type: { name: "any" } } } - } + value: { type: { name: "String" } } } }, generatedProperties: { @@ -3367,12 +3412,7 @@ export const DeploymentSettings: coreClient.CompositeMapper = { type: { name: "Dictionary", value: { - type: { - name: "Dictionary", - value: { - type: { name: "Dictionary", value: { type: { name: "any" } } } - } - } + type: { name: "Dictionary", value: { type: { name: "any" } } } } } }, @@ -3404,6 +3444,13 @@ export const DeploymentSettings: coreClient.CompositeMapper = { name: "Number" } }, + scale: { + serializedName: "scale", + type: { + name: "Composite", + className: "Scale" + } + }, containerProbeSettings: { serializedName: "containerProbeSettings", type: { @@ -3511,6 +3558,227 @@ export const ProbeAction: coreClient.CompositeMapper = { } }; +export const Scale: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Scale", + modelProperties: { + minReplicas: { + serializedName: "minReplicas", + type: { + name: "Number" + } + }, + maxReplicas: { + defaultValue: 10, + serializedName: "maxReplicas", + type: { + name: "Number" + } + }, + rules: { + serializedName: "rules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleRule" + } + } + } + } + } + } +}; + +export const ScaleRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleRule", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + azureQueue: { + serializedName: "azureQueue", + type: { + name: "Composite", + className: "QueueScaleRule" + } + }, + custom: { + serializedName: "custom", + type: { + name: "Composite", + className: "CustomScaleRule" + } + }, + http: { + serializedName: "http", + type: { + name: "Composite", + className: "HttpScaleRule" + } + }, + tcp: { + serializedName: "tcp", + type: { + name: "Composite", + className: "TcpScaleRule" + } + } + } + } +}; + +export const QueueScaleRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "QueueScaleRule", + modelProperties: { + queueName: { + serializedName: "queueName", + type: { + name: "String" + } + }, + queueLength: { + serializedName: "queueLength", + type: { + name: "Number" + } + }, + auth: { + serializedName: "auth", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleRuleAuth" + } + } + } + } + } + } +}; + +export const ScaleRuleAuth: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ScaleRuleAuth", + modelProperties: { + secretRef: { + serializedName: "secretRef", + type: { + name: "String" + } + }, + triggerParameter: { + serializedName: "triggerParameter", + type: { + name: "String" + } + } + } + } +}; + +export const CustomScaleRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CustomScaleRule", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + metadata: { + serializedName: "metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + auth: { + serializedName: "auth", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleRuleAuth" + } + } + } + } + } + } +}; + +export const HttpScaleRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "HttpScaleRule", + modelProperties: { + metadata: { + serializedName: "metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + auth: { + serializedName: "auth", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleRuleAuth" + } + } + } + } + } + } +}; + +export const TcpScaleRule: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TcpScaleRule", + modelProperties: { + metadata: { + serializedName: "metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + auth: { + serializedName: "auth", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ScaleRuleAuth" + } + } + } + } + } + } +}; + export const ContainerProbeSettings: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4748,6 +5016,22 @@ export const GatewayOperatorResourceRequests: coreClient.CompositeMapper = { } }; +export const SkuObject: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuObject", + modelProperties: { + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "Sku" + } + } + } + } +}; + export const GatewayResourceCollection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -5733,7 +6017,6 @@ export const AzureFileVolume: coreClient.CompositeMapper = { ...CustomPersistentDiskProperties.type.modelProperties, shareName: { serializedName: "shareName", - required: true, type: { name: "String" } @@ -6659,6 +6942,21 @@ export const NetCoreZipUploadedUserSourceInfo: coreClient.CompositeMapper = { } }; +export const GatewaysUpdateCapacityHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GatewaysUpdateCapacityHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export let discriminators = { CustomPersistentDiskProperties: CustomPersistentDiskProperties, StorageProperties: StorageProperties, diff --git a/sdk/appplatform/arm-appplatform/src/models/parameters.ts b/sdk/appplatform/arm-appplatform/src/models/parameters.ts index c87db12761d4..c44e9da9838f 100644 --- a/sdk/appplatform/arm-appplatform/src/models/parameters.ts +++ b/sdk/appplatform/arm-appplatform/src/models/parameters.ts @@ -37,6 +37,7 @@ import { RemoteDebuggingPayload as RemoteDebuggingPayloadMapper, DiagnosticParameters as DiagnosticParametersMapper, GatewayResource as GatewayResourceMapper, + SkuObject as SkuObjectMapper, GatewayRouteConfigResource as GatewayRouteConfigResourceMapper, GatewayCustomDomainResource as GatewayCustomDomainResourceMapper, ApiPortalResource as ApiPortalResourceMapper, @@ -73,7 +74,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-11-01-preview", + defaultValue: "2023-01-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -107,6 +108,9 @@ export const resourceGroupName: OperationURLParameter = { export const serviceName: OperationURLParameter = { parameterPath: "serviceName", mapper: { + constraints: { + Pattern: new RegExp("^[a-z][a-z0-9-]*[a-z0-9]$") + }, serializedName: "serviceName", required: true, type: { @@ -510,6 +514,11 @@ export const gatewayResource: OperationParameter = { mapper: GatewayResourceMapper }; +export const gatewayCapacityResource: OperationParameter = { + parameterPath: "gatewayCapacityResource", + mapper: SkuObjectMapper +}; + export const routeConfigName: OperationURLParameter = { parameterPath: "routeConfigName", mapper: { diff --git a/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts b/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts index 4f125de999e3..a14a12acc9a6 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/buildpackBinding.ts @@ -17,6 +17,9 @@ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { BuildpackBindingResource, + BuildpackBindingListForClusterNextOptionalParams, + BuildpackBindingListForClusterOptionalParams, + BuildpackBindingListForClusterResponse, BuildpackBindingListNextOptionalParams, BuildpackBindingListOptionalParams, BuildpackBindingListResponse, @@ -25,6 +28,7 @@ import { BuildpackBindingCreateOrUpdateOptionalParams, BuildpackBindingCreateOrUpdateResponse, BuildpackBindingDeleteOptionalParams, + BuildpackBindingListForClusterNextResponse, BuildpackBindingListNextResponse } from "../models"; @@ -41,6 +45,91 @@ export class BuildpackBindingImpl implements BuildpackBinding { this.client = client; } + /** + * Get collection of buildpack bindings under all builders. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param options The options parameters. + */ + public listForCluster( + resourceGroupName: string, + serviceName: string, + options?: BuildpackBindingListForClusterOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listForClusterPagingAll( + resourceGroupName, + serviceName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listForClusterPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listForClusterPagingPage( + resourceGroupName: string, + serviceName: string, + options?: BuildpackBindingListForClusterOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: BuildpackBindingListForClusterResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listForCluster( + resourceGroupName, + serviceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listForClusterNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listForClusterPagingAll( + resourceGroupName: string, + serviceName: string, + options?: BuildpackBindingListForClusterOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listForClusterPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + /** * Handles requests to list all buildpack bindings in a builder. * @param resourceGroupName The name of the resource group that contains the resource. You can obtain @@ -144,6 +233,24 @@ export class BuildpackBindingImpl implements BuildpackBinding { } } + /** + * Get collection of buildpack bindings under all builders. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param options The options parameters. + */ + private _listForCluster( + resourceGroupName: string, + serviceName: string, + options?: BuildpackBindingListForClusterOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listForClusterOperationSpec + ); + } + /** * Get a buildpack binding by name. * @param resourceGroupName The name of the resource group that contains the resource. You can obtain @@ -426,6 +533,26 @@ export class BuildpackBindingImpl implements BuildpackBinding { ); } + /** + * ListForClusterNext + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param nextLink The nextLink from the previous successful call to the ListForCluster method. + * @param options The options parameters. + */ + private _listForClusterNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: BuildpackBindingListForClusterNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listForClusterNextOperationSpec + ); + } + /** * ListNext * @param resourceGroupName The name of the resource group that contains the resource. You can obtain @@ -460,6 +587,28 @@ export class BuildpackBindingImpl implements BuildpackBinding { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); +const listForClusterOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BuildpackBindingResourceCollection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName + ], + headerParameters: [Parameters.accept], + serializer +}; const getOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}", @@ -571,6 +720,27 @@ const listOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const listForClusterNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BuildpackBindingResourceCollection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/appplatform/arm-appplatform/src/operations/gateways.ts b/sdk/appplatform/arm-appplatform/src/operations/gateways.ts index d7be0cfd3150..8d8e8c954f1f 100644 --- a/sdk/appplatform/arm-appplatform/src/operations/gateways.ts +++ b/sdk/appplatform/arm-appplatform/src/operations/gateways.ts @@ -24,6 +24,9 @@ import { GatewaysGetResponse, GatewaysCreateOrUpdateOptionalParams, GatewaysCreateOrUpdateResponse, + SkuObject, + GatewaysUpdateCapacityOptionalParams, + GatewaysUpdateCapacityResponse, GatewaysDeleteOptionalParams, GatewaysListEnvSecretsOptionalParams, GatewaysListEnvSecretsResponse, @@ -242,6 +245,112 @@ export class GatewaysImpl implements Gateways { return poller.pollUntilDone(); } + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation + * @param options The options parameters. + */ + async beginUpdateCapacity( + resourceGroupName: string, + serviceName: string, + gatewayName: string, + gatewayCapacityResource: SkuObject, + options?: GatewaysUpdateCapacityOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GatewaysUpdateCapacityResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + serviceName, + gatewayName, + gatewayCapacityResource, + options + }, + updateCapacityOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation + * @param options The options parameters. + */ + async beginUpdateCapacityAndWait( + resourceGroupName: string, + serviceName: string, + gatewayName: string, + gatewayCapacityResource: SkuObject, + options?: GatewaysUpdateCapacityOptionalParams + ): Promise { + const poller = await this.beginUpdateCapacity( + resourceGroupName, + serviceName, + gatewayName, + gatewayCapacityResource, + options + ); + return poller.pollUntilDone(); + } + /** * Disable the default Spring Cloud Gateway. * @param resourceGroupName The name of the resource group that contains the resource. You can obtain @@ -471,6 +580,40 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const updateCapacityOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.GatewayResource + }, + 201: { + bodyMapper: Mappers.GatewayResource + }, + 202: { + bodyMapper: Mappers.GatewayResource + }, + 204: { + bodyMapper: Mappers.GatewayResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.gatewayCapacityResource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.gatewayName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const deleteOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}", diff --git a/sdk/appplatform/arm-appplatform/src/operationsInterfaces/buildpackBinding.ts b/sdk/appplatform/arm-appplatform/src/operationsInterfaces/buildpackBinding.ts index 315328b4ad19..a583dcac67bb 100644 --- a/sdk/appplatform/arm-appplatform/src/operationsInterfaces/buildpackBinding.ts +++ b/sdk/appplatform/arm-appplatform/src/operationsInterfaces/buildpackBinding.ts @@ -10,6 +10,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { PollerLike, PollOperationState } from "@azure/core-lro"; import { BuildpackBindingResource, + BuildpackBindingListForClusterOptionalParams, BuildpackBindingListOptionalParams, BuildpackBindingGetOptionalParams, BuildpackBindingGetResponse, @@ -21,6 +22,18 @@ import { /// /** Interface representing a BuildpackBinding. */ export interface BuildpackBinding { + /** + * Get collection of buildpack bindings under all builders. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param options The options parameters. + */ + listForCluster( + resourceGroupName: string, + serviceName: string, + options?: BuildpackBindingListForClusterOptionalParams + ): PagedAsyncIterableIterator; /** * Handles requests to list all buildpack bindings in a builder. * @param resourceGroupName The name of the resource group that contains the resource. You can obtain diff --git a/sdk/appplatform/arm-appplatform/src/operationsInterfaces/gateways.ts b/sdk/appplatform/arm-appplatform/src/operationsInterfaces/gateways.ts index 977cdb00f61b..e7658b056a3f 100644 --- a/sdk/appplatform/arm-appplatform/src/operationsInterfaces/gateways.ts +++ b/sdk/appplatform/arm-appplatform/src/operationsInterfaces/gateways.ts @@ -15,6 +15,9 @@ import { GatewaysGetResponse, GatewaysCreateOrUpdateOptionalParams, GatewaysCreateOrUpdateResponse, + SkuObject, + GatewaysUpdateCapacityOptionalParams, + GatewaysUpdateCapacityResponse, GatewaysDeleteOptionalParams, GatewaysListEnvSecretsOptionalParams, GatewaysListEnvSecretsResponse, @@ -89,6 +92,43 @@ export interface Gateways { gatewayResource: GatewayResource, options?: GatewaysCreateOrUpdateOptionalParams ): Promise; + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation + * @param options The options parameters. + */ + beginUpdateCapacity( + resourceGroupName: string, + serviceName: string, + gatewayName: string, + gatewayCapacityResource: SkuObject, + options?: GatewaysUpdateCapacityOptionalParams + ): Promise< + PollerLike< + PollOperationState, + GatewaysUpdateCapacityResponse + > + >; + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain + * this value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation + * @param options The options parameters. + */ + beginUpdateCapacityAndWait( + resourceGroupName: string, + serviceName: string, + gatewayName: string, + gatewayCapacityResource: SkuObject, + options?: GatewaysUpdateCapacityOptionalParams + ): Promise; /** * Disable the default Spring Cloud Gateway. * @param resourceGroupName The name of the resource group that contains the resource. You can obtain diff --git a/sdk/appplatform/arm-appplatform/test/sampleTest.ts b/sdk/appplatform/arm-appplatform/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/appplatform/arm-appplatform/tsconfig.json b/sdk/appplatform/arm-appplatform/tsconfig.json index 04fa881dd845..3e6ae96443f3 100644 --- a/sdk/appplatform/arm-appplatform/tsconfig.json +++ b/sdk/appplatform/arm-appplatform/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-appplatform": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"