From 72440516e808f4088e408585bfc22a00fc1190ec Mon Sep 17 00:00:00 2001 From: colawwj Date: Thu, 1 Jul 2021 14:41:34 +0800 Subject: [PATCH] arm-appplatform --- sdk/appplatform/arm-appplatform/README.md | 8 +- sdk/appplatform/arm-appplatform/package.json | 4 +- .../src/appPlatformManagementClientContext.ts | 6 +- .../arm-appplatform/src/models/appsMappers.ts | 3 + .../src/models/bindingsMappers.ts | 3 + .../src/models/certificatesMappers.ts | 3 + .../src/models/configServersMappers.ts | 3 + .../src/models/customDomainsMappers.ts | 3 + .../src/models/deploymentsMappers.ts | 3 + .../arm-appplatform/src/models/index.ts | 101 ++++++++++++-- .../arm-appplatform/src/models/mappers.ts | 129 +++++++++++++++++- .../src/models/monitoringSettingsMappers.ts | 3 + .../src/models/servicesMappers.ts | 3 + 13 files changed, 243 insertions(+), 29 deletions(-) diff --git a/sdk/appplatform/arm-appplatform/README.md b/sdk/appplatform/arm-appplatform/README.md index c06e938283f7..86419554dac7 100644 --- a/sdk/appplatform/arm-appplatform/README.md +++ b/sdk/appplatform/arm-appplatform/README.md @@ -1,11 +1,11 @@ ## Azure AppPlatformManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AppPlatformManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for AppPlatformManagementClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-appplatform @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and get services as an example written in JavaScript. ##### Sample code @@ -87,7 +85,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmAppplatform.AppPlatformManagementClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; diff --git a/sdk/appplatform/arm-appplatform/package.json b/sdk/appplatform/arm-appplatform/package.json index 048062d2f2ef..5858db62b3c0 100644 --- a/sdk/appplatform/arm-appplatform/package.json +++ b/sdk/appplatform/arm-appplatform/package.json @@ -2,7 +2,7 @@ "name": "@azure/arm-appplatform", "author": "Microsoft Corporation", "description": "AppPlatformManagementClient Library with typescript type definitions for node.js and browser.", - "version": "1.3.0", + "version": "1.4.0", "dependencies": { "@azure/ms-rest-azure-js": "^2.1.0", "@azure/ms-rest-js": "^2.2.0", @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/appplatform/arm-appplatform", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClientContext.ts b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClientContext.ts index 1c6af685d8ac..27e67f0731fd 100644 --- a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClientContext.ts +++ b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClientContext.ts @@ -9,11 +9,11 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-appplatform"; -const packageVersion = "1.3.0"; +const packageVersion = "1.4.0"; export class AppPlatformManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials | TokenCredential; @@ -50,7 +50,7 @@ export class AppPlatformManagementClientContext extends msRestAzure.AzureService super(credentials, options); - this.apiVersion = '2020-11-01-preview'; + this.apiVersion = '2021-06-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/appplatform/arm-appplatform/src/models/appsMappers.ts b/sdk/appplatform/arm-appplatform/src/models/appsMappers.ts index 99e4dea19713..c1543243c627 100644 --- a/sdk/appplatform/arm-appplatform/src/models/appsMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/appsMappers.ts @@ -22,6 +22,7 @@ export { ConfigServerProperties, ConfigServerResource, ConfigServerSettings, + CustomContainer, CustomDomainProperties, CustomDomainResource, CustomDomainValidatePayload, @@ -32,6 +33,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, ManagedIdentityProperties, MonitoringSettingProperties, MonitoringSettingResource, @@ -41,6 +43,7 @@ export { ProxyResource, RequiredTraffic, Resource, + ResourceRequests, ResourceUploadDefinition, ServiceResource, Sku, diff --git a/sdk/appplatform/arm-appplatform/src/models/bindingsMappers.ts b/sdk/appplatform/arm-appplatform/src/models/bindingsMappers.ts index 30588e309be2..a8fef206e095 100644 --- a/sdk/appplatform/arm-appplatform/src/models/bindingsMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/bindingsMappers.ts @@ -22,6 +22,7 @@ export { ConfigServerProperties, ConfigServerResource, ConfigServerSettings, + CustomContainer, CustomDomainProperties, CustomDomainResource, DeploymentInstance, @@ -30,6 +31,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, ManagedIdentityProperties, MonitoringSettingProperties, MonitoringSettingResource, @@ -39,6 +41,7 @@ export { ProxyResource, RequiredTraffic, Resource, + ResourceRequests, ServiceResource, Sku, TemporaryDisk, diff --git a/sdk/appplatform/arm-appplatform/src/models/certificatesMappers.ts b/sdk/appplatform/arm-appplatform/src/models/certificatesMappers.ts index 74a82eb8d30a..f0d9c604020b 100644 --- a/sdk/appplatform/arm-appplatform/src/models/certificatesMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/certificatesMappers.ts @@ -22,6 +22,7 @@ export { ConfigServerProperties, ConfigServerResource, ConfigServerSettings, + CustomContainer, CustomDomainProperties, CustomDomainResource, DeploymentInstance, @@ -30,6 +31,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, ManagedIdentityProperties, MonitoringSettingProperties, MonitoringSettingResource, @@ -39,6 +41,7 @@ export { ProxyResource, RequiredTraffic, Resource, + ResourceRequests, ServiceResource, Sku, TemporaryDisk, diff --git a/sdk/appplatform/arm-appplatform/src/models/configServersMappers.ts b/sdk/appplatform/arm-appplatform/src/models/configServersMappers.ts index a4f7578092d0..4fbb71a816ed 100644 --- a/sdk/appplatform/arm-appplatform/src/models/configServersMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/configServersMappers.ts @@ -23,6 +23,7 @@ export { ConfigServerSettings, ConfigServerSettingsErrorRecord, ConfigServerSettingsValidateResult, + CustomContainer, CustomDomainProperties, CustomDomainResource, DeploymentInstance, @@ -31,6 +32,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, ManagedIdentityProperties, MonitoringSettingProperties, MonitoringSettingResource, @@ -40,6 +42,7 @@ export { ProxyResource, RequiredTraffic, Resource, + ResourceRequests, ServiceResource, Sku, TemporaryDisk, diff --git a/sdk/appplatform/arm-appplatform/src/models/customDomainsMappers.ts b/sdk/appplatform/arm-appplatform/src/models/customDomainsMappers.ts index 02fcb4f36e3d..66d675938524 100644 --- a/sdk/appplatform/arm-appplatform/src/models/customDomainsMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/customDomainsMappers.ts @@ -21,6 +21,7 @@ export { ConfigServerProperties, ConfigServerResource, ConfigServerSettings, + CustomContainer, CustomDomainProperties, CustomDomainResource, CustomDomainResourceCollection, @@ -30,6 +31,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, ManagedIdentityProperties, MonitoringSettingProperties, MonitoringSettingResource, @@ -39,6 +41,7 @@ export { ProxyResource, RequiredTraffic, Resource, + ResourceRequests, ServiceResource, Sku, TemporaryDisk, diff --git a/sdk/appplatform/arm-appplatform/src/models/deploymentsMappers.ts b/sdk/appplatform/arm-appplatform/src/models/deploymentsMappers.ts index 7414c396b7b1..3da0223f88d1 100644 --- a/sdk/appplatform/arm-appplatform/src/models/deploymentsMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/deploymentsMappers.ts @@ -21,6 +21,7 @@ export { ConfigServerProperties, ConfigServerResource, ConfigServerSettings, + CustomContainer, CustomDomainProperties, CustomDomainResource, DeploymentInstance, @@ -30,6 +31,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, LogFileUrlResponse, ManagedIdentityProperties, MonitoringSettingProperties, @@ -40,6 +42,7 @@ export { ProxyResource, RequiredTraffic, Resource, + ResourceRequests, ServiceResource, Sku, TemporaryDisk, diff --git a/sdk/appplatform/arm-appplatform/src/models/index.ts b/sdk/appplatform/arm-appplatform/src/models/index.ts index 221fe440bc9f..542f5caec2d9 100644 --- a/sdk/appplatform/arm-appplatform/src/models/index.ts +++ b/sdk/appplatform/arm-appplatform/src/models/index.ts @@ -120,11 +120,11 @@ export interface ClusterResourceProperties { */ export interface Sku { /** - * Name of the Sku + * Name of the Sku. Default value: 'S0'. */ name?: string; /** - * Tier of the Sku + * Tier of the Sku. Default value: 'Standard'. */ tier?: string; /** @@ -546,10 +546,6 @@ export interface AppResourceProperties { * Indicate if only https is allowed. */ httpsOnly?: boolean; - /** - * Indicate if end to end TLS is enabled. - */ - enableEndToEndTLS?: boolean; /** * Date time when the resource is created * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -563,6 +559,10 @@ export interface AppResourceProperties { * Persistent disk settings */ persistentDisk?: PersistentDisk; + /** + * Indicate if end to end TLS is enabled. + */ + enableEndToEndTLS?: boolean; } /** @@ -798,12 +798,55 @@ export interface CustomDomainValidateResult { message?: string; } +/** + * Credential of the image registry + */ +export interface ImageRegistryCredential { + /** + * The username of the image registry credential + */ + username?: string; + /** + * The password of the image registry credential + */ + password?: string; +} + +/** + * Custom container payload + */ +export interface CustomContainer { + /** + * The name of the registry that contains the container image + */ + server?: string; + /** + * Container image of the custom container. This should be in the form of : + * without the server name of the registry + */ + containerImage?: string; + /** + * Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this + * is not provided. + */ + command?: string[]; + /** + * Arguments to the entrypoint. The docker image's CMD is used if this is not provided. + */ + args?: string[]; + /** + * Credential of the image registry + */ + imageRegistryCredential?: ImageRegistryCredential; +} + /** * Source information for a deployment */ export interface UserSourceInfo { /** - * Type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source' + * Type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source', + * 'Container' */ type?: UserSourceType; /** @@ -820,6 +863,26 @@ export interface UserSourceInfo { * the relative path to the target module/project. */ artifactSelector?: string; + /** + * Custom container payload + */ + customContainer?: CustomContainer; +} + +/** + * Deployment resource request payload + */ +export interface ResourceRequests { + /** + * Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic + * tier, and {500m, 1, 2, 3, 4} for Standard tier. + */ + cpu?: string; + /** + * Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, 2Gi} + * for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier. + */ + memory?: string; } /** @@ -827,15 +890,23 @@ export interface UserSourceInfo { */ export interface DeploymentSettings { /** - * Required CPU, basic tier should be 1, standard tier should be in range (1, 4). Default value: - * 1. + * Required CPU. This should be 1 for Basic tier, and in range [1, 4] for Standard tier. This is + * deprecated starting from API version 2021-06-01-preview. Please use the resourceRequests field + * to set the CPU size. Default value: 1. */ cpu?: number; /** - * Required Memory size in GB, basic tier should be in range (1, 2), standard tier should be in - * range (1, 8). Default value: 1. + * Required Memory size in GB. This should be in range [1, 2] for Basic tier, and in range [1, 8] + * for Standard tier. This is deprecated starting from API version 2021-06-01-preview. Please use + * the resourceRequests field to set the the memory size. Default value: 1. */ memoryInGB?: number; + /** + * The requested resource quantity for required CPU and Memory. It is recommended that using this + * field to represent the required CPU and Memory, the old field cpu and memoryInGB will be + * deprecated later. + */ + resourceRequests?: ResourceRequests; /** * JVM parameter */ @@ -1007,6 +1078,10 @@ export interface MetricDimension { * Localized friendly display name of the dimension */ displayName?: string; + /** + * Whether this dimension should be included for the Shoebox export scenario + */ + toBeExportedForShoebox?: boolean; } /** @@ -1499,11 +1574,11 @@ export type AppResourceProvisioningState = 'Succeeded' | 'Failed' | 'Creating' | /** * Defines values for UserSourceType. - * Possible values include: 'Jar', 'NetCoreZip', 'Source' + * Possible values include: 'Jar', 'NetCoreZip', 'Source', 'Container' * @readonly * @enum {string} */ -export type UserSourceType = 'Jar' | 'NetCoreZip' | 'Source'; +export type UserSourceType = 'Jar' | 'NetCoreZip' | 'Source' | 'Container'; /** * Defines values for RuntimeVersion. diff --git a/sdk/appplatform/arm-appplatform/src/models/mappers.ts b/sdk/appplatform/arm-appplatform/src/models/mappers.ts index d5aea74885fa..c80ead76b135 100644 --- a/sdk/appplatform/arm-appplatform/src/models/mappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/mappers.ts @@ -196,12 +196,14 @@ export const Sku: msRest.CompositeMapper = { modelProperties: { name: { serializedName: "name", + defaultValue: 'S0', type: { name: "String" } }, tier: { serializedName: "tier", + defaultValue: 'Standard', type: { name: "String" } @@ -910,12 +912,6 @@ export const AppResourceProperties: msRest.CompositeMapper = { name: "Boolean" } }, - enableEndToEndTLS: { - serializedName: "enableEndToEndTLS", - type: { - name: "Boolean" - } - }, createdTime: { readOnly: true, serializedName: "createdTime", @@ -936,6 +932,12 @@ export const AppResourceProperties: msRest.CompositeMapper = { name: "Composite", className: "PersistentDisk" } + }, + enableEndToEndTLS: { + serializedName: "enableEndToEndTLS", + type: { + name: "Boolean" + } } } } @@ -1320,6 +1322,79 @@ export const CustomDomainValidateResult: msRest.CompositeMapper = { } }; +export const ImageRegistryCredential: msRest.CompositeMapper = { + serializedName: "ImageRegistryCredential", + type: { + name: "Composite", + className: "ImageRegistryCredential", + modelProperties: { + username: { + serializedName: "username", + type: { + name: "String" + } + }, + password: { + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + +export const CustomContainer: msRest.CompositeMapper = { + serializedName: "CustomContainer", + type: { + name: "Composite", + className: "CustomContainer", + modelProperties: { + server: { + serializedName: "server", + type: { + name: "String" + } + }, + containerImage: { + serializedName: "containerImage", + type: { + name: "String" + } + }, + command: { + serializedName: "command", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + args: { + serializedName: "args", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + imageRegistryCredential: { + serializedName: "imageRegistryCredential", + type: { + name: "Composite", + className: "ImageRegistryCredential" + } + } + } + } +}; + export const UserSourceInfo: msRest.CompositeMapper = { serializedName: "UserSourceInfo", type: { @@ -1349,6 +1424,35 @@ export const UserSourceInfo: msRest.CompositeMapper = { type: { name: "String" } + }, + customContainer: { + serializedName: "customContainer", + type: { + name: "Composite", + className: "CustomContainer" + } + } + } + } +}; + +export const ResourceRequests: msRest.CompositeMapper = { + serializedName: "ResourceRequests", + type: { + name: "Composite", + className: "ResourceRequests", + modelProperties: { + cpu: { + serializedName: "cpu", + type: { + name: "String" + } + }, + memory: { + serializedName: "memory", + type: { + name: "String" + } } } } @@ -1374,6 +1478,13 @@ export const DeploymentSettings: msRest.CompositeMapper = { name: "Number" } }, + resourceRequests: { + serializedName: "resourceRequests", + type: { + name: "Composite", + className: "ResourceRequests" + } + }, jvmOptions: { serializedName: "jvmOptions", type: { @@ -1645,6 +1756,12 @@ export const MetricDimension: msRest.CompositeMapper = { type: { name: "String" } + }, + toBeExportedForShoebox: { + serializedName: "toBeExportedForShoebox", + type: { + name: "Boolean" + } } } } diff --git a/sdk/appplatform/arm-appplatform/src/models/monitoringSettingsMappers.ts b/sdk/appplatform/arm-appplatform/src/models/monitoringSettingsMappers.ts index 0463b1feac36..b827ef84ea79 100644 --- a/sdk/appplatform/arm-appplatform/src/models/monitoringSettingsMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/monitoringSettingsMappers.ts @@ -21,6 +21,7 @@ export { ConfigServerProperties, ConfigServerResource, ConfigServerSettings, + CustomContainer, CustomDomainProperties, CustomDomainResource, DeploymentInstance, @@ -29,6 +30,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, ManagedIdentityProperties, MonitoringSettingProperties, MonitoringSettingResource, @@ -38,6 +40,7 @@ export { ProxyResource, RequiredTraffic, Resource, + ResourceRequests, ServiceResource, Sku, TemporaryDisk, diff --git a/sdk/appplatform/arm-appplatform/src/models/servicesMappers.ts b/sdk/appplatform/arm-appplatform/src/models/servicesMappers.ts index de115949d99c..58194934685e 100644 --- a/sdk/appplatform/arm-appplatform/src/models/servicesMappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/servicesMappers.ts @@ -21,6 +21,7 @@ export { ConfigServerProperties, ConfigServerResource, ConfigServerSettings, + CustomContainer, CustomDomainProperties, CustomDomainResource, DeploymentInstance, @@ -29,6 +30,7 @@ export { DeploymentSettings, ErrorModel, GitPatternRepository, + ImageRegistryCredential, ManagedIdentityProperties, MonitoringSettingProperties, MonitoringSettingResource, @@ -41,6 +43,7 @@ export { RegenerateTestKeyRequestPayload, RequiredTraffic, Resource, + ResourceRequests, ServiceResource, ServiceResourceList, Sku,