diff --git a/sdk/appplatform/arm-appplatform/CHANGELOG.md b/sdk/appplatform/arm-appplatform/CHANGELOG.md index ec1c05c95c8b..5a6b7ebd103a 100644 --- a/sdk/appplatform/arm-appplatform/CHANGELOG.md +++ b/sdk/appplatform/arm-appplatform/CHANGELOG.md @@ -1,18 +1,8 @@ # Release History + +## 2.0.0-beta.4 (2022-03-09) -## 2.0.0-beta.4 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 2.0.0-beta.3 (2022-03-02) - -The package of @azure/arm-appplatform is using our next generation design principles since version 2.0.0-beta.3, which contains breaking changes. +The package of @azure/arm-appplatform is using our next generation design principles since version 2.0.0-beta.4, which contains breaking changes. To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). diff --git a/sdk/appplatform/arm-appplatform/_meta.json b/sdk/appplatform/arm-appplatform/_meta.json index 7033144f4184..d713b7c4a61d 100644 --- a/sdk/appplatform/arm-appplatform/_meta.json +++ b/sdk/appplatform/arm-appplatform/_meta.json @@ -1,7 +1,7 @@ { - "commit": "4042a47cff72c950d35dd72149895b044ed79713", + "commit": "1067b78669466324a1a2666adf053433c61e7f77", "readme": "specification/appplatform/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\appplatform\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.16", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\appplatform\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-beta.16 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "use": "@autorest/typescript@6.0.0-beta.16" } \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/package.json b/sdk/appplatform/arm-appplatform/package.json index 4a74d236f425..e991921b25c1 100644 --- a/sdk/appplatform/arm-appplatform/package.json +++ b/sdk/appplatform/arm-appplatform/package.json @@ -106,5 +106,13 @@ } ] }, - "autoPublish": true + "autoPublish": true, + "//sampleConfiguration": { + "productName": "", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-appplatform?view=azure-node-preview" + } } diff --git a/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md b/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md index c9af9f724440..5fb9cc6cf2a3 100644 --- a/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md +++ b/sdk/appplatform/arm-appplatform/review/arm-appplatform.api.md @@ -1240,6 +1240,7 @@ export interface CustomContainer { command?: string[]; containerImage?: string; imageRegistryCredential?: ImageRegistryCredential; + languageFramework?: string; server?: string; } @@ -2119,6 +2120,10 @@ export enum KnownProvisioningState { // (undocumented) Moving = "Moving", // (undocumented) + Starting = "Starting", + // (undocumented) + Stopping = "Stopping", + // (undocumented) Succeeded = "Succeeded", // (undocumented) Updating = "Updating" @@ -2229,6 +2234,9 @@ export interface ManagedIdentityProperties { principalId?: string; tenantId?: string; type?: ManagedIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedManagedIdentity; + }; } // @public @@ -2956,6 +2964,12 @@ export type UploadedUserSourceInfo = UserSourceInfo & { // @public (undocumented) export type UploadedUserSourceInfoUnion = UploadedUserSourceInfo | JarUploadedUserSourceInfo | SourceUploadedUserSourceInfo | NetCoreZipUploadedUserSourceInfo; +// @public +export interface UserAssignedManagedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface UserSourceInfo { type: "UploadedUserSourceInfo" | "Jar" | "Source" | "NetCoreZip" | "BuildResult" | "Container"; diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..79f2f5ccc8a9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApiPortalCustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the API portal custom domain. + * + * @summary Create or update the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json + */ +async function apiPortalCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const apiPortalCustomDomainResource: ApiPortalCustomDomainResource = { + properties: { thumbprint: "*" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName, + apiPortalCustomDomainResource + ); + console.log(result); +} + +apiPortalCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..53356fd2c799 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the API portal custom domain. + * + * @summary Delete the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json + */ +async function apiPortalCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsGetSample.ts new file mode 100644 index 000000000000..f3850cef0fa7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the API portal custom domain. + * + * @summary Get the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json + */ +async function apiPortalCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.get( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsListSample.ts new file mode 100644 index 000000000000..eabad4c24d0c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalCustomDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all API portal custom domains. + * + * @summary Handle requests to list all API portal custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json + */ +async function apiPortalCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortalCustomDomains.list( + resourceGroupName, + serviceName, + apiPortalName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b5fe4364aa3f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApiPortalResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default API portal or update the existing API portal. + * + * @summary Create the default API portal or update the existing API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json + */ +async function apiPortalsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const apiPortalResource: ApiPortalResource = { + properties: { + gatewayIds: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default" + ], + public: true + }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + apiPortalResource + ); + console.log(result); +} + +apiPortalsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsDeleteSample.ts new file mode 100644 index 000000000000..80ae88d8a03c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the default API portal. + * + * @summary Delete the default API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json + */ +async function apiPortalsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsGetSample.ts new file mode 100644 index 000000000000..f7ab08f1c983 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the API portal and its properties. + * + * @summary Get the API portal and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json + */ +async function apiPortalsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.get( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsListSample.ts new file mode 100644 index 000000000000..11e4525e3bac --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json + */ +async function apiPortalsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortals.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsValidateDomainSample.ts new file mode 100644 index 000000000000..1bfec026b167 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/apiPortalsValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json + */ +async function apiPortalsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.validateDomain( + resourceGroupName, + serviceName, + apiPortalName, + validatePayload + ); + console.log(result); +} + +apiPortalsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b062530b38f6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsCreateOrUpdateSample.ts @@ -0,0 +1,101 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AppResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new App or update an exiting App. + * + * @summary Create a new App or update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json + */ +async function appsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource: AppResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": { + clientId: undefined, + principalId: undefined + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": { + clientId: undefined, + principalId: undefined + } + } + }, + location: "eastus", + properties: { + addonConfigs: { + applicationConfigurationService: { + resourceId: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs" + } + + }, + serviceRegistry: { + resourceId: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry" + } + } + }, + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: ["uid=0", "gid=0", "dir_mode=0777", "file_mode=0777"], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare" + }, + storageId: "myASCStorageID" + } + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + loadedCertificates: [ + { + loadTrustStore: false, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1" + }, + { + loadTrustStore: true, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2" + } + ], + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsDeleteSample.ts new file mode 100644 index 000000000000..920b3db7a2e7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete an App. + * + * @summary Operation to delete an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json + */ +async function appsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName + ); + console.log(result); +} + +appsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsGetResourceUploadUrlSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsGetResourceUploadUrlSample.ts new file mode 100644 index 000000000000..5e66e3e4298b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsGetResourceUploadUrlSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for an App, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json + */ +async function appsGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.getResourceUploadUrl( + resourceGroupName, + serviceName, + appName + ); + console.log(result); +} + +appsGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsGetSample.ts new file mode 100644 index 000000000000..c3bd2d0a9b2d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsGetSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an App and its properties. + * + * @summary Get an App and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json + */ +async function appsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.get(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsListSample.ts new file mode 100644 index 000000000000..8008f13c1edf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json + */ +async function appsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apps.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +appsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsSetActiveDeploymentsSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsSetActiveDeploymentsSample.ts new file mode 100644 index 000000000000..5d8d3632f5ef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsSetActiveDeploymentsSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ActiveDeploymentCollection, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Set existing Deployment under the app as active + * + * @summary Set existing Deployment under the app as active + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json + */ +async function appsSetActiveDeployments() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const activeDeploymentCollection: ActiveDeploymentCollection = { + activeDeploymentNames: ["default"] + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginSetActiveDeploymentsAndWait( + resourceGroupName, + serviceName, + appName, + activeDeploymentCollection + ); + console.log(result); +} + +appsSetActiveDeployments().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsUpdateSample.ts new file mode 100644 index 000000000000..b7832ad3e93f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AppResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting App. + * + * @summary Operation to update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json + */ +async function appsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource: AppResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": { + clientId: undefined, + principalId: undefined + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": { + clientId: undefined, + principalId: undefined + } + } + }, + location: "eastus", + properties: { + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: [], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare" + }, + storageId: "myASCStorageID" + } + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/appsValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/appsValidateDomainSample.ts new file mode 100644 index 000000000000..57ccfc6fe72d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/appsValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the resource name is valid as well as not in use. + * + * @summary Check the resource name is valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json + */ +async function appsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.validateDomain( + resourceGroupName, + serviceName, + appName, + validatePayload + ); + console.log(result); +} + +appsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/bindingsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/bindingsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7b3a0a5eb110 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/bindingsCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Binding or update an exiting Binding. + * + * @summary Create a new Binding or update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json + */ +async function bindingsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource: BindingResource = { + properties: { + bindingParameters: { + apiType: { + name: "SQL" + }, + databaseName: { + name: "db1" + } + }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1", + updatedAt: undefined + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/bindingsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/bindingsDeleteSample.ts new file mode 100644 index 000000000000..291d496c6aa5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/bindingsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Binding. + * + * @summary Operation to delete a Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json + */ +async function bindingsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/bindingsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/bindingsGetSample.ts new file mode 100644 index 000000000000..486acacdd6da --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/bindingsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Binding and its properties. + * + * @summary Get a Binding and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json + */ +async function bindingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.get( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/bindingsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/bindingsListSample.ts new file mode 100644 index 000000000000..54021ded717d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/bindingsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json + */ +async function bindingsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bindings.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +bindingsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/bindingsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/bindingsUpdateSample.ts new file mode 100644 index 000000000000..31af28f30a06 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/bindingsUpdateSample.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Binding. + * + * @summary Operation to update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json + */ +async function bindingsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource: BindingResource = { + properties: { + bindingParameters: { + apiType: { + name: "SQL" + }, + databaseName: { + name: "db1" + } + }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + updatedAt: undefined + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolGetSample.ts new file mode 100644 index 000000000000..844751ab423e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get build service agent pool. + * + * @summary Get build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json + */ +async function buildServiceAgentPoolGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.get( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName + ); + console.log(result); +} + +buildServiceAgentPoolGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolListSample.ts new file mode 100644 index 000000000000..f3942f2d2ca2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List build service agent pool. + * + * @summary List build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json + */ +async function buildServiceAgentPoolList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceAgentPool.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceAgentPoolList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolUpdatePutSample.ts new file mode 100644 index 000000000000..60740254be14 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceAgentPoolUpdatePutSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuildServiceAgentPoolResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update build service agent pool. + * + * @summary Create or update build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json + */ +async function buildServiceAgentPoolUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const agentPoolResource: BuildServiceAgentPoolResource = { + properties: { poolSize: { name: "S3" } } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + agentPoolResource + ); + console.log(result); +} + +buildServiceAgentPoolUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9fd9f2e922e1 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderCreateOrUpdateSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuilderResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a KPack builder. + * + * @summary Create or update a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json + */ +async function buildServiceBuilderCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const builderResource: BuilderResource = { + properties: { + buildpackGroups: [ + { name: "mix", buildpacks: [{ id: "tanzu-buildpacks/java-azure" }] } + ], + stack: { id: "io.buildpacks.stacks.bionic", version: "base" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + builderResource + ); + console.log(result); +} + +buildServiceBuilderCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderDeleteSample.ts new file mode 100644 index 000000000000..a5c149c6519b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a KPack builder. + * + * @summary Delete a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json + */ +async function buildServiceBuilderDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderGetSample.ts new file mode 100644 index 000000000000..b0853f0483d9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack builder. + * + * @summary Get a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json + */ +async function buildServiceBuilderGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderListSample.ts new file mode 100644 index 000000000000..5ffeaee55c0a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceBuilderListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack builders result. + * + * @summary List KPack builders result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json + */ +async function buildServiceBuilderList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceBuilder.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceBuilderList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceCreateOrUpdateBuildSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceCreateOrUpdateBuildSample.ts new file mode 100644 index 000000000000..d291119ad979 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceCreateOrUpdateBuildSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Build, AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a KPack build. + * + * @summary Create or update a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json + */ +async function buildServiceCreateOrUpdateBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const build: Build = { + properties: { + agentPool: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default", + builder: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default", + env: { environmentVariable: "test" }, + relativePath: + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.createOrUpdateBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + build + ); + console.log(result); +} + +buildServiceCreateOrUpdateBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildResultLogSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildResultLogSample.ts new file mode 100644 index 000000000000..0c35bdefbee4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildResultLogSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build result log download URL. + * + * @summary Get a KPack build result log download URL. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json + */ +async function buildServiceGetBuildResultLog() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResultLog( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResultLog().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildResultSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildResultSample.ts new file mode 100644 index 000000000000..2c366f21cff6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildResultSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build result. + * + * @summary Get a KPack build result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json + */ +async function buildServiceGetBuildResult() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResult( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResult().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildSample.ts new file mode 100644 index 000000000000..b29ac5e0cecf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build. + * + * @summary Get a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json + */ +async function buildServiceGetBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName + ); + console.log(result); +} + +buildServiceGetBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildServiceSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildServiceSample.ts new file mode 100644 index 000000000000..f1db49f92e6e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetBuildServiceSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a build service resource. + * + * @summary Get a build service resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json + */ +async function buildServiceGetBuildService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildService( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetBuildService().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetResourceUploadUrlSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetResourceUploadUrlSample.ts new file mode 100644 index 000000000000..89243d370192 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetResourceUploadUrlSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for build service, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json + */ +async function buildServiceGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getResourceUploadUrl( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetSupportedBuildpackSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetSupportedBuildpackSample.ts new file mode 100644 index 000000000000..1a8f66c2b0c7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetSupportedBuildpackSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the supported buildpack resource. + * + * @summary Get the supported buildpack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json + */ +async function buildServiceGetSupportedBuildpack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildpackName = "tanzu-buildpacks-java-azure"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedBuildpack( + resourceGroupName, + serviceName, + buildServiceName, + buildpackName + ); + console.log(result); +} + +buildServiceGetSupportedBuildpack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetSupportedStackSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetSupportedStackSample.ts new file mode 100644 index 000000000000..c897a5e0467d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceGetSupportedStackSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the supported stack resource. + * + * @summary Get the supported stack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json + */ +async function buildServiceGetSupportedStack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const stackName = "io.buildpacks.stacks.bionic-base"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedStack( + resourceGroupName, + serviceName, + buildServiceName, + stackName + ); + console.log(result); +} + +buildServiceGetSupportedStack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildResultsSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildResultsSample.ts new file mode 100644 index 000000000000..999666a73cd4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildResultsSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack build results. + * + * @summary List KPack build results. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json + */ +async function buildServiceListBuildResults() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildResults( + resourceGroupName, + serviceName, + buildServiceName, + buildName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildResults().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildServicesSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildServicesSample.ts new file mode 100644 index 000000000000..30543425b720 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildServicesSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List build services resource. + * + * @summary List build services resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json + */ +async function buildServiceListBuildServices() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildServices( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildServices().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildsSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildsSample.ts new file mode 100644 index 000000000000..6c9ca0f68887 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListBuildsSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack builds. + * + * @summary List KPack builds. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json + */ +async function buildServiceListBuilds() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuilds( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuilds().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListSupportedBuildpacksSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListSupportedBuildpacksSample.ts new file mode 100644 index 000000000000..1327dde3c966 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListSupportedBuildpacksSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get all supported buildpacks. + * + * @summary Get all supported buildpacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json + */ +async function buildServiceListSupportedBuildpacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedBuildpacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedBuildpacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListSupportedStacksSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListSupportedStacksSample.ts new file mode 100644 index 000000000000..40f88fa94e80 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildServiceListSupportedStacksSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get all supported stacks. + * + * @summary Get all supported stacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json + */ +async function buildServiceListSupportedStacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedStacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedStacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingCreateOrUpdateSample.ts new file mode 100644 index 000000000000..12ef67660337 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuildpackBindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a buildpack binding. + * + * @summary Create or update a buildpack binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json + */ +async function buildpackBindingCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const buildpackBinding: BuildpackBindingResource = { + properties: { + bindingType: "ApplicationInsights", + launchProperties: { + properties: { + abc: "def", + anyString: "any-string", + samplingRate: "12.0" + }, + secrets: { + connectionString: + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding + ); + console.log(result); +} + +buildpackBindingCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingDeleteSample.ts new file mode 100644 index 000000000000..3dcb2b246e74 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Buildpack Binding + * + * @summary Operation to delete a Buildpack Binding + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json + */ +async function buildpackBindingDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingGetSample.ts new file mode 100644 index 000000000000..a31bae78936c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingGetSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a buildpack binding by name. + * + * @summary Get a buildpack binding by name. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingListSample.ts new file mode 100644 index 000000000000..e951e71bb253 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/buildpackBindingListSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all buildpack bindings in a builder. + * + * @summary Handles requests to list all buildpack bindings in a builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildpackBinding.list( + resourceGroupName, + serviceName, + buildServiceName, + builderName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/certificatesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/certificatesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f25bf7117c35 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/certificatesCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CertificateResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update certificate resource. + * + * @summary Create or update certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json + */ +async function certificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const certificateResource: CertificateResource = { + properties: { + type: "KeyVaultCertificate", + certVersion: "08a219d06d874795a96db47e06fbb01e", + keyVaultCertName: "mycert", + vaultUri: "https://myvault.vault.azure.net" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + certificateName, + certificateResource + ); + console.log(result); +} + +certificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/certificatesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/certificatesDeleteSample.ts new file mode 100644 index 000000000000..7db1c9877424 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/certificatesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the certificate resource. + * + * @summary Delete the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json + */ +async function certificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginDeleteAndWait( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/certificatesGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/certificatesGetSample.ts new file mode 100644 index 000000000000..8ab5b74ef97d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/certificatesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the certificate resource. + * + * @summary Get the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json + */ +async function certificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.get( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/certificatesListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/certificatesListSample.ts new file mode 100644 index 000000000000..da1d6022277e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/certificatesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all the certificates of one user. + * + * @summary List all the certificates of one user. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json + */ +async function certificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.certificates.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +certificatesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configServersGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configServersGetSample.ts new file mode 100644 index 000000000000..71621a915cb9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configServersGetSample.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the config server and its properties. + * + * @summary Get the config server and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json + */ +async function configServersGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.get(resourceGroupName, serviceName); + console.log(result); +} + +configServersGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configServersUpdatePatchSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configServersUpdatePatchSample.ts new file mode 100644 index 000000000000..fc87b6343931 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configServersUpdatePatchSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json + */ +async function configServersUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource: ConfigServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configServersUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configServersUpdatePutSample.ts new file mode 100644 index 000000000000..4bfd37686cfa --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configServersUpdatePutSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json + */ +async function configServersUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource: ConfigServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configServersValidateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configServersValidateSample.ts new file mode 100644 index 000000000000..6262cea8e5a0 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configServersValidateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerSettings, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if the config server settings are valid. + * + * @summary Check if the config server settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json + */ +async function configServersValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerSettings: ConfigServerSettings = { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginValidateAndWait( + resourceGroupName, + serviceName, + configServerSettings + ); + console.log(result); +} + +configServersValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f116ea415312 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigurationServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @summary Create the default Application Configuration Service or update the existing Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json + */ +async function configurationServicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const configurationServiceResource: ConfigurationServiceResource = { + properties: { + settings: { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository" + } + ] + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource + ); + console.log(result); +} + +configurationServicesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesDeleteSample.ts new file mode 100644 index 000000000000..8d65fa2afdb8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Application Configuration Service. + * + * @summary Disable the default Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json + */ +async function configurationServicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginDeleteAndWait( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesGetSample.ts new file mode 100644 index 000000000000..e66b0136e79f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Application Configuration Service and its properties. + * + * @summary Get the Application Configuration Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json + */ +async function configurationServicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.get( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesListSample.ts new file mode 100644 index 000000000000..7f2ddb25d9c2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json + */ +async function configurationServicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.configurationServices.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +configurationServicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesValidateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesValidateSample.ts new file mode 100644 index 000000000000..5b2328e2ed29 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/configurationServicesValidateSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigurationServiceSettings, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if the Application Configuration Service settings are valid. + * + * @summary Check if the Application Configuration Service settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json + */ +async function configurationServicesValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const settings: ConfigurationServiceSettings = { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginValidateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + settings + ); + console.log(result); +} + +configurationServicesValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/customDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7eed0cd3c7fe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update custom domain of one lifecycle application. + * + * @summary Create or update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json + */ +async function customDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource: CustomDomainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/customDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsDeleteSample.ts new file mode 100644 index 000000000000..cba07e81cbcd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the custom domain of one lifecycle application. + * + * @summary Delete the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json + */ +async function customDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/customDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsGetSample.ts new file mode 100644 index 000000000000..d244db1582bc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the custom domain of one lifecycle application. + * + * @summary Get the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json + */ +async function customDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.get( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/customDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsListSample.ts new file mode 100644 index 000000000000..c950368ef7c8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the custom domains of one lifecycle application. + * + * @summary List the custom domains of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json + */ +async function customDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.customDomains.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +customDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/customDomainsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsUpdateSample.ts new file mode 100644 index 000000000000..f4fbc2f6dbfe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/customDomainsUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update custom domain of one lifecycle application. + * + * @summary Update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json + */ +async function customDomainsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource: CustomDomainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..76a028ac199d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsCreateOrUpdateSample.ts @@ -0,0 +1,114 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DeploymentResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json + */ +async function deploymentsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + deploymentSettings: { + addonConfigs: { + applicationConfigurationService: { + patterns: { + name: ["mypattern"] + } + } + }, + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" } + }, + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0" + } + }, + sku: { name: "S0", capacity: 1, tier: "Standard" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json + */ +async function deploymentsCreateOrUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + deploymentSettings: { + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" } + }, + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myContainerImage:v1", + imageRegistryCredential: { + password: "myPassword", + username: "myUsername" + }, + languageFramework: "springboot", + server: "myacr.azurecr.io" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsDeleteSample.ts new file mode 100644 index 000000000000..f39c17972300 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Deployment. + * + * @summary Operation to delete a Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json + */ +async function deploymentsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGenerateHeapDumpSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGenerateHeapDumpSample.ts new file mode 100644 index 000000000000..c759bbbe0cc9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGenerateHeapDumpSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generate Heap Dump + * + * @summary Generate Heap Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateHeapDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGenerateThreadDumpSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGenerateThreadDumpSample.ts new file mode 100644 index 000000000000..57fc3c7ae66b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGenerateThreadDumpSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generate Thread Dump + * + * @summary Generate Thread Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateThreadDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGetLogFileUrlSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGetLogFileUrlSample.ts new file mode 100644 index 000000000000..bfce5700d2dd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGetLogFileUrlSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get deployment log file URL + * + * @summary Get deployment log file URL + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json + */ +async function deploymentsGetLogFileUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.getLogFileUrl( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetLogFileUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGetSample.ts new file mode 100644 index 000000000000..bd658b648e98 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsGetSample.ts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json + */ +async function deploymentsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGet().catch(console.error); + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get_CustomContainer.json + */ +async function deploymentsGetCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsListForClusterSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsListForClusterSample.ts new file mode 100644 index 000000000000..bb04c2847be5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsListForClusterSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List deployments for a certain service + * + * @summary List deployments for a certain service + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json + */ +async function deploymentsListForCluster() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.listForCluster( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsListForCluster().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsListSample.ts new file mode 100644 index 000000000000..aa950eed396f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json + */ +async function deploymentsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsRestartSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsRestartSample.ts new file mode 100644 index 000000000000..07493d014386 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsRestartSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restart the deployment. + * + * @summary Restart the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json + */ +async function deploymentsRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginRestartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsRestart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStartJfrSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStartJfrSample.ts new file mode 100644 index 000000000000..35e6b3e2f8ab --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStartJfrSample.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start JFR + * + * @summary Start JFR + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json + */ +async function deploymentsStartJfr() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + duration: "60s", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartJFRAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsStartJfr().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStartSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStartSample.ts new file mode 100644 index 000000000000..ec8f56ffe3ff --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStartSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start the deployment. + * + * @summary Start the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json + */ +async function deploymentsStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStopSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStopSample.ts new file mode 100644 index 000000000000..24a9fd9a03c1 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsStopSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop the deployment. + * + * @summary Stop the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json + */ +async function deploymentsStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStopAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/deploymentsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsUpdateSample.ts new file mode 100644 index 000000000000..ad32420f9caf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/deploymentsUpdateSample.ts @@ -0,0 +1,97 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DeploymentResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json + */ +async function deploymentsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdate().catch(console.error); + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update_CustomContainer.json + */ +async function deploymentsUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myNewContainerImage:v1", + imageRegistryCredential: { + password: "", + username: "myNewUsername" + }, + server: "mynewacr.azurecr.io" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9fdc049cfe21 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayCustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the Spring Cloud Gateway custom domain. + * + * @summary Create or update the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json + */ +async function gatewayCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const gatewayCustomDomainResource: GatewayCustomDomainResource = { + properties: { thumbprint: "*" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName, + gatewayCustomDomainResource + ); + console.log(result); +} + +gatewayCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..857cdac7ecec --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway custom domain. + * + * @summary Delete the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json + */ +async function gatewayCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsGetSample.ts new file mode 100644 index 000000000000..b2d1e9a59889 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway custom domain. + * + * @summary Get the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json + */ +async function gatewayCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.get( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsListSample.ts new file mode 100644 index 000000000000..00fd3ad2f5e2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayCustomDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway custom domains. + * + * @summary Handle requests to list all Spring Cloud Gateway custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json + */ +async function gatewayCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayCustomDomains.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..88ac2615cf9b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayRouteConfigResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @summary Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json + */ +async function gatewayRouteConfigsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const gatewayRouteConfigResource: GatewayRouteConfigResource = { + properties: { + appResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp", + routes: [ + { + filters: ["StripPrefix=2", "RateLimit=1,1s"], + predicates: ["Path=/api5/customer/**"], + ssoEnabled: true, + title: "myApp route config" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + gatewayRouteConfigResource + ); + console.log(result); +} + +gatewayRouteConfigsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsDeleteSample.ts new file mode 100644 index 000000000000..5f973acfb703 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway route config. + * + * @summary Delete the Spring Cloud Gateway route config. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json + */ +async function gatewayRouteConfigsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsGetSample.ts new file mode 100644 index 000000000000..022ec6d0935f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway route configs. + * + * @summary Get the Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json + */ +async function gatewayRouteConfigsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.get( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsListSample.ts new file mode 100644 index 000000000000..9dd386692c90 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewayRouteConfigsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway route configs. + * + * @summary Handle requests to list all Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json + */ +async function gatewayRouteConfigsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayRouteConfigs.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayRouteConfigsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewaysCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8e710655cd82 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysCreateOrUpdateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @summary Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json + */ +async function gatewaysCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const gatewayResource: GatewayResource = { + properties: { public: true, resourceRequests: { cpu: "1", memory: "1G" } }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + gatewayResource + ); + console.log(result); +} + +gatewaysCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewaysDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysDeleteSample.ts new file mode 100644 index 000000000000..47b1e99706c2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Spring Cloud Gateway. + * + * @summary Disable the default Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json + */ +async function gatewaysDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewaysGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysGetSample.ts new file mode 100644 index 000000000000..b9c4aaa5bd35 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway and its properties. + * + * @summary Get the Spring Cloud Gateway and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json + */ +async function gatewaysGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.get( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewaysListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysListSample.ts new file mode 100644 index 000000000000..037edc040095 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json + */ +async function gatewaysList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gateways.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +gatewaysList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/gatewaysValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysValidateDomainSample.ts new file mode 100644 index 000000000000..2b3c3fb51905 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/gatewaysValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json + */ +async function gatewaysValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.validateDomain( + resourceGroupName, + serviceName, + gatewayName, + validatePayload + ); + console.log(result); +} + +gatewaysValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsGetSample.ts new file mode 100644 index 000000000000..6e1e97242b05 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Monitoring Setting and its properties. + * + * @summary Get the Monitoring Setting and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json + */ +async function monitoringSettingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.get( + resourceGroupName, + serviceName + ); + console.log(result); +} + +monitoringSettingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsUpdatePatchSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsUpdatePatchSample.ts new file mode 100644 index 000000000000..a0e8ec0e5c37 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsUpdatePatchSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MonitoringSettingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json + */ +async function monitoringSettingsUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource: MonitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsUpdatePutSample.ts new file mode 100644 index 000000000000..da94a4ed4bef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/monitoringSettingsUpdatePutSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MonitoringSettingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json + */ +async function monitoringSettingsUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource: MonitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/operationsListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..cb8183f68b16 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/runtimeVersionsListRuntimeVersionsSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/runtimeVersionsListRuntimeVersionsSample.ts new file mode 100644 index 000000000000..232decc28d89 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/runtimeVersionsListRuntimeVersionsSample.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @summary Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json + */ +async function runtimeVersionsListRuntimeVersions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.runtimeVersions.listRuntimeVersions(); + console.log(result); +} + +runtimeVersionsListRuntimeVersions().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..89cfc1eb1289 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesCreateOrUpdateSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Service Registry or update the existing Service Registry. + * + * @summary Create the default Service Registry or update the existing Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json + */ +async function serviceRegistriesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesDeleteSample.ts new file mode 100644 index 000000000000..7777e2649892 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Service Registry. + * + * @summary Disable the default Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json + */ +async function serviceRegistriesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginDeleteAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesGetSample.ts new file mode 100644 index 000000000000..8e2c5b28bdc9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Service Registry and its properties. + * + * @summary Get the Service Registry and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json + */ +async function serviceRegistriesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.get( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesListSample.ts new file mode 100644 index 000000000000..3194e4603279 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/serviceRegistriesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json + */ +async function serviceRegistriesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.serviceRegistries.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +serviceRegistriesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesCheckNameAvailabilitySample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..e5a0b6d4d875 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesCheckNameAvailabilitySample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + NameAvailabilityParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json + */ +async function servicesCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const availabilityParameters: NameAvailabilityParameters = { + name: "myservice", + type: "Microsoft.AppPlatform/Spring" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.checkNameAvailability( + location, + availabilityParameters + ); + console.log(result); +} + +servicesCheckNameAvailability().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ba959e2e0685 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesCreateOrUpdateSample.ts @@ -0,0 +1,81 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json + */ +async function servicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json + */ +async function servicesCreateOrUpdateVNetInjection() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: { + networkProfile: { + appNetworkResourceGroup: "my-app-network-rg", + appSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps", + serviceCidr: "10.8.0.0/16,10.244.0.0/16,10.245.0.1/16", + serviceRuntimeNetworkResourceGroup: "my-service-runtime-network-rg", + serviceRuntimeSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime" + } + }, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdateVNetInjection().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesDeleteSample.ts new file mode 100644 index 000000000000..cec8f52a524e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Service. + * + * @summary Operation to delete a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json + */ +async function servicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginDeleteAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesDisableTestEndpointSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesDisableTestEndpointSample.ts new file mode 100644 index 000000000000..85ac01c403fc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesDisableTestEndpointSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable test endpoint functionality for a Service. + * + * @summary Disable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json + */ +async function servicesDisableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.disableTestEndpoint( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesDisableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesEnableTestEndpointSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesEnableTestEndpointSample.ts new file mode 100644 index 000000000000..f00ea74e8464 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesEnableTestEndpointSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Enable test endpoint functionality for a Service. + * + * @summary Enable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json + */ +async function servicesEnableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.enableTestEndpoint( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesEnableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesGetSample.ts new file mode 100644 index 000000000000..5dbe592a0ecd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesGetSample.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Service and its properties. + * + * @summary Get a Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json + */ +async function servicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.get(resourceGroupName, serviceName); + console.log(result); +} + +servicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesListBySubscriptionSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesListBySubscriptionSample.ts new file mode 100644 index 000000000000..994fda4e5fa4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json + */ +async function servicesListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +servicesListBySubscription().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesListSample.ts new file mode 100644 index 000000000000..b1dfae56602c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesListSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json + */ +async function servicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +servicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesListTestKeysSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesListTestKeysSample.ts new file mode 100644 index 000000000000..9ab4ed1af0f2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesListTestKeysSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List test keys for a Service. + * + * @summary List test keys for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json + */ +async function servicesListTestKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.listTestKeys( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesListTestKeys().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesRegenerateTestKeySample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesRegenerateTestKeySample.ts new file mode 100644 index 000000000000..7cefb695c7bc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesRegenerateTestKeySample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RegenerateTestKeyRequestPayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Regenerate a test key for a Service. + * + * @summary Regenerate a test key for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json + */ +async function servicesRegenerateTestKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const regenerateTestKeyRequest: RegenerateTestKeyRequestPayload = { + keyType: "Primary" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.regenerateTestKey( + resourceGroupName, + serviceName, + regenerateTestKeyRequest + ); + console.log(result); +} + +servicesRegenerateTestKey().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesStartSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesStartSample.ts new file mode 100644 index 000000000000..05a7cacc4767 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesStartSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start a Service. + * + * @summary Start a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json + */ +async function servicesStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStartAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesStopSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesStopSample.ts new file mode 100644 index 000000000000..3bd4b6495977 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesStopSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop a Service. + * + * @summary Stop a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json + */ +async function servicesStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStopAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/servicesUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/servicesUpdateSample.ts new file mode 100644 index 000000000000..d989c2a742ef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/servicesUpdateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Service. + * + * @summary Operation to update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json + */ +async function servicesUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/skusListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/skusListSample.ts new file mode 100644 index 000000000000..8eb9edda85db --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/skusListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available skus of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json + */ +async function skusList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.skus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +skusList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/storagesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/storagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..485e96fb0705 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/storagesCreateOrUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update storage resource. + * + * @summary Create or update storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json + */ +async function storagesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const storageResource: StorageResource = { + properties: { + accountKey: "account-key-of-storage-account", + accountName: "storage-account-name", + storageType: "StorageAccount" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + storageName, + storageResource + ); + console.log(result); +} + +storagesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/storagesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/storagesDeleteSample.ts new file mode 100644 index 000000000000..7c98f959e31d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/storagesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the storage resource. + * + * @summary Delete the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json + */ +async function storagesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginDeleteAndWait( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/storagesGetSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/storagesGetSample.ts new file mode 100644 index 000000000000..ea9e5d32550c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/storagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the storage resource. + * + * @summary Get the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json + */ +async function storagesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.get( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples-dev/storagesListSample.ts b/sdk/appplatform/arm-appplatform/samples-dev/storagesListSample.ts new file mode 100644 index 000000000000..6c6a99170421 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples-dev/storagesListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all the storages of one Azure Spring Cloud instance. + * + * @summary List all the storages of one Azure Spring Cloud instance. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json + */ +async function storagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storages.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +storagesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/README.md b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/README.md new file mode 100644 index 000000000000..e675d9e387d7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/README.md @@ -0,0 +1,282 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [apiPortalCustomDomainsCreateOrUpdateSample.js][apiportalcustomdomainscreateorupdatesample] | Create or update the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json | +| [apiPortalCustomDomainsDeleteSample.js][apiportalcustomdomainsdeletesample] | Delete the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json | +| [apiPortalCustomDomainsGetSample.js][apiportalcustomdomainsgetsample] | Get the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json | +| [apiPortalCustomDomainsListSample.js][apiportalcustomdomainslistsample] | Handle requests to list all API portal custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json | +| [apiPortalsCreateOrUpdateSample.js][apiportalscreateorupdatesample] | Create the default API portal or update the existing API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json | +| [apiPortalsDeleteSample.js][apiportalsdeletesample] | Delete the default API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json | +| [apiPortalsGetSample.js][apiportalsgetsample] | Get the API portal and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json | +| [apiPortalsListSample.js][apiportalslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json | +| [apiPortalsValidateDomainSample.js][apiportalsvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json | +| [appsCreateOrUpdateSample.js][appscreateorupdatesample] | Create a new App or update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json | +| [appsDeleteSample.js][appsdeletesample] | Operation to delete an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json | +| [appsGetResourceUploadUrlSample.js][appsgetresourceuploadurlsample] | Get an resource upload URL for an App, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json | +| [appsGetSample.js][appsgetsample] | Get an App and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json | +| [appsListSample.js][appslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json | +| [appsSetActiveDeploymentsSample.js][appssetactivedeploymentssample] | Set existing Deployment under the app as active x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json | +| [appsUpdateSample.js][appsupdatesample] | Operation to update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json | +| [appsValidateDomainSample.js][appsvalidatedomainsample] | Check the resource name is valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json | +| [bindingsCreateOrUpdateSample.js][bindingscreateorupdatesample] | Create a new Binding or update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json | +| [bindingsDeleteSample.js][bindingsdeletesample] | Operation to delete a Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json | +| [bindingsGetSample.js][bindingsgetsample] | Get a Binding and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json | +| [bindingsListSample.js][bindingslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json | +| [bindingsUpdateSample.js][bindingsupdatesample] | Operation to update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json | +| [buildServiceAgentPoolGetSample.js][buildserviceagentpoolgetsample] | Get build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json | +| [buildServiceAgentPoolListSample.js][buildserviceagentpoollistsample] | List build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json | +| [buildServiceAgentPoolUpdatePutSample.js][buildserviceagentpoolupdateputsample] | Create or update build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json | +| [buildServiceBuilderCreateOrUpdateSample.js][buildservicebuildercreateorupdatesample] | Create or update a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json | +| [buildServiceBuilderDeleteSample.js][buildservicebuilderdeletesample] | Delete a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json | +| [buildServiceBuilderGetSample.js][buildservicebuildergetsample] | Get a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json | +| [buildServiceBuilderListSample.js][buildservicebuilderlistsample] | List KPack builders result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json | +| [buildServiceCreateOrUpdateBuildSample.js][buildservicecreateorupdatebuildsample] | Create or update a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json | +| [buildServiceGetBuildResultLogSample.js][buildservicegetbuildresultlogsample] | Get a KPack build result log download URL. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json | +| [buildServiceGetBuildResultSample.js][buildservicegetbuildresultsample] | Get a KPack build result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json | +| [buildServiceGetBuildSample.js][buildservicegetbuildsample] | Get a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json | +| [buildServiceGetBuildServiceSample.js][buildservicegetbuildservicesample] | Get a build service resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json | +| [buildServiceGetResourceUploadUrlSample.js][buildservicegetresourceuploadurlsample] | Get an resource upload URL for build service, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json | +| [buildServiceGetSupportedBuildpackSample.js][buildservicegetsupportedbuildpacksample] | Get the supported buildpack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json | +| [buildServiceGetSupportedStackSample.js][buildservicegetsupportedstacksample] | Get the supported stack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json | +| [buildServiceListBuildResultsSample.js][buildservicelistbuildresultssample] | List KPack build results. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json | +| [buildServiceListBuildServicesSample.js][buildservicelistbuildservicessample] | List build services resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json | +| [buildServiceListBuildsSample.js][buildservicelistbuildssample] | List KPack builds. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json | +| [buildServiceListSupportedBuildpacksSample.js][buildservicelistsupportedbuildpackssample] | Get all supported buildpacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json | +| [buildServiceListSupportedStacksSample.js][buildservicelistsupportedstackssample] | Get all supported stacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json | +| [buildpackBindingCreateOrUpdateSample.js][buildpackbindingcreateorupdatesample] | Create or update a buildpack binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json | +| [buildpackBindingDeleteSample.js][buildpackbindingdeletesample] | Operation to delete a Buildpack Binding x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json | +| [buildpackBindingGetSample.js][buildpackbindinggetsample] | Get a buildpack binding by name. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json | +| [buildpackBindingListSample.js][buildpackbindinglistsample] | Handles requests to list all buildpack bindings in a builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json | +| [certificatesCreateOrUpdateSample.js][certificatescreateorupdatesample] | Create or update certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json | +| [certificatesDeleteSample.js][certificatesdeletesample] | Delete the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json | +| [certificatesGetSample.js][certificatesgetsample] | Get the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json | +| [certificatesListSample.js][certificateslistsample] | List all the certificates of one user. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json | +| [configServersGetSample.js][configserversgetsample] | Get the config server and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json | +| [configServersUpdatePatchSample.js][configserversupdatepatchsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json | +| [configServersUpdatePutSample.js][configserversupdateputsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json | +| [configServersValidateSample.js][configserversvalidatesample] | Check if the config server settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json | +| [configurationServicesCreateOrUpdateSample.js][configurationservicescreateorupdatesample] | Create the default Application Configuration Service or update the existing Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json | +| [configurationServicesDeleteSample.js][configurationservicesdeletesample] | Disable the default Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json | +| [configurationServicesGetSample.js][configurationservicesgetsample] | Get the Application Configuration Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json | +| [configurationServicesListSample.js][configurationserviceslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json | +| [configurationServicesValidateSample.js][configurationservicesvalidatesample] | Check if the Application Configuration Service settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json | +| [customDomainsCreateOrUpdateSample.js][customdomainscreateorupdatesample] | Create or update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json | +| [customDomainsDeleteSample.js][customdomainsdeletesample] | Delete the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json | +| [customDomainsGetSample.js][customdomainsgetsample] | Get the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json | +| [customDomainsListSample.js][customdomainslistsample] | List the custom domains of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json | +| [customDomainsUpdateSample.js][customdomainsupdatesample] | Update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json | +| [deploymentsCreateOrUpdateSample.js][deploymentscreateorupdatesample] | Create a new Deployment or update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json | +| [deploymentsDeleteSample.js][deploymentsdeletesample] | Operation to delete a Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json | +| [deploymentsGenerateHeapDumpSample.js][deploymentsgenerateheapdumpsample] | Generate Heap Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json | +| [deploymentsGenerateThreadDumpSample.js][deploymentsgeneratethreaddumpsample] | Generate Thread Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json | +| [deploymentsGetLogFileUrlSample.js][deploymentsgetlogfileurlsample] | Get deployment log file URL x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json | +| [deploymentsGetSample.js][deploymentsgetsample] | Get a Deployment and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json | +| [deploymentsListForClusterSample.js][deploymentslistforclustersample] | List deployments for a certain service x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json | +| [deploymentsListSample.js][deploymentslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json | +| [deploymentsRestartSample.js][deploymentsrestartsample] | Restart the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json | +| [deploymentsStartJfrSample.js][deploymentsstartjfrsample] | Start JFR x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json | +| [deploymentsStartSample.js][deploymentsstartsample] | Start the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json | +| [deploymentsStopSample.js][deploymentsstopsample] | Stop the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json | +| [deploymentsUpdateSample.js][deploymentsupdatesample] | Operation to update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json | +| [gatewayCustomDomainsCreateOrUpdateSample.js][gatewaycustomdomainscreateorupdatesample] | Create or update the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json | +| [gatewayCustomDomainsDeleteSample.js][gatewaycustomdomainsdeletesample] | Delete the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json | +| [gatewayCustomDomainsGetSample.js][gatewaycustomdomainsgetsample] | Get the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json | +| [gatewayCustomDomainsListSample.js][gatewaycustomdomainslistsample] | Handle requests to list all Spring Cloud Gateway custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json | +| [gatewayRouteConfigsCreateOrUpdateSample.js][gatewayrouteconfigscreateorupdatesample] | Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json | +| [gatewayRouteConfigsDeleteSample.js][gatewayrouteconfigsdeletesample] | Delete the Spring Cloud Gateway route config. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json | +| [gatewayRouteConfigsGetSample.js][gatewayrouteconfigsgetsample] | Get the Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json | +| [gatewayRouteConfigsListSample.js][gatewayrouteconfigslistsample] | Handle requests to list all Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json | +| [gatewaysCreateOrUpdateSample.js][gatewayscreateorupdatesample] | Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json | +| [gatewaysDeleteSample.js][gatewaysdeletesample] | Disable the default Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json | +| [gatewaysGetSample.js][gatewaysgetsample] | Get the Spring Cloud Gateway and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json | +| [gatewaysListSample.js][gatewayslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json | +| [gatewaysValidateDomainSample.js][gatewaysvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json | +| [monitoringSettingsGetSample.js][monitoringsettingsgetsample] | Get the Monitoring Setting and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json | +| [monitoringSettingsUpdatePatchSample.js][monitoringsettingsupdatepatchsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json | +| [monitoringSettingsUpdatePutSample.js][monitoringsettingsupdateputsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json | +| [runtimeVersionsListRuntimeVersionsSample.js][runtimeversionslistruntimeversionssample] | Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json | +| [serviceRegistriesCreateOrUpdateSample.js][serviceregistriescreateorupdatesample] | Create the default Service Registry or update the existing Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json | +| [serviceRegistriesDeleteSample.js][serviceregistriesdeletesample] | Disable the default Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json | +| [serviceRegistriesGetSample.js][serviceregistriesgetsample] | Get the Service Registry and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json | +| [serviceRegistriesListSample.js][serviceregistrieslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json | +| [servicesCheckNameAvailabilitySample.js][serviceschecknameavailabilitysample] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json | +| [servicesCreateOrUpdateSample.js][servicescreateorupdatesample] | Create a new Service or update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json | +| [servicesDeleteSample.js][servicesdeletesample] | Operation to delete a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json | +| [servicesDisableTestEndpointSample.js][servicesdisabletestendpointsample] | Disable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json | +| [servicesEnableTestEndpointSample.js][servicesenabletestendpointsample] | Enable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json | +| [servicesGetSample.js][servicesgetsample] | Get a Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json | +| [servicesListBySubscriptionSample.js][serviceslistbysubscriptionsample] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json | +| [servicesListSample.js][serviceslistsample] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json | +| [servicesListTestKeysSample.js][serviceslisttestkeyssample] | List test keys for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json | +| [servicesRegenerateTestKeySample.js][servicesregeneratetestkeysample] | Regenerate a test key for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json | +| [servicesStartSample.js][servicesstartsample] | Start a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json | +| [servicesStopSample.js][servicesstopsample] | Stop a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json | +| [servicesUpdateSample.js][servicesupdatesample] | Operation to update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json | +| [skusListSample.js][skuslistsample] | Lists all of the available skus of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json | +| [storagesCreateOrUpdateSample.js][storagescreateorupdatesample] | Create or update storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json | +| [storagesDeleteSample.js][storagesdeletesample] | Delete the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json | +| [storagesGetSample.js][storagesgetsample] | Get the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json | +| [storagesListSample.js][storageslistsample] | List all the storages of one Azure Spring Cloud instance. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[apiportalcustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js +[apiportalcustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsDeleteSample.js +[apiportalcustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsGetSample.js +[apiportalcustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsListSample.js +[apiportalscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsCreateOrUpdateSample.js +[apiportalsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsDeleteSample.js +[apiportalsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsGetSample.js +[apiportalslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsListSample.js +[apiportalsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsValidateDomainSample.js +[appscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsCreateOrUpdateSample.js +[appsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsDeleteSample.js +[appsgetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetResourceUploadUrlSample.js +[appsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetSample.js +[appslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsListSample.js +[appssetactivedeploymentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsSetActiveDeploymentsSample.js +[appsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsUpdateSample.js +[appsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsValidateDomainSample.js +[bindingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsCreateOrUpdateSample.js +[bindingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsDeleteSample.js +[bindingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsGetSample.js +[bindingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsListSample.js +[bindingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsUpdateSample.js +[buildserviceagentpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolGetSample.js +[buildserviceagentpoollistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolListSample.js +[buildserviceagentpoolupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolUpdatePutSample.js +[buildservicebuildercreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js +[buildservicebuilderdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderDeleteSample.js +[buildservicebuildergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderGetSample.js +[buildservicebuilderlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderListSample.js +[buildservicecreateorupdatebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceCreateOrUpdateBuildSample.js +[buildservicegetbuildresultlogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultLogSample.js +[buildservicegetbuildresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultSample.js +[buildservicegetbuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildSample.js +[buildservicegetbuildservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildServiceSample.js +[buildservicegetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetResourceUploadUrlSample.js +[buildservicegetsupportedbuildpacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedBuildpackSample.js +[buildservicegetsupportedstacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedStackSample.js +[buildservicelistbuildresultssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildResultsSample.js +[buildservicelistbuildservicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildServicesSample.js +[buildservicelistbuildssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildsSample.js +[buildservicelistsupportedbuildpackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedBuildpacksSample.js +[buildservicelistsupportedstackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedStacksSample.js +[buildpackbindingcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingCreateOrUpdateSample.js +[buildpackbindingdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingDeleteSample.js +[buildpackbindinggetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingGetSample.js +[buildpackbindinglistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingListSample.js +[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesCreateOrUpdateSample.js +[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesDeleteSample.js +[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesGetSample.js +[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesListSample.js +[configserversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersGetSample.js +[configserversupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePatchSample.js +[configserversupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePutSample.js +[configserversvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersValidateSample.js +[configurationservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesCreateOrUpdateSample.js +[configurationservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesDeleteSample.js +[configurationservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesGetSample.js +[configurationserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesListSample.js +[configurationservicesvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesValidateSample.js +[customdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsCreateOrUpdateSample.js +[customdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsDeleteSample.js +[customdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsGetSample.js +[customdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsListSample.js +[customdomainsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsUpdateSample.js +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js +[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsDeleteSample.js +[deploymentsgenerateheapdumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateHeapDumpSample.js +[deploymentsgeneratethreaddumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateThreadDumpSample.js +[deploymentsgetlogfileurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetLogFileUrlSample.js +[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetSample.js +[deploymentslistforclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListForClusterSample.js +[deploymentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListSample.js +[deploymentsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsRestartSample.js +[deploymentsstartjfrsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartJfrSample.js +[deploymentsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartSample.js +[deploymentsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStopSample.js +[deploymentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsUpdateSample.js +[gatewaycustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js +[gatewaycustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsDeleteSample.js +[gatewaycustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsGetSample.js +[gatewaycustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsListSample.js +[gatewayrouteconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js +[gatewayrouteconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsDeleteSample.js +[gatewayrouteconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsGetSample.js +[gatewayrouteconfigslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsListSample.js +[gatewayscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysCreateOrUpdateSample.js +[gatewaysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysDeleteSample.js +[gatewaysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysGetSample.js +[gatewayslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysListSample.js +[gatewaysvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysValidateDomainSample.js +[monitoringsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsGetSample.js +[monitoringsettingsupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePatchSample.js +[monitoringsettingsupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePutSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/operationsListSample.js +[runtimeversionslistruntimeversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js +[serviceregistriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesCreateOrUpdateSample.js +[serviceregistriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesDeleteSample.js +[serviceregistriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesGetSample.js +[serviceregistrieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesListSample.js +[serviceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCheckNameAvailabilitySample.js +[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js +[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDeleteSample.js +[servicesdisabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDisableTestEndpointSample.js +[servicesenabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesEnableTestEndpointSample.js +[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesGetSample.js +[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListBySubscriptionSample.js +[serviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListSample.js +[serviceslisttestkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListTestKeysSample.js +[servicesregeneratetestkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesRegenerateTestKeySample.js +[servicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStartSample.js +[servicesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStopSample.js +[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesUpdateSample.js +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/skusListSample.js +[storagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesCreateOrUpdateSample.js +[storagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesDeleteSample.js +[storagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesGetSample.js +[storageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesListSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appplatform?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform/README.md diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js new file mode 100644 index 000000000000..2969c01e9364 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update the API portal custom domain. + * + * @summary Create or update the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json + */ +async function apiPortalCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const apiPortalCustomDomainResource = { + properties: { thumbprint: "*" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName, + apiPortalCustomDomainResource + ); + console.log(result); +} + +apiPortalCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsDeleteSample.js new file mode 100644 index 000000000000..f67bb2362dfe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the API portal custom domain. + * + * @summary Delete the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json + */ +async function apiPortalCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsGetSample.js new file mode 100644 index 000000000000..f287cde8ecbc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the API portal custom domain. + * + * @summary Get the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json + */ +async function apiPortalCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.get( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsListSample.js new file mode 100644 index 000000000000..ab5d855f427b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalCustomDomainsListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handle requests to list all API portal custom domains. + * + * @summary Handle requests to list all API portal custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json + */ +async function apiPortalCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortalCustomDomains.list( + resourceGroupName, + serviceName, + apiPortalName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsCreateOrUpdateSample.js new file mode 100644 index 000000000000..25b84b146b66 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsCreateOrUpdateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default API portal or update the existing API portal. + * + * @summary Create the default API portal or update the existing API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json + */ +async function apiPortalsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const apiPortalResource = { + properties: { + gatewayIds: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default", + ], + public: true, + }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + apiPortalResource + ); + console.log(result); +} + +apiPortalsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsDeleteSample.js new file mode 100644 index 000000000000..ff79c5a0eedf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the default API portal. + * + * @summary Delete the default API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json + */ +async function apiPortalsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsGetSample.js new file mode 100644 index 000000000000..d3478026dca9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the API portal and its properties. + * + * @summary Get the API portal and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json + */ +async function apiPortalsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.get(resourceGroupName, serviceName, apiPortalName); + console.log(result); +} + +apiPortalsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsListSample.js new file mode 100644 index 000000000000..07023c1e9b3d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json + */ +async function apiPortalsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortals.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsValidateDomainSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsValidateDomainSample.js new file mode 100644 index 000000000000..47109a9e94e6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/apiPortalsValidateDomainSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json + */ +async function apiPortalsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const validatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.validateDomain( + resourceGroupName, + serviceName, + apiPortalName, + validatePayload + ); + console.log(result); +} + +apiPortalsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsCreateOrUpdateSample.js new file mode 100644 index 000000000000..a2940417e395 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsCreateOrUpdateSample.js @@ -0,0 +1,97 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new App or update an exiting App. + * + * @summary Create a new App or update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json + */ +async function appsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": + { + clientId: undefined, + principalId: undefined, + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": + { + clientId: undefined, + principalId: undefined, + }, + }, + }, + location: "eastus", + properties: { + addonConfigs: { + applicationConfigurationService: { + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", + }, + serviceRegistry: { + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", + }, + }, + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: ["uid=0", "gid=0", "dir_mode=0777", "file_mode=0777"], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare", + }, + storageId: "myASCStorageID", + }, + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + loadedCertificates: [ + { + loadTrustStore: false, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1", + }, + { + loadTrustStore: true, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2", + }, + ], + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsDeleteSample.js new file mode 100644 index 000000000000..04b07c67c3bd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsDeleteSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete an App. + * + * @summary Operation to delete an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json + */ +async function appsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginDeleteAndWait(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetResourceUploadUrlSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetResourceUploadUrlSample.js new file mode 100644 index 000000000000..e97b2c87f738 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetResourceUploadUrlSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for an App, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json + */ +async function appsGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.getResourceUploadUrl(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetSample.js new file mode 100644 index 000000000000..0c3aa10a441d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get an App and its properties. + * + * @summary Get an App and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json + */ +async function appsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.get(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsListSample.js new file mode 100644 index 000000000000..f120b183cd96 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json + */ +async function appsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apps.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +appsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsSetActiveDeploymentsSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsSetActiveDeploymentsSample.js new file mode 100644 index 000000000000..90c0541ca06b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsSetActiveDeploymentsSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Set existing Deployment under the app as active + * + * @summary Set existing Deployment under the app as active + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json + */ +async function appsSetActiveDeployments() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const activeDeploymentCollection = { + activeDeploymentNames: ["default"], + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginSetActiveDeploymentsAndWait( + resourceGroupName, + serviceName, + appName, + activeDeploymentCollection + ); + console.log(result); +} + +appsSetActiveDeployments().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsUpdateSample.js new file mode 100644 index 000000000000..e30b91c0beae --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsUpdateSample.js @@ -0,0 +1,75 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting App. + * + * @summary Operation to update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json + */ +async function appsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": + { + clientId: undefined, + principalId: undefined, + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": + { + clientId: undefined, + principalId: undefined, + }, + }, + }, + location: "eastus", + properties: { + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: [], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare", + }, + storageId: "myASCStorageID", + }, + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsValidateDomainSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsValidateDomainSample.js new file mode 100644 index 000000000000..d6eb00918760 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/appsValidateDomainSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check the resource name is valid as well as not in use. + * + * @summary Check the resource name is valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json + */ +async function appsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const validatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.validateDomain( + resourceGroupName, + serviceName, + appName, + validatePayload + ); + console.log(result); +} + +appsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsCreateOrUpdateSample.js new file mode 100644 index 000000000000..1586bf6fac65 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsCreateOrUpdateSample.js @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new Binding or update an exiting Binding. + * + * @summary Create a new Binding or update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json + */ +async function bindingsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource = { + properties: { + bindingParameters: { apiType: "SQL", databaseName: "db1" }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1", + updatedAt: undefined, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsDeleteSample.js new file mode 100644 index 000000000000..b66d00e403d9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Binding. + * + * @summary Operation to delete a Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json + */ +async function bindingsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsGetSample.js new file mode 100644 index 000000000000..45c816f6d173 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsGetSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a Binding and its properties. + * + * @summary Get a Binding and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json + */ +async function bindingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.get(resourceGroupName, serviceName, appName, bindingName); + console.log(result); +} + +bindingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsListSample.js new file mode 100644 index 000000000000..55ea16d417aa --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsListSample.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json + */ +async function bindingsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bindings.list(resourceGroupName, serviceName, appName)) { + resArray.push(item); + } + console.log(resArray); +} + +bindingsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsUpdateSample.js new file mode 100644 index 000000000000..2c165503921d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/bindingsUpdateSample.js @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting Binding. + * + * @summary Operation to update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json + */ +async function bindingsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource = { + properties: { + bindingParameters: { apiType: "SQL", databaseName: "db1" }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + updatedAt: undefined, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolGetSample.js new file mode 100644 index 000000000000..c0aa001e00fe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get build service agent pool. + * + * @summary Get build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json + */ +async function buildServiceAgentPoolGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.get( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName + ); + console.log(result); +} + +buildServiceAgentPoolGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolListSample.js new file mode 100644 index 000000000000..5a31b65837ca --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List build service agent pool. + * + * @summary List build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json + */ +async function buildServiceAgentPoolList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceAgentPool.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceAgentPoolList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolUpdatePutSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolUpdatePutSample.js new file mode 100644 index 000000000000..954c84fc5728 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceAgentPoolUpdatePutSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update build service agent pool. + * + * @summary Create or update build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json + */ +async function buildServiceAgentPoolUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const agentPoolResource = { + properties: { poolSize: { name: "S3" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + agentPoolResource + ); + console.log(result); +} + +buildServiceAgentPoolUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js new file mode 100644 index 000000000000..0e96bca2fac9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a KPack builder. + * + * @summary Create or update a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json + */ +async function buildServiceBuilderCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const builderResource = { + properties: { + buildpackGroups: [{ name: "mix", buildpacks: [{ id: "tanzu-buildpacks/java-azure" }] }], + stack: { id: "io.buildpacks.stacks.bionic", version: "base" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + builderResource + ); + console.log(result); +} + +buildServiceBuilderCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderDeleteSample.js new file mode 100644 index 000000000000..14027f84c1e6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a KPack builder. + * + * @summary Delete a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json + */ +async function buildServiceBuilderDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderGetSample.js new file mode 100644 index 000000000000..a127d4d68ac9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack builder. + * + * @summary Get a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json + */ +async function buildServiceBuilderGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderListSample.js new file mode 100644 index 000000000000..16c8f0184f8a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceBuilderListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List KPack builders result. + * + * @summary List KPack builders result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json + */ +async function buildServiceBuilderList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceBuilder.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceBuilderList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceCreateOrUpdateBuildSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceCreateOrUpdateBuildSample.js new file mode 100644 index 000000000000..ae9e24d66a50 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceCreateOrUpdateBuildSample.js @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a KPack build. + * + * @summary Create or update a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json + */ +async function buildServiceCreateOrUpdateBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const build = { + properties: { + agentPool: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default", + builder: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default", + env: { environmentVariable: "test" }, + relativePath: + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.createOrUpdateBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + build + ); + console.log(result); +} + +buildServiceCreateOrUpdateBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultLogSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultLogSample.js new file mode 100644 index 000000000000..bb98f3feaae5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultLogSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack build result log download URL. + * + * @summary Get a KPack build result log download URL. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json + */ +async function buildServiceGetBuildResultLog() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResultLog( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResultLog().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultSample.js new file mode 100644 index 000000000000..4023cda94d93 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildResultSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack build result. + * + * @summary Get a KPack build result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json + */ +async function buildServiceGetBuildResult() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResult( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResult().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildSample.js new file mode 100644 index 000000000000..b3efa0d0fe36 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack build. + * + * @summary Get a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json + */ +async function buildServiceGetBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName + ); + console.log(result); +} + +buildServiceGetBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildServiceSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildServiceSample.js new file mode 100644 index 000000000000..085de81667fe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetBuildServiceSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a build service resource. + * + * @summary Get a build service resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json + */ +async function buildServiceGetBuildService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildService( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetBuildService().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetResourceUploadUrlSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetResourceUploadUrlSample.js new file mode 100644 index 000000000000..738e4abb05a3 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetResourceUploadUrlSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for build service, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json + */ +async function buildServiceGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getResourceUploadUrl( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedBuildpackSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedBuildpackSample.js new file mode 100644 index 000000000000..7afc007e1299 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedBuildpackSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the supported buildpack resource. + * + * @summary Get the supported buildpack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json + */ +async function buildServiceGetSupportedBuildpack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildpackName = "tanzu-buildpacks-java-azure"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedBuildpack( + resourceGroupName, + serviceName, + buildServiceName, + buildpackName + ); + console.log(result); +} + +buildServiceGetSupportedBuildpack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedStackSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedStackSample.js new file mode 100644 index 000000000000..26e9c784528c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceGetSupportedStackSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the supported stack resource. + * + * @summary Get the supported stack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json + */ +async function buildServiceGetSupportedStack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const stackName = "io.buildpacks.stacks.bionic-base"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedStack( + resourceGroupName, + serviceName, + buildServiceName, + stackName + ); + console.log(result); +} + +buildServiceGetSupportedStack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildResultsSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildResultsSample.js new file mode 100644 index 000000000000..a4d7918ac1f5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildResultsSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List KPack build results. + * + * @summary List KPack build results. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json + */ +async function buildServiceListBuildResults() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildResults( + resourceGroupName, + serviceName, + buildServiceName, + buildName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildResults().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildServicesSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildServicesSample.js new file mode 100644 index 000000000000..2218a92b73ff --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildServicesSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List build services resource. + * + * @summary List build services resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json + */ +async function buildServiceListBuildServices() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildServices( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildServices().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildsSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildsSample.js new file mode 100644 index 000000000000..4e1121befcc6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListBuildsSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List KPack builds. + * + * @summary List KPack builds. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json + */ +async function buildServiceListBuilds() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuilds( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuilds().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedBuildpacksSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedBuildpacksSample.js new file mode 100644 index 000000000000..fd58fa83fd70 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedBuildpacksSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get all supported buildpacks. + * + * @summary Get all supported buildpacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json + */ +async function buildServiceListSupportedBuildpacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedBuildpacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedBuildpacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedStacksSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedStacksSample.js new file mode 100644 index 000000000000..05926dd98fdb --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildServiceListSupportedStacksSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get all supported stacks. + * + * @summary Get all supported stacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json + */ +async function buildServiceListSupportedStacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedStacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedStacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingCreateOrUpdateSample.js new file mode 100644 index 000000000000..83805d1f8bc2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingCreateOrUpdateSample.js @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a buildpack binding. + * + * @summary Create or update a buildpack binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json + */ +async function buildpackBindingCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const buildpackBinding = { + properties: { + bindingType: "ApplicationInsights", + launchProperties: { + properties: { + abc: "def", + anyString: "any-string", + samplingRate: "12.0", + }, + secrets: { + connectionString: + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding + ); + console.log(result); +} + +buildpackBindingCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingDeleteSample.js new file mode 100644 index 000000000000..bb99283f92c9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingDeleteSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Buildpack Binding + * + * @summary Operation to delete a Buildpack Binding + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json + */ +async function buildpackBindingDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingGetSample.js new file mode 100644 index 000000000000..6404503db150 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingGetSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a buildpack binding by name. + * + * @summary Get a buildpack binding by name. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingListSample.js new file mode 100644 index 000000000000..d2c1598dc6c8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/buildpackBindingListSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all buildpack bindings in a builder. + * + * @summary Handles requests to list all buildpack bindings in a builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildpackBinding.list( + resourceGroupName, + serviceName, + buildServiceName, + builderName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesCreateOrUpdateSample.js new file mode 100644 index 000000000000..b3ff553c185e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesCreateOrUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update certificate resource. + * + * @summary Create or update certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json + */ +async function certificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const certificateResource = { + properties: { + type: "KeyVaultCertificate", + certVersion: "08a219d06d874795a96db47e06fbb01e", + keyVaultCertName: "mycert", + vaultUri: "https://myvault.vault.azure.net", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + certificateName, + certificateResource + ); + console.log(result); +} + +certificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesDeleteSample.js new file mode 100644 index 000000000000..6df1ca1cdcb4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the certificate resource. + * + * @summary Delete the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json + */ +async function certificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginDeleteAndWait( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesGetSample.js new file mode 100644 index 000000000000..f1dd6d157899 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the certificate resource. + * + * @summary Get the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json + */ +async function certificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.get(resourceGroupName, serviceName, certificateName); + console.log(result); +} + +certificatesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesListSample.js new file mode 100644 index 000000000000..e0194b6994e9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/certificatesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all the certificates of one user. + * + * @summary List all the certificates of one user. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json + */ +async function certificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.certificates.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +certificatesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersGetSample.js new file mode 100644 index 000000000000..987bc66a536c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the config server and its properties. + * + * @summary Get the config server and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json + */ +async function configServersGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.get(resourceGroupName, serviceName); + console.log(result); +} + +configServersGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePatchSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePatchSample.js new file mode 100644 index 000000000000..88ef9101154f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePatchSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json + */ +async function configServersUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePutSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePutSample.js new file mode 100644 index 000000000000..b6f317df5a1f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersUpdatePutSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json + */ +async function configServersUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersValidateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersValidateSample.js new file mode 100644 index 000000000000..05fb4f30e14c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configServersValidateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check if the config server settings are valid. + * + * @summary Check if the config server settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json + */ +async function configServersValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerSettings = { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginValidateAndWait( + resourceGroupName, + serviceName, + configServerSettings + ); + console.log(result); +} + +configServersValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesCreateOrUpdateSample.js new file mode 100644 index 000000000000..fd5dba0174ac --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesCreateOrUpdateSample.js @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @summary Create the default Application Configuration Service or update the existing Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json + */ +async function configurationServicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const configurationServiceResource = { + properties: { + settings: { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository", + }, + ], + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource + ); + console.log(result); +} + +configurationServicesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesDeleteSample.js new file mode 100644 index 000000000000..f7617591ace3 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable the default Application Configuration Service. + * + * @summary Disable the default Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json + */ +async function configurationServicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginDeleteAndWait( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesGetSample.js new file mode 100644 index 000000000000..b5ab685bfd27 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Application Configuration Service and its properties. + * + * @summary Get the Application Configuration Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json + */ +async function configurationServicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.get( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesListSample.js new file mode 100644 index 000000000000..48111fecaec9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json + */ +async function configurationServicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.configurationServices.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +configurationServicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesValidateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesValidateSample.js new file mode 100644 index 000000000000..a1554543a226 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/configurationServicesValidateSample.js @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check if the Application Configuration Service settings are valid. + * + * @summary Check if the Application Configuration Service settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json + */ +async function configurationServicesValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const settings = { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginValidateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + settings + ); + console.log(result); +} + +configurationServicesValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsCreateOrUpdateSample.js new file mode 100644 index 000000000000..8af9b913aeef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsCreateOrUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update custom domain of one lifecycle application. + * + * @summary Create or update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json + */ +async function customDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsDeleteSample.js new file mode 100644 index 000000000000..71312b5c29a5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the custom domain of one lifecycle application. + * + * @summary Delete the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json + */ +async function customDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsGetSample.js new file mode 100644 index 000000000000..e5e634a26d27 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the custom domain of one lifecycle application. + * + * @summary Get the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json + */ +async function customDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.get( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsListSample.js new file mode 100644 index 000000000000..d46883582e9b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsListSample.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List the custom domains of one lifecycle application. + * + * @summary List the custom domains of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json + */ +async function customDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.customDomains.list(resourceGroupName, serviceName, appName)) { + resArray.push(item); + } + console.log(resArray); +} + +customDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsUpdateSample.js new file mode 100644 index 000000000000..d6df10c2276c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/customDomainsUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update custom domain of one lifecycle application. + * + * @summary Update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json + */ +async function customDomainsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js new file mode 100644 index 000000000000..d1ec495d4ca1 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js @@ -0,0 +1,107 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json + */ +async function deploymentsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + deploymentSettings: { + addonConfigs: { + applicationConfigurationService: { patterns: ["mypattern"] }, + }, + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" }, + }, + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0", + }, + }, + sku: { name: "S0", capacity: 1, tier: "Standard" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json + */ +async function deploymentsCreateOrUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + deploymentSettings: { + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" }, + }, + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myContainerImage:v1", + imageRegistryCredential: { + password: "myPassword", + username: "myUsername", + }, + languageFramework: "springboot", + server: "myacr.azurecr.io", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsDeleteSample.js new file mode 100644 index 000000000000..ca244ad67372 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Deployment. + * + * @summary Operation to delete a Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json + */ +async function deploymentsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateHeapDumpSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateHeapDumpSample.js new file mode 100644 index 000000000000..41bfd9209305 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateHeapDumpSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Generate Heap Dump + * + * @summary Generate Heap Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateHeapDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateThreadDumpSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateThreadDumpSample.js new file mode 100644 index 000000000000..d826086cc076 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGenerateThreadDumpSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Generate Thread Dump + * + * @summary Generate Thread Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateThreadDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetLogFileUrlSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetLogFileUrlSample.js new file mode 100644 index 000000000000..a5fce1ad9dbb --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetLogFileUrlSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get deployment log file URL + * + * @summary Get deployment log file URL + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json + */ +async function deploymentsGetLogFileUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.getLogFileUrl( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetLogFileUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetSample.js new file mode 100644 index 000000000000..a14265908cd7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsGetSample.js @@ -0,0 +1,62 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json + */ +async function deploymentsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGet().catch(console.error); + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get_CustomContainer.json + */ +async function deploymentsGetCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListForClusterSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListForClusterSample.js new file mode 100644 index 000000000000..949eaf0b97ea --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListForClusterSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List deployments for a certain service + * + * @summary List deployments for a certain service + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json + */ +async function deploymentsListForCluster() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.listForCluster(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsListForCluster().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListSample.js new file mode 100644 index 000000000000..ed5a189a45a5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsListSample.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json + */ +async function deploymentsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.list(resourceGroupName, serviceName, appName)) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsRestartSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsRestartSample.js new file mode 100644 index 000000000000..0a86c26a7200 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsRestartSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restart the deployment. + * + * @summary Restart the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json + */ +async function deploymentsRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginRestartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsRestart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartJfrSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartJfrSample.js new file mode 100644 index 000000000000..84fc093f7083 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartJfrSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Start JFR + * + * @summary Start JFR + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json + */ +async function deploymentsStartJfr() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters = { + appInstance: "myappinstance", + duration: "60s", + filePath: "/byos/diagnose", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartJFRAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsStartJfr().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartSample.js new file mode 100644 index 000000000000..0cb73dcfe212 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStartSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Start the deployment. + * + * @summary Start the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json + */ +async function deploymentsStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStopSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStopSample.js new file mode 100644 index 000000000000..80c6da632547 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsStopSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Stop the deployment. + * + * @summary Stop the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json + */ +async function deploymentsStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStopAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsUpdateSample.js new file mode 100644 index 000000000000..375c5adfbd53 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/deploymentsUpdateSample.js @@ -0,0 +1,94 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json + */ +async function deploymentsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdate().catch(console.error); + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update_CustomContainer.json + */ +async function deploymentsUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myNewContainerImage:v1", + imageRegistryCredential: { + password: "", + username: "myNewUsername", + }, + server: "mynewacr.azurecr.io", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js new file mode 100644 index 000000000000..c6bdeceb6594 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update the Spring Cloud Gateway custom domain. + * + * @summary Create or update the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json + */ +async function gatewayCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const gatewayCustomDomainResource = { + properties: { thumbprint: "*" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName, + gatewayCustomDomainResource + ); + console.log(result); +} + +gatewayCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsDeleteSample.js new file mode 100644 index 000000000000..288e4f6e0f4e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway custom domain. + * + * @summary Delete the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json + */ +async function gatewayCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsGetSample.js new file mode 100644 index 000000000000..6e1aeb109911 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway custom domain. + * + * @summary Get the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json + */ +async function gatewayCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.get( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsListSample.js new file mode 100644 index 000000000000..6696a529efd4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayCustomDomainsListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway custom domains. + * + * @summary Handle requests to list all Spring Cloud Gateway custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json + */ +async function gatewayCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayCustomDomains.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js new file mode 100644 index 000000000000..80abb71459cd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @summary Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json + */ +async function gatewayRouteConfigsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const gatewayRouteConfigResource = { + properties: { + appResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp", + routes: [ + { + filters: ["StripPrefix=2", "RateLimit=1,1s"], + predicates: ["Path=/api5/customer/**"], + ssoEnabled: true, + title: "myApp route config", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + gatewayRouteConfigResource + ); + console.log(result); +} + +gatewayRouteConfigsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsDeleteSample.js new file mode 100644 index 000000000000..9105444d3f9a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway route config. + * + * @summary Delete the Spring Cloud Gateway route config. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json + */ +async function gatewayRouteConfigsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsGetSample.js new file mode 100644 index 000000000000..c72b26c3ffd7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway route configs. + * + * @summary Get the Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json + */ +async function gatewayRouteConfigsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.get( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsListSample.js new file mode 100644 index 000000000000..d69c77ef85a8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewayRouteConfigsListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway route configs. + * + * @summary Handle requests to list all Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json + */ +async function gatewayRouteConfigsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayRouteConfigs.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayRouteConfigsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysCreateOrUpdateSample.js new file mode 100644 index 000000000000..5d00be3520d8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysCreateOrUpdateSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @summary Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json + */ +async function gatewaysCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const gatewayResource = { + properties: { public: true, resourceRequests: { cpu: "1", memory: "1G" } }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + gatewayResource + ); + console.log(result); +} + +gatewaysCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysDeleteSample.js new file mode 100644 index 000000000000..9a9e7ca45aa3 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable the default Spring Cloud Gateway. + * + * @summary Disable the default Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json + */ +async function gatewaysDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysGetSample.js new file mode 100644 index 000000000000..ce9eeb3f99ec --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway and its properties. + * + * @summary Get the Spring Cloud Gateway and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json + */ +async function gatewaysGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.get(resourceGroupName, serviceName, gatewayName); + console.log(result); +} + +gatewaysGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysListSample.js new file mode 100644 index 000000000000..7f07691f6173 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json + */ +async function gatewaysList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gateways.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +gatewaysList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysValidateDomainSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysValidateDomainSample.js new file mode 100644 index 000000000000..bc794ceae68e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/gatewaysValidateDomainSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json + */ +async function gatewaysValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const validatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.validateDomain( + resourceGroupName, + serviceName, + gatewayName, + validatePayload + ); + console.log(result); +} + +gatewaysValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsGetSample.js new file mode 100644 index 000000000000..8a8fb495471a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Monitoring Setting and its properties. + * + * @summary Get the Monitoring Setting and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json + */ +async function monitoringSettingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.get(resourceGroupName, serviceName); + console.log(result); +} + +monitoringSettingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePatchSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePatchSample.js new file mode 100644 index 000000000000..124ba3fd58cd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePatchSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json + */ +async function monitoringSettingsUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePutSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePutSample.js new file mode 100644 index 000000000000..5e86444aab79 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/monitoringSettingsUpdatePutSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json + */ +async function monitoringSettingsUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/operationsListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..bb7749e70011 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/operationsListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/package.json b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/package.json new file mode 100644 index 000000000000..449429a61ad2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-appplatform-samples-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/appplatform/arm-appplatform" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform", + "dependencies": { + "@azure/arm-appplatform": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js new file mode 100644 index 000000000000..e56ce8d10d79 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js @@ -0,0 +1,28 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @summary Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json + */ +async function runtimeVersionsListRuntimeVersions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.runtimeVersions.listRuntimeVersions(); + console.log(result); +} + +runtimeVersionsListRuntimeVersions().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/sample.env b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesCreateOrUpdateSample.js new file mode 100644 index 000000000000..15b72cca8fda --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesCreateOrUpdateSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Service Registry or update the existing Service Registry. + * + * @summary Create the default Service Registry or update the existing Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json + */ +async function serviceRegistriesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesDeleteSample.js new file mode 100644 index 000000000000..68d69b3d4c22 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable the default Service Registry. + * + * @summary Disable the default Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json + */ +async function serviceRegistriesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginDeleteAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesGetSample.js new file mode 100644 index 000000000000..74f4aeff281b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Service Registry and its properties. + * + * @summary Get the Service Registry and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json + */ +async function serviceRegistriesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.get( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesListSample.js new file mode 100644 index 000000000000..90e9704605a6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/serviceRegistriesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json + */ +async function serviceRegistriesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.serviceRegistries.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +serviceRegistriesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCheckNameAvailabilitySample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCheckNameAvailabilitySample.js new file mode 100644 index 000000000000..a0dd5ec0ea51 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCheckNameAvailabilitySample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json + */ +async function servicesCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const availabilityParameters = { + name: "myservice", + type: "Microsoft.AppPlatform/Spring", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.checkNameAvailability(location, availabilityParameters); + console.log(result); +} + +servicesCheckNameAvailability().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js new file mode 100644 index 000000000000..b3fbcc82fa73 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js @@ -0,0 +1,78 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json + */ +async function servicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json + */ +async function servicesCreateOrUpdateVNetInjection() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource = { + location: "eastus", + properties: { + networkProfile: { + appNetworkResourceGroup: "my-app-network-rg", + appSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps", + serviceCidr: "10.8.0.0/16,10.244.0.0/16,10.245.0.1/16", + serviceRuntimeNetworkResourceGroup: "my-service-runtime-network-rg", + serviceRuntimeSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime", + }, + }, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdateVNetInjection().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDeleteSample.js new file mode 100644 index 000000000000..4645eae82380 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Service. + * + * @summary Operation to delete a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json + */ +async function servicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginDeleteAndWait(resourceGroupName, serviceName); + console.log(result); +} + +servicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDisableTestEndpointSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDisableTestEndpointSample.js new file mode 100644 index 000000000000..c849b9231752 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesDisableTestEndpointSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable test endpoint functionality for a Service. + * + * @summary Disable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json + */ +async function servicesDisableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.disableTestEndpoint(resourceGroupName, serviceName); + console.log(result); +} + +servicesDisableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesEnableTestEndpointSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesEnableTestEndpointSample.js new file mode 100644 index 000000000000..b1671b944114 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesEnableTestEndpointSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Enable test endpoint functionality for a Service. + * + * @summary Enable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json + */ +async function servicesEnableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.enableTestEndpoint(resourceGroupName, serviceName); + console.log(result); +} + +servicesEnableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesGetSample.js new file mode 100644 index 000000000000..06ab762d8d36 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a Service and its properties. + * + * @summary Get a Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json + */ +async function servicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.get(resourceGroupName, serviceName); + console.log(result); +} + +servicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListBySubscriptionSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListBySubscriptionSample.js new file mode 100644 index 000000000000..933dfcb61827 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json + */ +async function servicesListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +servicesListBySubscription().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListSample.js new file mode 100644 index 000000000000..e267d5942c79 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json + */ +async function servicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +servicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListTestKeysSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListTestKeysSample.js new file mode 100644 index 000000000000..8c2e15020624 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesListTestKeysSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List test keys for a Service. + * + * @summary List test keys for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json + */ +async function servicesListTestKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.listTestKeys(resourceGroupName, serviceName); + console.log(result); +} + +servicesListTestKeys().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesRegenerateTestKeySample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesRegenerateTestKeySample.js new file mode 100644 index 000000000000..3c8a39573edd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesRegenerateTestKeySample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Regenerate a test key for a Service. + * + * @summary Regenerate a test key for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json + */ +async function servicesRegenerateTestKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const regenerateTestKeyRequest = { + keyType: "Primary", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.regenerateTestKey( + resourceGroupName, + serviceName, + regenerateTestKeyRequest + ); + console.log(result); +} + +servicesRegenerateTestKey().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStartSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStartSample.js new file mode 100644 index 000000000000..4113986192de --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStartSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Start a Service. + * + * @summary Start a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json + */ +async function servicesStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStartAndWait(resourceGroupName, serviceName); + console.log(result); +} + +servicesStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStopSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStopSample.js new file mode 100644 index 000000000000..0480a87a3621 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesStopSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Stop a Service. + * + * @summary Stop a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json + */ +async function servicesStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStopAndWait(resourceGroupName, serviceName); + console.log(result); +} + +servicesStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesUpdateSample.js new file mode 100644 index 000000000000..76ce8f9ef4cf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/servicesUpdateSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting Service. + * + * @summary Operation to update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json + */ +async function servicesUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginUpdateAndWait(resourceGroupName, serviceName, resource); + console.log(result); +} + +servicesUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/skusListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/skusListSample.js new file mode 100644 index 000000000000..6f005fcc99af --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/skusListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available skus of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json + */ +async function skusList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.skus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +skusList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesCreateOrUpdateSample.js new file mode 100644 index 000000000000..9519bd43d185 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesCreateOrUpdateSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update storage resource. + * + * @summary Create or update storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json + */ +async function storagesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const storageResource = { + properties: { + accountKey: "account-key-of-storage-account", + accountName: "storage-account-name", + storageType: "StorageAccount", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + storageName, + storageResource + ); + console.log(result); +} + +storagesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesDeleteSample.js new file mode 100644 index 000000000000..3b81e678eaac --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the storage resource. + * + * @summary Delete the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json + */ +async function storagesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginDeleteAndWait( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesGetSample.js new file mode 100644 index 000000000000..e55c1430cfbd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the storage resource. + * + * @summary Get the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json + */ +async function storagesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.get(resourceGroupName, serviceName, storageName); + console.log(result); +} + +storagesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesListSample.js b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesListSample.js new file mode 100644 index 000000000000..17115e5a9ae7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/javascript/storagesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all the storages of one Azure Spring Cloud instance. + * + * @summary List all the storages of one Azure Spring Cloud instance. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json + */ +async function storagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storages.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +storagesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/README.md b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/README.md new file mode 100644 index 000000000000..003d30a94691 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/README.md @@ -0,0 +1,295 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [apiPortalCustomDomainsCreateOrUpdateSample.ts][apiportalcustomdomainscreateorupdatesample] | Create or update the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json | +| [apiPortalCustomDomainsDeleteSample.ts][apiportalcustomdomainsdeletesample] | Delete the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json | +| [apiPortalCustomDomainsGetSample.ts][apiportalcustomdomainsgetsample] | Get the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json | +| [apiPortalCustomDomainsListSample.ts][apiportalcustomdomainslistsample] | Handle requests to list all API portal custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json | +| [apiPortalsCreateOrUpdateSample.ts][apiportalscreateorupdatesample] | Create the default API portal or update the existing API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json | +| [apiPortalsDeleteSample.ts][apiportalsdeletesample] | Delete the default API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json | +| [apiPortalsGetSample.ts][apiportalsgetsample] | Get the API portal and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json | +| [apiPortalsListSample.ts][apiportalslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json | +| [apiPortalsValidateDomainSample.ts][apiportalsvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json | +| [appsCreateOrUpdateSample.ts][appscreateorupdatesample] | Create a new App or update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json | +| [appsDeleteSample.ts][appsdeletesample] | Operation to delete an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json | +| [appsGetResourceUploadUrlSample.ts][appsgetresourceuploadurlsample] | Get an resource upload URL for an App, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json | +| [appsGetSample.ts][appsgetsample] | Get an App and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json | +| [appsListSample.ts][appslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json | +| [appsSetActiveDeploymentsSample.ts][appssetactivedeploymentssample] | Set existing Deployment under the app as active x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json | +| [appsUpdateSample.ts][appsupdatesample] | Operation to update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json | +| [appsValidateDomainSample.ts][appsvalidatedomainsample] | Check the resource name is valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json | +| [bindingsCreateOrUpdateSample.ts][bindingscreateorupdatesample] | Create a new Binding or update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json | +| [bindingsDeleteSample.ts][bindingsdeletesample] | Operation to delete a Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json | +| [bindingsGetSample.ts][bindingsgetsample] | Get a Binding and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json | +| [bindingsListSample.ts][bindingslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json | +| [bindingsUpdateSample.ts][bindingsupdatesample] | Operation to update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json | +| [buildServiceAgentPoolGetSample.ts][buildserviceagentpoolgetsample] | Get build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json | +| [buildServiceAgentPoolListSample.ts][buildserviceagentpoollistsample] | List build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json | +| [buildServiceAgentPoolUpdatePutSample.ts][buildserviceagentpoolupdateputsample] | Create or update build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json | +| [buildServiceBuilderCreateOrUpdateSample.ts][buildservicebuildercreateorupdatesample] | Create or update a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json | +| [buildServiceBuilderDeleteSample.ts][buildservicebuilderdeletesample] | Delete a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json | +| [buildServiceBuilderGetSample.ts][buildservicebuildergetsample] | Get a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json | +| [buildServiceBuilderListSample.ts][buildservicebuilderlistsample] | List KPack builders result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json | +| [buildServiceCreateOrUpdateBuildSample.ts][buildservicecreateorupdatebuildsample] | Create or update a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json | +| [buildServiceGetBuildResultLogSample.ts][buildservicegetbuildresultlogsample] | Get a KPack build result log download URL. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json | +| [buildServiceGetBuildResultSample.ts][buildservicegetbuildresultsample] | Get a KPack build result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json | +| [buildServiceGetBuildSample.ts][buildservicegetbuildsample] | Get a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json | +| [buildServiceGetBuildServiceSample.ts][buildservicegetbuildservicesample] | Get a build service resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json | +| [buildServiceGetResourceUploadUrlSample.ts][buildservicegetresourceuploadurlsample] | Get an resource upload URL for build service, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json | +| [buildServiceGetSupportedBuildpackSample.ts][buildservicegetsupportedbuildpacksample] | Get the supported buildpack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json | +| [buildServiceGetSupportedStackSample.ts][buildservicegetsupportedstacksample] | Get the supported stack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json | +| [buildServiceListBuildResultsSample.ts][buildservicelistbuildresultssample] | List KPack build results. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json | +| [buildServiceListBuildServicesSample.ts][buildservicelistbuildservicessample] | List build services resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json | +| [buildServiceListBuildsSample.ts][buildservicelistbuildssample] | List KPack builds. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json | +| [buildServiceListSupportedBuildpacksSample.ts][buildservicelistsupportedbuildpackssample] | Get all supported buildpacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json | +| [buildServiceListSupportedStacksSample.ts][buildservicelistsupportedstackssample] | Get all supported stacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json | +| [buildpackBindingCreateOrUpdateSample.ts][buildpackbindingcreateorupdatesample] | Create or update a buildpack binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json | +| [buildpackBindingDeleteSample.ts][buildpackbindingdeletesample] | Operation to delete a Buildpack Binding x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json | +| [buildpackBindingGetSample.ts][buildpackbindinggetsample] | Get a buildpack binding by name. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json | +| [buildpackBindingListSample.ts][buildpackbindinglistsample] | Handles requests to list all buildpack bindings in a builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json | +| [certificatesCreateOrUpdateSample.ts][certificatescreateorupdatesample] | Create or update certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json | +| [certificatesDeleteSample.ts][certificatesdeletesample] | Delete the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json | +| [certificatesGetSample.ts][certificatesgetsample] | Get the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json | +| [certificatesListSample.ts][certificateslistsample] | List all the certificates of one user. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json | +| [configServersGetSample.ts][configserversgetsample] | Get the config server and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json | +| [configServersUpdatePatchSample.ts][configserversupdatepatchsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json | +| [configServersUpdatePutSample.ts][configserversupdateputsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json | +| [configServersValidateSample.ts][configserversvalidatesample] | Check if the config server settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json | +| [configurationServicesCreateOrUpdateSample.ts][configurationservicescreateorupdatesample] | Create the default Application Configuration Service or update the existing Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json | +| [configurationServicesDeleteSample.ts][configurationservicesdeletesample] | Disable the default Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json | +| [configurationServicesGetSample.ts][configurationservicesgetsample] | Get the Application Configuration Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json | +| [configurationServicesListSample.ts][configurationserviceslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json | +| [configurationServicesValidateSample.ts][configurationservicesvalidatesample] | Check if the Application Configuration Service settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json | +| [customDomainsCreateOrUpdateSample.ts][customdomainscreateorupdatesample] | Create or update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json | +| [customDomainsDeleteSample.ts][customdomainsdeletesample] | Delete the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json | +| [customDomainsGetSample.ts][customdomainsgetsample] | Get the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json | +| [customDomainsListSample.ts][customdomainslistsample] | List the custom domains of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json | +| [customDomainsUpdateSample.ts][customdomainsupdatesample] | Update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json | +| [deploymentsCreateOrUpdateSample.ts][deploymentscreateorupdatesample] | Create a new Deployment or update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json | +| [deploymentsDeleteSample.ts][deploymentsdeletesample] | Operation to delete a Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json | +| [deploymentsGenerateHeapDumpSample.ts][deploymentsgenerateheapdumpsample] | Generate Heap Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json | +| [deploymentsGenerateThreadDumpSample.ts][deploymentsgeneratethreaddumpsample] | Generate Thread Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json | +| [deploymentsGetLogFileUrlSample.ts][deploymentsgetlogfileurlsample] | Get deployment log file URL x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json | +| [deploymentsGetSample.ts][deploymentsgetsample] | Get a Deployment and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json | +| [deploymentsListForClusterSample.ts][deploymentslistforclustersample] | List deployments for a certain service x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json | +| [deploymentsListSample.ts][deploymentslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json | +| [deploymentsRestartSample.ts][deploymentsrestartsample] | Restart the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json | +| [deploymentsStartJfrSample.ts][deploymentsstartjfrsample] | Start JFR x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json | +| [deploymentsStartSample.ts][deploymentsstartsample] | Start the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json | +| [deploymentsStopSample.ts][deploymentsstopsample] | Stop the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json | +| [deploymentsUpdateSample.ts][deploymentsupdatesample] | Operation to update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json | +| [gatewayCustomDomainsCreateOrUpdateSample.ts][gatewaycustomdomainscreateorupdatesample] | Create or update the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json | +| [gatewayCustomDomainsDeleteSample.ts][gatewaycustomdomainsdeletesample] | Delete the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json | +| [gatewayCustomDomainsGetSample.ts][gatewaycustomdomainsgetsample] | Get the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json | +| [gatewayCustomDomainsListSample.ts][gatewaycustomdomainslistsample] | Handle requests to list all Spring Cloud Gateway custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json | +| [gatewayRouteConfigsCreateOrUpdateSample.ts][gatewayrouteconfigscreateorupdatesample] | Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json | +| [gatewayRouteConfigsDeleteSample.ts][gatewayrouteconfigsdeletesample] | Delete the Spring Cloud Gateway route config. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json | +| [gatewayRouteConfigsGetSample.ts][gatewayrouteconfigsgetsample] | Get the Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json | +| [gatewayRouteConfigsListSample.ts][gatewayrouteconfigslistsample] | Handle requests to list all Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json | +| [gatewaysCreateOrUpdateSample.ts][gatewayscreateorupdatesample] | Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json | +| [gatewaysDeleteSample.ts][gatewaysdeletesample] | Disable the default Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json | +| [gatewaysGetSample.ts][gatewaysgetsample] | Get the Spring Cloud Gateway and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json | +| [gatewaysListSample.ts][gatewayslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json | +| [gatewaysValidateDomainSample.ts][gatewaysvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json | +| [monitoringSettingsGetSample.ts][monitoringsettingsgetsample] | Get the Monitoring Setting and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json | +| [monitoringSettingsUpdatePatchSample.ts][monitoringsettingsupdatepatchsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json | +| [monitoringSettingsUpdatePutSample.ts][monitoringsettingsupdateputsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json | +| [runtimeVersionsListRuntimeVersionsSample.ts][runtimeversionslistruntimeversionssample] | Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json | +| [serviceRegistriesCreateOrUpdateSample.ts][serviceregistriescreateorupdatesample] | Create the default Service Registry or update the existing Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json | +| [serviceRegistriesDeleteSample.ts][serviceregistriesdeletesample] | Disable the default Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json | +| [serviceRegistriesGetSample.ts][serviceregistriesgetsample] | Get the Service Registry and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json | +| [serviceRegistriesListSample.ts][serviceregistrieslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json | +| [servicesCheckNameAvailabilitySample.ts][serviceschecknameavailabilitysample] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json | +| [servicesCreateOrUpdateSample.ts][servicescreateorupdatesample] | Create a new Service or update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json | +| [servicesDeleteSample.ts][servicesdeletesample] | Operation to delete a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json | +| [servicesDisableTestEndpointSample.ts][servicesdisabletestendpointsample] | Disable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json | +| [servicesEnableTestEndpointSample.ts][servicesenabletestendpointsample] | Enable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json | +| [servicesGetSample.ts][servicesgetsample] | Get a Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json | +| [servicesListBySubscriptionSample.ts][serviceslistbysubscriptionsample] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json | +| [servicesListSample.ts][serviceslistsample] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json | +| [servicesListTestKeysSample.ts][serviceslisttestkeyssample] | List test keys for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json | +| [servicesRegenerateTestKeySample.ts][servicesregeneratetestkeysample] | Regenerate a test key for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json | +| [servicesStartSample.ts][servicesstartsample] | Start a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json | +| [servicesStopSample.ts][servicesstopsample] | Stop a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json | +| [servicesUpdateSample.ts][servicesupdatesample] | Operation to update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json | +| [skusListSample.ts][skuslistsample] | Lists all of the available skus of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json | +| [storagesCreateOrUpdateSample.ts][storagescreateorupdatesample] | Create or update storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json | +| [storagesDeleteSample.ts][storagesdeletesample] | Delete the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json | +| [storagesGetSample.ts][storagesgetsample] | Get the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json | +| [storagesListSample.ts][storageslistsample] | List all the storages of one Azure Spring Cloud instance. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[apiportalcustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts +[apiportalcustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts +[apiportalcustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsGetSample.ts +[apiportalcustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsListSample.ts +[apiportalscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts +[apiportalsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsDeleteSample.ts +[apiportalsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsGetSample.ts +[apiportalslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsListSample.ts +[apiportalsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsValidateDomainSample.ts +[appscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsCreateOrUpdateSample.ts +[appsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsDeleteSample.ts +[appsgetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetResourceUploadUrlSample.ts +[appsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetSample.ts +[appslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsListSample.ts +[appssetactivedeploymentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsSetActiveDeploymentsSample.ts +[appsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsUpdateSample.ts +[appsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsValidateDomainSample.ts +[bindingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsCreateOrUpdateSample.ts +[bindingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsDeleteSample.ts +[bindingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsGetSample.ts +[bindingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsListSample.ts +[bindingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsUpdateSample.ts +[buildserviceagentpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolGetSample.ts +[buildserviceagentpoollistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolListSample.ts +[buildserviceagentpoolupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts +[buildservicebuildercreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts +[buildservicebuilderdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderDeleteSample.ts +[buildservicebuildergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderGetSample.ts +[buildservicebuilderlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderListSample.ts +[buildservicecreateorupdatebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts +[buildservicegetbuildresultlogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultLogSample.ts +[buildservicegetbuildresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultSample.ts +[buildservicegetbuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildSample.ts +[buildservicegetbuildservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildServiceSample.ts +[buildservicegetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts +[buildservicegetsupportedbuildpacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts +[buildservicegetsupportedstacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedStackSample.ts +[buildservicelistbuildresultssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildResultsSample.ts +[buildservicelistbuildservicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildServicesSample.ts +[buildservicelistbuildssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildsSample.ts +[buildservicelistsupportedbuildpackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts +[buildservicelistsupportedstackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedStacksSample.ts +[buildpackbindingcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts +[buildpackbindingdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingDeleteSample.ts +[buildpackbindinggetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingGetSample.ts +[buildpackbindinglistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingListSample.ts +[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesCreateOrUpdateSample.ts +[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesDeleteSample.ts +[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesGetSample.ts +[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesListSample.ts +[configserversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersGetSample.ts +[configserversupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePatchSample.ts +[configserversupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePutSample.ts +[configserversvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersValidateSample.ts +[configurationservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts +[configurationservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesDeleteSample.ts +[configurationservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesGetSample.ts +[configurationserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesListSample.ts +[configurationservicesvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesValidateSample.ts +[customdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsCreateOrUpdateSample.ts +[customdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsDeleteSample.ts +[customdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsGetSample.ts +[customdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsListSample.ts +[customdomainsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsUpdateSample.ts +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts +[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts +[deploymentsgenerateheapdumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts +[deploymentsgeneratethreaddumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts +[deploymentsgetlogfileurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetLogFileUrlSample.ts +[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetSample.ts +[deploymentslistforclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListForClusterSample.ts +[deploymentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListSample.ts +[deploymentsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsRestartSample.ts +[deploymentsstartjfrsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartJfrSample.ts +[deploymentsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartSample.ts +[deploymentsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStopSample.ts +[deploymentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsUpdateSample.ts +[gatewaycustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts +[gatewaycustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts +[gatewaycustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsGetSample.ts +[gatewaycustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsListSample.ts +[gatewayrouteconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts +[gatewayrouteconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts +[gatewayrouteconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsGetSample.ts +[gatewayrouteconfigslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsListSample.ts +[gatewayscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysCreateOrUpdateSample.ts +[gatewaysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysDeleteSample.ts +[gatewaysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysGetSample.ts +[gatewayslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysListSample.ts +[gatewaysvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysValidateDomainSample.ts +[monitoringsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsGetSample.ts +[monitoringsettingsupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts +[monitoringsettingsupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePutSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/operationsListSample.ts +[runtimeversionslistruntimeversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts +[serviceregistriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts +[serviceregistriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesDeleteSample.ts +[serviceregistriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesGetSample.ts +[serviceregistrieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesListSample.ts +[serviceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCheckNameAvailabilitySample.ts +[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts +[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDeleteSample.ts +[servicesdisabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDisableTestEndpointSample.ts +[servicesenabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesEnableTestEndpointSample.ts +[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesGetSample.ts +[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts +[serviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListSample.ts +[serviceslisttestkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListTestKeysSample.ts +[servicesregeneratetestkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesRegenerateTestKeySample.ts +[servicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStartSample.ts +[servicesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStopSample.ts +[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesUpdateSample.ts +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/skusListSample.ts +[storagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesCreateOrUpdateSample.ts +[storagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesDeleteSample.ts +[storagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesGetSample.ts +[storageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesListSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appplatform?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/package.json b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/package.json new file mode 100644 index 000000000000..701f8bd64a6c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-appplatform-samples-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/appplatform/arm-appplatform" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform", + "dependencies": { + "@azure/arm-appplatform": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/sample.env b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..79f2f5ccc8a9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApiPortalCustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the API portal custom domain. + * + * @summary Create or update the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json + */ +async function apiPortalCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const apiPortalCustomDomainResource: ApiPortalCustomDomainResource = { + properties: { thumbprint: "*" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName, + apiPortalCustomDomainResource + ); + console.log(result); +} + +apiPortalCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..53356fd2c799 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the API portal custom domain. + * + * @summary Delete the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json + */ +async function apiPortalCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsGetSample.ts new file mode 100644 index 000000000000..f3850cef0fa7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the API portal custom domain. + * + * @summary Get the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json + */ +async function apiPortalCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.get( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsListSample.ts new file mode 100644 index 000000000000..eabad4c24d0c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalCustomDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all API portal custom domains. + * + * @summary Handle requests to list all API portal custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json + */ +async function apiPortalCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortalCustomDomains.list( + resourceGroupName, + serviceName, + apiPortalName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b5fe4364aa3f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApiPortalResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default API portal or update the existing API portal. + * + * @summary Create the default API portal or update the existing API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json + */ +async function apiPortalsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const apiPortalResource: ApiPortalResource = { + properties: { + gatewayIds: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default" + ], + public: true + }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + apiPortalResource + ); + console.log(result); +} + +apiPortalsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsDeleteSample.ts new file mode 100644 index 000000000000..80ae88d8a03c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the default API portal. + * + * @summary Delete the default API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json + */ +async function apiPortalsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsGetSample.ts new file mode 100644 index 000000000000..f7ab08f1c983 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the API portal and its properties. + * + * @summary Get the API portal and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json + */ +async function apiPortalsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.get( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsListSample.ts new file mode 100644 index 000000000000..11e4525e3bac --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json + */ +async function apiPortalsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortals.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsValidateDomainSample.ts new file mode 100644 index 000000000000..1bfec026b167 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/apiPortalsValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json + */ +async function apiPortalsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.validateDomain( + resourceGroupName, + serviceName, + apiPortalName, + validatePayload + ); + console.log(result); +} + +apiPortalsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3c240beaa1cc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsCreateOrUpdateSample.ts @@ -0,0 +1,98 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AppResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new App or update an exiting App. + * + * @summary Create a new App or update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json + */ +async function appsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource: AppResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": { + clientId: undefined, + principalId: undefined + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": { + clientId: undefined, + principalId: undefined + } + } + }, + location: "eastus", + properties: { + addonConfigs: { + applicationConfigurationService: { + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs" + }, + serviceRegistry: { + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry" + } + }, + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: ["uid=0", "gid=0", "dir_mode=0777", "file_mode=0777"], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare" + }, + storageId: "myASCStorageID" + } + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + loadedCertificates: [ + { + loadTrustStore: false, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1" + }, + { + loadTrustStore: true, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2" + } + ], + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsDeleteSample.ts new file mode 100644 index 000000000000..920b3db7a2e7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete an App. + * + * @summary Operation to delete an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json + */ +async function appsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName + ); + console.log(result); +} + +appsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetResourceUploadUrlSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetResourceUploadUrlSample.ts new file mode 100644 index 000000000000..5e66e3e4298b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetResourceUploadUrlSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for an App, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json + */ +async function appsGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.getResourceUploadUrl( + resourceGroupName, + serviceName, + appName + ); + console.log(result); +} + +appsGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetSample.ts new file mode 100644 index 000000000000..c3bd2d0a9b2d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsGetSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an App and its properties. + * + * @summary Get an App and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json + */ +async function appsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.get(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsListSample.ts new file mode 100644 index 000000000000..8008f13c1edf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json + */ +async function appsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apps.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +appsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsSetActiveDeploymentsSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsSetActiveDeploymentsSample.ts new file mode 100644 index 000000000000..5d8d3632f5ef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsSetActiveDeploymentsSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ActiveDeploymentCollection, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Set existing Deployment under the app as active + * + * @summary Set existing Deployment under the app as active + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json + */ +async function appsSetActiveDeployments() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const activeDeploymentCollection: ActiveDeploymentCollection = { + activeDeploymentNames: ["default"] + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginSetActiveDeploymentsAndWait( + resourceGroupName, + serviceName, + appName, + activeDeploymentCollection + ); + console.log(result); +} + +appsSetActiveDeployments().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsUpdateSample.ts new file mode 100644 index 000000000000..b7832ad3e93f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AppResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting App. + * + * @summary Operation to update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json + */ +async function appsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource: AppResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": { + clientId: undefined, + principalId: undefined + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": { + clientId: undefined, + principalId: undefined + } + } + }, + location: "eastus", + properties: { + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: [], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare" + }, + storageId: "myASCStorageID" + } + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsValidateDomainSample.ts new file mode 100644 index 000000000000..57ccfc6fe72d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/appsValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the resource name is valid as well as not in use. + * + * @summary Check the resource name is valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json + */ +async function appsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.validateDomain( + resourceGroupName, + serviceName, + appName, + validatePayload + ); + console.log(result); +} + +appsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ada9dd2344fa --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsCreateOrUpdateSample.ts @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Binding or update an exiting Binding. + * + * @summary Create a new Binding or update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json + */ +async function bindingsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource: BindingResource = { + properties: { + bindingParameters: { apiType: "SQL", databaseName: "db1" }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1", + updatedAt: undefined + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsDeleteSample.ts new file mode 100644 index 000000000000..291d496c6aa5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Binding. + * + * @summary Operation to delete a Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json + */ +async function bindingsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsGetSample.ts new file mode 100644 index 000000000000..486acacdd6da --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Binding and its properties. + * + * @summary Get a Binding and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json + */ +async function bindingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.get( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsListSample.ts new file mode 100644 index 000000000000..54021ded717d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json + */ +async function bindingsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bindings.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +bindingsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsUpdateSample.ts new file mode 100644 index 000000000000..b28afb7c3c9d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/bindingsUpdateSample.ts @@ -0,0 +1,50 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Binding. + * + * @summary Operation to update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json + */ +async function bindingsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource: BindingResource = { + properties: { + bindingParameters: { apiType: "SQL", databaseName: "db1" }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + updatedAt: undefined + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolGetSample.ts new file mode 100644 index 000000000000..844751ab423e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get build service agent pool. + * + * @summary Get build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json + */ +async function buildServiceAgentPoolGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.get( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName + ); + console.log(result); +} + +buildServiceAgentPoolGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolListSample.ts new file mode 100644 index 000000000000..f3942f2d2ca2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List build service agent pool. + * + * @summary List build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json + */ +async function buildServiceAgentPoolList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceAgentPool.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceAgentPoolList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts new file mode 100644 index 000000000000..60740254be14 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuildServiceAgentPoolResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update build service agent pool. + * + * @summary Create or update build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json + */ +async function buildServiceAgentPoolUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const agentPoolResource: BuildServiceAgentPoolResource = { + properties: { poolSize: { name: "S3" } } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + agentPoolResource + ); + console.log(result); +} + +buildServiceAgentPoolUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9fd9f2e922e1 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuilderResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a KPack builder. + * + * @summary Create or update a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json + */ +async function buildServiceBuilderCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const builderResource: BuilderResource = { + properties: { + buildpackGroups: [ + { name: "mix", buildpacks: [{ id: "tanzu-buildpacks/java-azure" }] } + ], + stack: { id: "io.buildpacks.stacks.bionic", version: "base" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + builderResource + ); + console.log(result); +} + +buildServiceBuilderCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderDeleteSample.ts new file mode 100644 index 000000000000..a5c149c6519b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a KPack builder. + * + * @summary Delete a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json + */ +async function buildServiceBuilderDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderGetSample.ts new file mode 100644 index 000000000000..b0853f0483d9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack builder. + * + * @summary Get a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json + */ +async function buildServiceBuilderGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderListSample.ts new file mode 100644 index 000000000000..5ffeaee55c0a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceBuilderListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack builders result. + * + * @summary List KPack builders result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json + */ +async function buildServiceBuilderList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceBuilder.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceBuilderList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts new file mode 100644 index 000000000000..d291119ad979 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Build, AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a KPack build. + * + * @summary Create or update a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json + */ +async function buildServiceCreateOrUpdateBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const build: Build = { + properties: { + agentPool: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default", + builder: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default", + env: { environmentVariable: "test" }, + relativePath: + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.createOrUpdateBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + build + ); + console.log(result); +} + +buildServiceCreateOrUpdateBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultLogSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultLogSample.ts new file mode 100644 index 000000000000..0c35bdefbee4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultLogSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build result log download URL. + * + * @summary Get a KPack build result log download URL. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json + */ +async function buildServiceGetBuildResultLog() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResultLog( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResultLog().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultSample.ts new file mode 100644 index 000000000000..2c366f21cff6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildResultSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build result. + * + * @summary Get a KPack build result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json + */ +async function buildServiceGetBuildResult() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResult( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResult().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildSample.ts new file mode 100644 index 000000000000..b29ac5e0cecf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build. + * + * @summary Get a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json + */ +async function buildServiceGetBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName + ); + console.log(result); +} + +buildServiceGetBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildServiceSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildServiceSample.ts new file mode 100644 index 000000000000..f1db49f92e6e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetBuildServiceSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a build service resource. + * + * @summary Get a build service resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json + */ +async function buildServiceGetBuildService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildService( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetBuildService().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts new file mode 100644 index 000000000000..89243d370192 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for build service, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json + */ +async function buildServiceGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getResourceUploadUrl( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts new file mode 100644 index 000000000000..1a8f66c2b0c7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the supported buildpack resource. + * + * @summary Get the supported buildpack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json + */ +async function buildServiceGetSupportedBuildpack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildpackName = "tanzu-buildpacks-java-azure"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedBuildpack( + resourceGroupName, + serviceName, + buildServiceName, + buildpackName + ); + console.log(result); +} + +buildServiceGetSupportedBuildpack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedStackSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedStackSample.ts new file mode 100644 index 000000000000..c897a5e0467d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceGetSupportedStackSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the supported stack resource. + * + * @summary Get the supported stack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json + */ +async function buildServiceGetSupportedStack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const stackName = "io.buildpacks.stacks.bionic-base"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedStack( + resourceGroupName, + serviceName, + buildServiceName, + stackName + ); + console.log(result); +} + +buildServiceGetSupportedStack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildResultsSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildResultsSample.ts new file mode 100644 index 000000000000..999666a73cd4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildResultsSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack build results. + * + * @summary List KPack build results. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json + */ +async function buildServiceListBuildResults() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildResults( + resourceGroupName, + serviceName, + buildServiceName, + buildName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildResults().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildServicesSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildServicesSample.ts new file mode 100644 index 000000000000..30543425b720 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildServicesSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List build services resource. + * + * @summary List build services resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json + */ +async function buildServiceListBuildServices() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildServices( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildServices().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildsSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildsSample.ts new file mode 100644 index 000000000000..6c9ca0f68887 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListBuildsSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack builds. + * + * @summary List KPack builds. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json + */ +async function buildServiceListBuilds() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuilds( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuilds().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts new file mode 100644 index 000000000000..1327dde3c966 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get all supported buildpacks. + * + * @summary Get all supported buildpacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json + */ +async function buildServiceListSupportedBuildpacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedBuildpacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedBuildpacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedStacksSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedStacksSample.ts new file mode 100644 index 000000000000..40f88fa94e80 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildServiceListSupportedStacksSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get all supported stacks. + * + * @summary Get all supported stacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json + */ +async function buildServiceListSupportedStacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedStacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedStacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts new file mode 100644 index 000000000000..12ef67660337 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuildpackBindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a buildpack binding. + * + * @summary Create or update a buildpack binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json + */ +async function buildpackBindingCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const buildpackBinding: BuildpackBindingResource = { + properties: { + bindingType: "ApplicationInsights", + launchProperties: { + properties: { + abc: "def", + anyString: "any-string", + samplingRate: "12.0" + }, + secrets: { + connectionString: + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding + ); + console.log(result); +} + +buildpackBindingCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingDeleteSample.ts new file mode 100644 index 000000000000..3dcb2b246e74 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Buildpack Binding + * + * @summary Operation to delete a Buildpack Binding + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json + */ +async function buildpackBindingDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingGetSample.ts new file mode 100644 index 000000000000..a31bae78936c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingGetSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a buildpack binding by name. + * + * @summary Get a buildpack binding by name. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingListSample.ts new file mode 100644 index 000000000000..e951e71bb253 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/buildpackBindingListSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all buildpack bindings in a builder. + * + * @summary Handles requests to list all buildpack bindings in a builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildpackBinding.list( + resourceGroupName, + serviceName, + buildServiceName, + builderName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f25bf7117c35 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CertificateResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update certificate resource. + * + * @summary Create or update certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json + */ +async function certificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const certificateResource: CertificateResource = { + properties: { + type: "KeyVaultCertificate", + certVersion: "08a219d06d874795a96db47e06fbb01e", + keyVaultCertName: "mycert", + vaultUri: "https://myvault.vault.azure.net" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + certificateName, + certificateResource + ); + console.log(result); +} + +certificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesDeleteSample.ts new file mode 100644 index 000000000000..7db1c9877424 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the certificate resource. + * + * @summary Delete the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json + */ +async function certificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginDeleteAndWait( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesGetSample.ts new file mode 100644 index 000000000000..8ab5b74ef97d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the certificate resource. + * + * @summary Get the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json + */ +async function certificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.get( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesListSample.ts new file mode 100644 index 000000000000..da1d6022277e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/certificatesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all the certificates of one user. + * + * @summary List all the certificates of one user. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json + */ +async function certificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.certificates.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +certificatesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersGetSample.ts new file mode 100644 index 000000000000..71621a915cb9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersGetSample.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the config server and its properties. + * + * @summary Get the config server and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json + */ +async function configServersGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.get(resourceGroupName, serviceName); + console.log(result); +} + +configServersGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePatchSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePatchSample.ts new file mode 100644 index 000000000000..fc87b6343931 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePatchSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json + */ +async function configServersUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource: ConfigServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePutSample.ts new file mode 100644 index 000000000000..4bfd37686cfa --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersUpdatePutSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json + */ +async function configServersUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource: ConfigServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersValidateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersValidateSample.ts new file mode 100644 index 000000000000..6262cea8e5a0 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configServersValidateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerSettings, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if the config server settings are valid. + * + * @summary Check if the config server settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json + */ +async function configServersValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerSettings: ConfigServerSettings = { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginValidateAndWait( + resourceGroupName, + serviceName, + configServerSettings + ); + console.log(result); +} + +configServersValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f116ea415312 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigurationServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @summary Create the default Application Configuration Service or update the existing Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json + */ +async function configurationServicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const configurationServiceResource: ConfigurationServiceResource = { + properties: { + settings: { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository" + } + ] + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource + ); + console.log(result); +} + +configurationServicesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesDeleteSample.ts new file mode 100644 index 000000000000..8d65fa2afdb8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Application Configuration Service. + * + * @summary Disable the default Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json + */ +async function configurationServicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginDeleteAndWait( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesGetSample.ts new file mode 100644 index 000000000000..e66b0136e79f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Application Configuration Service and its properties. + * + * @summary Get the Application Configuration Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json + */ +async function configurationServicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.get( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesListSample.ts new file mode 100644 index 000000000000..7f2ddb25d9c2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json + */ +async function configurationServicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.configurationServices.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +configurationServicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesValidateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesValidateSample.ts new file mode 100644 index 000000000000..5b2328e2ed29 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/configurationServicesValidateSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigurationServiceSettings, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if the Application Configuration Service settings are valid. + * + * @summary Check if the Application Configuration Service settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json + */ +async function configurationServicesValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const settings: ConfigurationServiceSettings = { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginValidateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + settings + ); + console.log(result); +} + +configurationServicesValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7eed0cd3c7fe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update custom domain of one lifecycle application. + * + * @summary Create or update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json + */ +async function customDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource: CustomDomainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsDeleteSample.ts new file mode 100644 index 000000000000..cba07e81cbcd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the custom domain of one lifecycle application. + * + * @summary Delete the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json + */ +async function customDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsGetSample.ts new file mode 100644 index 000000000000..d244db1582bc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the custom domain of one lifecycle application. + * + * @summary Get the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json + */ +async function customDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.get( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsListSample.ts new file mode 100644 index 000000000000..c950368ef7c8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the custom domains of one lifecycle application. + * + * @summary List the custom domains of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json + */ +async function customDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.customDomains.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +customDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsUpdateSample.ts new file mode 100644 index 000000000000..f4fbc2f6dbfe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/customDomainsUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update custom domain of one lifecycle application. + * + * @summary Update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json + */ +async function customDomainsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource: CustomDomainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..3df4eba418da --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts @@ -0,0 +1,110 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DeploymentResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json + */ +async function deploymentsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + deploymentSettings: { + addonConfigs: { + applicationConfigurationService: { patterns: ["mypattern"] } + }, + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" } + }, + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0" + } + }, + sku: { name: "S0", capacity: 1, tier: "Standard" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json + */ +async function deploymentsCreateOrUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + deploymentSettings: { + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" } + }, + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myContainerImage:v1", + imageRegistryCredential: { + password: "myPassword", + username: "myUsername" + }, + languageFramework: "springboot", + server: "myacr.azurecr.io" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts new file mode 100644 index 000000000000..f39c17972300 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Deployment. + * + * @summary Operation to delete a Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json + */ +async function deploymentsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts new file mode 100644 index 000000000000..c759bbbe0cc9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generate Heap Dump + * + * @summary Generate Heap Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateHeapDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts new file mode 100644 index 000000000000..57fc3c7ae66b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generate Thread Dump + * + * @summary Generate Thread Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateThreadDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetLogFileUrlSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetLogFileUrlSample.ts new file mode 100644 index 000000000000..bfce5700d2dd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetLogFileUrlSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get deployment log file URL + * + * @summary Get deployment log file URL + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json + */ +async function deploymentsGetLogFileUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.getLogFileUrl( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetLogFileUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetSample.ts new file mode 100644 index 000000000000..bd658b648e98 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsGetSample.ts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json + */ +async function deploymentsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGet().catch(console.error); + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get_CustomContainer.json + */ +async function deploymentsGetCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListForClusterSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListForClusterSample.ts new file mode 100644 index 000000000000..bb04c2847be5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListForClusterSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List deployments for a certain service + * + * @summary List deployments for a certain service + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json + */ +async function deploymentsListForCluster() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.listForCluster( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsListForCluster().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListSample.ts new file mode 100644 index 000000000000..aa950eed396f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json + */ +async function deploymentsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsRestartSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsRestartSample.ts new file mode 100644 index 000000000000..07493d014386 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsRestartSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restart the deployment. + * + * @summary Restart the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json + */ +async function deploymentsRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginRestartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsRestart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartJfrSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartJfrSample.ts new file mode 100644 index 000000000000..35e6b3e2f8ab --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartJfrSample.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start JFR + * + * @summary Start JFR + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json + */ +async function deploymentsStartJfr() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + duration: "60s", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartJFRAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsStartJfr().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartSample.ts new file mode 100644 index 000000000000..ec8f56ffe3ff --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStartSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start the deployment. + * + * @summary Start the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json + */ +async function deploymentsStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStopSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStopSample.ts new file mode 100644 index 000000000000..24a9fd9a03c1 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsStopSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop the deployment. + * + * @summary Stop the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json + */ +async function deploymentsStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStopAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsUpdateSample.ts new file mode 100644 index 000000000000..ad32420f9caf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/deploymentsUpdateSample.ts @@ -0,0 +1,97 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DeploymentResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json + */ +async function deploymentsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdate().catch(console.error); + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update_CustomContainer.json + */ +async function deploymentsUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myNewContainerImage:v1", + imageRegistryCredential: { + password: "", + username: "myNewUsername" + }, + server: "mynewacr.azurecr.io" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9fdc049cfe21 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayCustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the Spring Cloud Gateway custom domain. + * + * @summary Create or update the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json + */ +async function gatewayCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const gatewayCustomDomainResource: GatewayCustomDomainResource = { + properties: { thumbprint: "*" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName, + gatewayCustomDomainResource + ); + console.log(result); +} + +gatewayCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..857cdac7ecec --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway custom domain. + * + * @summary Delete the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json + */ +async function gatewayCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsGetSample.ts new file mode 100644 index 000000000000..b2d1e9a59889 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway custom domain. + * + * @summary Get the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json + */ +async function gatewayCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.get( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsListSample.ts new file mode 100644 index 000000000000..00fd3ad2f5e2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayCustomDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway custom domains. + * + * @summary Handle requests to list all Spring Cloud Gateway custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json + */ +async function gatewayCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayCustomDomains.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..88ac2615cf9b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayRouteConfigResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @summary Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json + */ +async function gatewayRouteConfigsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const gatewayRouteConfigResource: GatewayRouteConfigResource = { + properties: { + appResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp", + routes: [ + { + filters: ["StripPrefix=2", "RateLimit=1,1s"], + predicates: ["Path=/api5/customer/**"], + ssoEnabled: true, + title: "myApp route config" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + gatewayRouteConfigResource + ); + console.log(result); +} + +gatewayRouteConfigsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts new file mode 100644 index 000000000000..5f973acfb703 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway route config. + * + * @summary Delete the Spring Cloud Gateway route config. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json + */ +async function gatewayRouteConfigsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsGetSample.ts new file mode 100644 index 000000000000..022ec6d0935f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway route configs. + * + * @summary Get the Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json + */ +async function gatewayRouteConfigsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.get( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsListSample.ts new file mode 100644 index 000000000000..9dd386692c90 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewayRouteConfigsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway route configs. + * + * @summary Handle requests to list all Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json + */ +async function gatewayRouteConfigsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayRouteConfigs.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayRouteConfigsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8e710655cd82 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysCreateOrUpdateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @summary Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json + */ +async function gatewaysCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const gatewayResource: GatewayResource = { + properties: { public: true, resourceRequests: { cpu: "1", memory: "1G" } }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + gatewayResource + ); + console.log(result); +} + +gatewaysCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysDeleteSample.ts new file mode 100644 index 000000000000..47b1e99706c2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Spring Cloud Gateway. + * + * @summary Disable the default Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json + */ +async function gatewaysDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysGetSample.ts new file mode 100644 index 000000000000..b9c4aaa5bd35 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway and its properties. + * + * @summary Get the Spring Cloud Gateway and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json + */ +async function gatewaysGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.get( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysListSample.ts new file mode 100644 index 000000000000..037edc040095 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json + */ +async function gatewaysList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gateways.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +gatewaysList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysValidateDomainSample.ts new file mode 100644 index 000000000000..2b3c3fb51905 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/gatewaysValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json + */ +async function gatewaysValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.validateDomain( + resourceGroupName, + serviceName, + gatewayName, + validatePayload + ); + console.log(result); +} + +gatewaysValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsGetSample.ts new file mode 100644 index 000000000000..6e1e97242b05 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Monitoring Setting and its properties. + * + * @summary Get the Monitoring Setting and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json + */ +async function monitoringSettingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.get( + resourceGroupName, + serviceName + ); + console.log(result); +} + +monitoringSettingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts new file mode 100644 index 000000000000..a0e8ec0e5c37 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MonitoringSettingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json + */ +async function monitoringSettingsUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource: MonitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePutSample.ts new file mode 100644 index 000000000000..da94a4ed4bef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/monitoringSettingsUpdatePutSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MonitoringSettingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json + */ +async function monitoringSettingsUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource: MonitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..cb8183f68b16 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts new file mode 100644 index 000000000000..232decc28d89 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @summary Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json + */ +async function runtimeVersionsListRuntimeVersions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.runtimeVersions.listRuntimeVersions(); + console.log(result); +} + +runtimeVersionsListRuntimeVersions().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..89cfc1eb1289 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Service Registry or update the existing Service Registry. + * + * @summary Create the default Service Registry or update the existing Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json + */ +async function serviceRegistriesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesDeleteSample.ts new file mode 100644 index 000000000000..7777e2649892 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Service Registry. + * + * @summary Disable the default Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json + */ +async function serviceRegistriesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginDeleteAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesGetSample.ts new file mode 100644 index 000000000000..8e2c5b28bdc9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Service Registry and its properties. + * + * @summary Get the Service Registry and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json + */ +async function serviceRegistriesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.get( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesListSample.ts new file mode 100644 index 000000000000..3194e4603279 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/serviceRegistriesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json + */ +async function serviceRegistriesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.serviceRegistries.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +serviceRegistriesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCheckNameAvailabilitySample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..e5a0b6d4d875 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCheckNameAvailabilitySample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + NameAvailabilityParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json + */ +async function servicesCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const availabilityParameters: NameAvailabilityParameters = { + name: "myservice", + type: "Microsoft.AppPlatform/Spring" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.checkNameAvailability( + location, + availabilityParameters + ); + console.log(result); +} + +servicesCheckNameAvailability().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ba959e2e0685 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts @@ -0,0 +1,81 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json + */ +async function servicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json + */ +async function servicesCreateOrUpdateVNetInjection() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: { + networkProfile: { + appNetworkResourceGroup: "my-app-network-rg", + appSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps", + serviceCidr: "10.8.0.0/16,10.244.0.0/16,10.245.0.1/16", + serviceRuntimeNetworkResourceGroup: "my-service-runtime-network-rg", + serviceRuntimeSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime" + } + }, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdateVNetInjection().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDeleteSample.ts new file mode 100644 index 000000000000..cec8f52a524e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Service. + * + * @summary Operation to delete a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json + */ +async function servicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginDeleteAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDisableTestEndpointSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDisableTestEndpointSample.ts new file mode 100644 index 000000000000..85ac01c403fc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesDisableTestEndpointSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable test endpoint functionality for a Service. + * + * @summary Disable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json + */ +async function servicesDisableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.disableTestEndpoint( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesDisableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesEnableTestEndpointSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesEnableTestEndpointSample.ts new file mode 100644 index 000000000000..f00ea74e8464 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesEnableTestEndpointSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Enable test endpoint functionality for a Service. + * + * @summary Enable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json + */ +async function servicesEnableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.enableTestEndpoint( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesEnableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesGetSample.ts new file mode 100644 index 000000000000..5dbe592a0ecd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesGetSample.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Service and its properties. + * + * @summary Get a Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json + */ +async function servicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.get(resourceGroupName, serviceName); + console.log(result); +} + +servicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts new file mode 100644 index 000000000000..994fda4e5fa4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json + */ +async function servicesListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +servicesListBySubscription().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListSample.ts new file mode 100644 index 000000000000..b1dfae56602c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json + */ +async function servicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +servicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListTestKeysSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListTestKeysSample.ts new file mode 100644 index 000000000000..9ab4ed1af0f2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesListTestKeysSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List test keys for a Service. + * + * @summary List test keys for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json + */ +async function servicesListTestKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.listTestKeys( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesListTestKeys().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesRegenerateTestKeySample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesRegenerateTestKeySample.ts new file mode 100644 index 000000000000..7cefb695c7bc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesRegenerateTestKeySample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RegenerateTestKeyRequestPayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Regenerate a test key for a Service. + * + * @summary Regenerate a test key for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json + */ +async function servicesRegenerateTestKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const regenerateTestKeyRequest: RegenerateTestKeyRequestPayload = { + keyType: "Primary" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.regenerateTestKey( + resourceGroupName, + serviceName, + regenerateTestKeyRequest + ); + console.log(result); +} + +servicesRegenerateTestKey().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStartSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStartSample.ts new file mode 100644 index 000000000000..05a7cacc4767 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStartSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start a Service. + * + * @summary Start a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json + */ +async function servicesStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStartAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStopSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStopSample.ts new file mode 100644 index 000000000000..3bd4b6495977 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesStopSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop a Service. + * + * @summary Stop a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json + */ +async function servicesStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStopAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesUpdateSample.ts new file mode 100644 index 000000000000..d989c2a742ef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/servicesUpdateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Service. + * + * @summary Operation to update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json + */ +async function servicesUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/skusListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/skusListSample.ts new file mode 100644 index 000000000000..8eb9edda85db --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/skusListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available skus of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json + */ +async function skusList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.skus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +skusList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..485e96fb0705 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesCreateOrUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update storage resource. + * + * @summary Create or update storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json + */ +async function storagesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const storageResource: StorageResource = { + properties: { + accountKey: "account-key-of-storage-account", + accountName: "storage-account-name", + storageType: "StorageAccount" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + storageName, + storageResource + ); + console.log(result); +} + +storagesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesDeleteSample.ts new file mode 100644 index 000000000000..7c98f959e31d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the storage resource. + * + * @summary Delete the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json + */ +async function storagesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginDeleteAndWait( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesGetSample.ts new file mode 100644 index 000000000000..ea9e5d32550c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the storage resource. + * + * @summary Get the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json + */ +async function storagesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.get( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesListSample.ts new file mode 100644 index 000000000000..6c6a99170421 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/src/storagesListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all the storages of one Azure Spring Cloud instance. + * + * @summary List all the storages of one Azure Spring Cloud instance. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json + */ +async function storagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storages.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +storagesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/tsconfig.json b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v1-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/README.md b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/README.md new file mode 100644 index 000000000000..1f02629310a4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/README.md @@ -0,0 +1,282 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [apiPortalCustomDomainsCreateOrUpdateSample.js][apiportalcustomdomainscreateorupdatesample] | Create or update the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json | +| [apiPortalCustomDomainsDeleteSample.js][apiportalcustomdomainsdeletesample] | Delete the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json | +| [apiPortalCustomDomainsGetSample.js][apiportalcustomdomainsgetsample] | Get the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json | +| [apiPortalCustomDomainsListSample.js][apiportalcustomdomainslistsample] | Handle requests to list all API portal custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json | +| [apiPortalsCreateOrUpdateSample.js][apiportalscreateorupdatesample] | Create the default API portal or update the existing API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json | +| [apiPortalsDeleteSample.js][apiportalsdeletesample] | Delete the default API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json | +| [apiPortalsGetSample.js][apiportalsgetsample] | Get the API portal and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json | +| [apiPortalsListSample.js][apiportalslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json | +| [apiPortalsValidateDomainSample.js][apiportalsvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json | +| [appsCreateOrUpdateSample.js][appscreateorupdatesample] | Create a new App or update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json | +| [appsDeleteSample.js][appsdeletesample] | Operation to delete an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json | +| [appsGetResourceUploadUrlSample.js][appsgetresourceuploadurlsample] | Get an resource upload URL for an App, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json | +| [appsGetSample.js][appsgetsample] | Get an App and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json | +| [appsListSample.js][appslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json | +| [appsSetActiveDeploymentsSample.js][appssetactivedeploymentssample] | Set existing Deployment under the app as active x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json | +| [appsUpdateSample.js][appsupdatesample] | Operation to update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json | +| [appsValidateDomainSample.js][appsvalidatedomainsample] | Check the resource name is valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json | +| [bindingsCreateOrUpdateSample.js][bindingscreateorupdatesample] | Create a new Binding or update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json | +| [bindingsDeleteSample.js][bindingsdeletesample] | Operation to delete a Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json | +| [bindingsGetSample.js][bindingsgetsample] | Get a Binding and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json | +| [bindingsListSample.js][bindingslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json | +| [bindingsUpdateSample.js][bindingsupdatesample] | Operation to update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json | +| [buildServiceAgentPoolGetSample.js][buildserviceagentpoolgetsample] | Get build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json | +| [buildServiceAgentPoolListSample.js][buildserviceagentpoollistsample] | List build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json | +| [buildServiceAgentPoolUpdatePutSample.js][buildserviceagentpoolupdateputsample] | Create or update build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json | +| [buildServiceBuilderCreateOrUpdateSample.js][buildservicebuildercreateorupdatesample] | Create or update a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json | +| [buildServiceBuilderDeleteSample.js][buildservicebuilderdeletesample] | Delete a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json | +| [buildServiceBuilderGetSample.js][buildservicebuildergetsample] | Get a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json | +| [buildServiceBuilderListSample.js][buildservicebuilderlistsample] | List KPack builders result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json | +| [buildServiceCreateOrUpdateBuildSample.js][buildservicecreateorupdatebuildsample] | Create or update a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json | +| [buildServiceGetBuildResultLogSample.js][buildservicegetbuildresultlogsample] | Get a KPack build result log download URL. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json | +| [buildServiceGetBuildResultSample.js][buildservicegetbuildresultsample] | Get a KPack build result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json | +| [buildServiceGetBuildSample.js][buildservicegetbuildsample] | Get a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json | +| [buildServiceGetBuildServiceSample.js][buildservicegetbuildservicesample] | Get a build service resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json | +| [buildServiceGetResourceUploadUrlSample.js][buildservicegetresourceuploadurlsample] | Get an resource upload URL for build service, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json | +| [buildServiceGetSupportedBuildpackSample.js][buildservicegetsupportedbuildpacksample] | Get the supported buildpack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json | +| [buildServiceGetSupportedStackSample.js][buildservicegetsupportedstacksample] | Get the supported stack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json | +| [buildServiceListBuildResultsSample.js][buildservicelistbuildresultssample] | List KPack build results. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json | +| [buildServiceListBuildServicesSample.js][buildservicelistbuildservicessample] | List build services resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json | +| [buildServiceListBuildsSample.js][buildservicelistbuildssample] | List KPack builds. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json | +| [buildServiceListSupportedBuildpacksSample.js][buildservicelistsupportedbuildpackssample] | Get all supported buildpacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json | +| [buildServiceListSupportedStacksSample.js][buildservicelistsupportedstackssample] | Get all supported stacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json | +| [buildpackBindingCreateOrUpdateSample.js][buildpackbindingcreateorupdatesample] | Create or update a buildpack binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json | +| [buildpackBindingDeleteSample.js][buildpackbindingdeletesample] | Operation to delete a Buildpack Binding x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json | +| [buildpackBindingGetSample.js][buildpackbindinggetsample] | Get a buildpack binding by name. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json | +| [buildpackBindingListSample.js][buildpackbindinglistsample] | Handles requests to list all buildpack bindings in a builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json | +| [certificatesCreateOrUpdateSample.js][certificatescreateorupdatesample] | Create or update certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json | +| [certificatesDeleteSample.js][certificatesdeletesample] | Delete the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json | +| [certificatesGetSample.js][certificatesgetsample] | Get the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json | +| [certificatesListSample.js][certificateslistsample] | List all the certificates of one user. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json | +| [configServersGetSample.js][configserversgetsample] | Get the config server and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json | +| [configServersUpdatePatchSample.js][configserversupdatepatchsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json | +| [configServersUpdatePutSample.js][configserversupdateputsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json | +| [configServersValidateSample.js][configserversvalidatesample] | Check if the config server settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json | +| [configurationServicesCreateOrUpdateSample.js][configurationservicescreateorupdatesample] | Create the default Application Configuration Service or update the existing Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json | +| [configurationServicesDeleteSample.js][configurationservicesdeletesample] | Disable the default Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json | +| [configurationServicesGetSample.js][configurationservicesgetsample] | Get the Application Configuration Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json | +| [configurationServicesListSample.js][configurationserviceslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json | +| [configurationServicesValidateSample.js][configurationservicesvalidatesample] | Check if the Application Configuration Service settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json | +| [customDomainsCreateOrUpdateSample.js][customdomainscreateorupdatesample] | Create or update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json | +| [customDomainsDeleteSample.js][customdomainsdeletesample] | Delete the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json | +| [customDomainsGetSample.js][customdomainsgetsample] | Get the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json | +| [customDomainsListSample.js][customdomainslistsample] | List the custom domains of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json | +| [customDomainsUpdateSample.js][customdomainsupdatesample] | Update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json | +| [deploymentsCreateOrUpdateSample.js][deploymentscreateorupdatesample] | Create a new Deployment or update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json | +| [deploymentsDeleteSample.js][deploymentsdeletesample] | Operation to delete a Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json | +| [deploymentsGenerateHeapDumpSample.js][deploymentsgenerateheapdumpsample] | Generate Heap Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json | +| [deploymentsGenerateThreadDumpSample.js][deploymentsgeneratethreaddumpsample] | Generate Thread Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json | +| [deploymentsGetLogFileUrlSample.js][deploymentsgetlogfileurlsample] | Get deployment log file URL x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json | +| [deploymentsGetSample.js][deploymentsgetsample] | Get a Deployment and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json | +| [deploymentsListForClusterSample.js][deploymentslistforclustersample] | List deployments for a certain service x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json | +| [deploymentsListSample.js][deploymentslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json | +| [deploymentsRestartSample.js][deploymentsrestartsample] | Restart the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json | +| [deploymentsStartJfrSample.js][deploymentsstartjfrsample] | Start JFR x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json | +| [deploymentsStartSample.js][deploymentsstartsample] | Start the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json | +| [deploymentsStopSample.js][deploymentsstopsample] | Stop the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json | +| [deploymentsUpdateSample.js][deploymentsupdatesample] | Operation to update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json | +| [gatewayCustomDomainsCreateOrUpdateSample.js][gatewaycustomdomainscreateorupdatesample] | Create or update the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json | +| [gatewayCustomDomainsDeleteSample.js][gatewaycustomdomainsdeletesample] | Delete the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json | +| [gatewayCustomDomainsGetSample.js][gatewaycustomdomainsgetsample] | Get the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json | +| [gatewayCustomDomainsListSample.js][gatewaycustomdomainslistsample] | Handle requests to list all Spring Cloud Gateway custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json | +| [gatewayRouteConfigsCreateOrUpdateSample.js][gatewayrouteconfigscreateorupdatesample] | Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json | +| [gatewayRouteConfigsDeleteSample.js][gatewayrouteconfigsdeletesample] | Delete the Spring Cloud Gateway route config. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json | +| [gatewayRouteConfigsGetSample.js][gatewayrouteconfigsgetsample] | Get the Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json | +| [gatewayRouteConfigsListSample.js][gatewayrouteconfigslistsample] | Handle requests to list all Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json | +| [gatewaysCreateOrUpdateSample.js][gatewayscreateorupdatesample] | Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json | +| [gatewaysDeleteSample.js][gatewaysdeletesample] | Disable the default Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json | +| [gatewaysGetSample.js][gatewaysgetsample] | Get the Spring Cloud Gateway and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json | +| [gatewaysListSample.js][gatewayslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json | +| [gatewaysValidateDomainSample.js][gatewaysvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json | +| [monitoringSettingsGetSample.js][monitoringsettingsgetsample] | Get the Monitoring Setting and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json | +| [monitoringSettingsUpdatePatchSample.js][monitoringsettingsupdatepatchsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json | +| [monitoringSettingsUpdatePutSample.js][monitoringsettingsupdateputsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json | +| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json | +| [runtimeVersionsListRuntimeVersionsSample.js][runtimeversionslistruntimeversionssample] | Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json | +| [serviceRegistriesCreateOrUpdateSample.js][serviceregistriescreateorupdatesample] | Create the default Service Registry or update the existing Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json | +| [serviceRegistriesDeleteSample.js][serviceregistriesdeletesample] | Disable the default Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json | +| [serviceRegistriesGetSample.js][serviceregistriesgetsample] | Get the Service Registry and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json | +| [serviceRegistriesListSample.js][serviceregistrieslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json | +| [servicesCheckNameAvailabilitySample.js][serviceschecknameavailabilitysample] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json | +| [servicesCreateOrUpdateSample.js][servicescreateorupdatesample] | Create a new Service or update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json | +| [servicesDeleteSample.js][servicesdeletesample] | Operation to delete a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json | +| [servicesDisableTestEndpointSample.js][servicesdisabletestendpointsample] | Disable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json | +| [servicesEnableTestEndpointSample.js][servicesenabletestendpointsample] | Enable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json | +| [servicesGetSample.js][servicesgetsample] | Get a Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json | +| [servicesListBySubscriptionSample.js][serviceslistbysubscriptionsample] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json | +| [servicesListSample.js][serviceslistsample] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json | +| [servicesListTestKeysSample.js][serviceslisttestkeyssample] | List test keys for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json | +| [servicesRegenerateTestKeySample.js][servicesregeneratetestkeysample] | Regenerate a test key for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json | +| [servicesStartSample.js][servicesstartsample] | Start a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json | +| [servicesStopSample.js][servicesstopsample] | Stop a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json | +| [servicesUpdateSample.js][servicesupdatesample] | Operation to update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json | +| [skusListSample.js][skuslistsample] | Lists all of the available skus of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json | +| [storagesCreateOrUpdateSample.js][storagescreateorupdatesample] | Create or update storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json | +| [storagesDeleteSample.js][storagesdeletesample] | Delete the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json | +| [storagesGetSample.js][storagesgetsample] | Get the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json | +| [storagesListSample.js][storageslistsample] | List all the storages of one Azure Spring Cloud instance. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[apiportalcustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js +[apiportalcustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsDeleteSample.js +[apiportalcustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsGetSample.js +[apiportalcustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsListSample.js +[apiportalscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsCreateOrUpdateSample.js +[apiportalsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsDeleteSample.js +[apiportalsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsGetSample.js +[apiportalslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsListSample.js +[apiportalsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsValidateDomainSample.js +[appscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsCreateOrUpdateSample.js +[appsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsDeleteSample.js +[appsgetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetResourceUploadUrlSample.js +[appsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetSample.js +[appslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsListSample.js +[appssetactivedeploymentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsSetActiveDeploymentsSample.js +[appsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsUpdateSample.js +[appsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsValidateDomainSample.js +[bindingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsCreateOrUpdateSample.js +[bindingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsDeleteSample.js +[bindingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsGetSample.js +[bindingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsListSample.js +[bindingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsUpdateSample.js +[buildserviceagentpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolGetSample.js +[buildserviceagentpoollistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolListSample.js +[buildserviceagentpoolupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolUpdatePutSample.js +[buildservicebuildercreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js +[buildservicebuilderdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderDeleteSample.js +[buildservicebuildergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderGetSample.js +[buildservicebuilderlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderListSample.js +[buildservicecreateorupdatebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceCreateOrUpdateBuildSample.js +[buildservicegetbuildresultlogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultLogSample.js +[buildservicegetbuildresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultSample.js +[buildservicegetbuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildSample.js +[buildservicegetbuildservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildServiceSample.js +[buildservicegetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetResourceUploadUrlSample.js +[buildservicegetsupportedbuildpacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedBuildpackSample.js +[buildservicegetsupportedstacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedStackSample.js +[buildservicelistbuildresultssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildResultsSample.js +[buildservicelistbuildservicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildServicesSample.js +[buildservicelistbuildssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildsSample.js +[buildservicelistsupportedbuildpackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedBuildpacksSample.js +[buildservicelistsupportedstackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedStacksSample.js +[buildpackbindingcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingCreateOrUpdateSample.js +[buildpackbindingdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingDeleteSample.js +[buildpackbindinggetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingGetSample.js +[buildpackbindinglistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingListSample.js +[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesCreateOrUpdateSample.js +[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesDeleteSample.js +[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesGetSample.js +[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesListSample.js +[configserversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersGetSample.js +[configserversupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePatchSample.js +[configserversupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePutSample.js +[configserversvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersValidateSample.js +[configurationservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesCreateOrUpdateSample.js +[configurationservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesDeleteSample.js +[configurationservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesGetSample.js +[configurationserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesListSample.js +[configurationservicesvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesValidateSample.js +[customdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsCreateOrUpdateSample.js +[customdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsDeleteSample.js +[customdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsGetSample.js +[customdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsListSample.js +[customdomainsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsUpdateSample.js +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsCreateOrUpdateSample.js +[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsDeleteSample.js +[deploymentsgenerateheapdumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateHeapDumpSample.js +[deploymentsgeneratethreaddumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateThreadDumpSample.js +[deploymentsgetlogfileurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetLogFileUrlSample.js +[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetSample.js +[deploymentslistforclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListForClusterSample.js +[deploymentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListSample.js +[deploymentsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsRestartSample.js +[deploymentsstartjfrsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartJfrSample.js +[deploymentsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartSample.js +[deploymentsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStopSample.js +[deploymentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsUpdateSample.js +[gatewaycustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js +[gatewaycustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsDeleteSample.js +[gatewaycustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsGetSample.js +[gatewaycustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsListSample.js +[gatewayrouteconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js +[gatewayrouteconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsDeleteSample.js +[gatewayrouteconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsGetSample.js +[gatewayrouteconfigslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsListSample.js +[gatewayscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysCreateOrUpdateSample.js +[gatewaysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysDeleteSample.js +[gatewaysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysGetSample.js +[gatewayslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysListSample.js +[gatewaysvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysValidateDomainSample.js +[monitoringsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsGetSample.js +[monitoringsettingsupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePatchSample.js +[monitoringsettingsupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePutSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/operationsListSample.js +[runtimeversionslistruntimeversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js +[serviceregistriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesCreateOrUpdateSample.js +[serviceregistriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesDeleteSample.js +[serviceregistriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesGetSample.js +[serviceregistrieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesListSample.js +[serviceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCheckNameAvailabilitySample.js +[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCreateOrUpdateSample.js +[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDeleteSample.js +[servicesdisabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDisableTestEndpointSample.js +[servicesenabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesEnableTestEndpointSample.js +[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesGetSample.js +[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListBySubscriptionSample.js +[serviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListSample.js +[serviceslisttestkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListTestKeysSample.js +[servicesregeneratetestkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesRegenerateTestKeySample.js +[servicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStartSample.js +[servicesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStopSample.js +[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesUpdateSample.js +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/skusListSample.js +[storagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesCreateOrUpdateSample.js +[storagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesDeleteSample.js +[storagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesGetSample.js +[storageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesListSample.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appplatform?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform/README.md diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js new file mode 100644 index 000000000000..2969c01e9364 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsCreateOrUpdateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update the API portal custom domain. + * + * @summary Create or update the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json + */ +async function apiPortalCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const apiPortalCustomDomainResource = { + properties: { thumbprint: "*" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName, + apiPortalCustomDomainResource + ); + console.log(result); +} + +apiPortalCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsDeleteSample.js new file mode 100644 index 000000000000..f67bb2362dfe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the API portal custom domain. + * + * @summary Delete the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json + */ +async function apiPortalCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsGetSample.js new file mode 100644 index 000000000000..f287cde8ecbc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the API portal custom domain. + * + * @summary Get the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json + */ +async function apiPortalCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.get( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsListSample.js new file mode 100644 index 000000000000..ab5d855f427b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalCustomDomainsListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handle requests to list all API portal custom domains. + * + * @summary Handle requests to list all API portal custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json + */ +async function apiPortalCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortalCustomDomains.list( + resourceGroupName, + serviceName, + apiPortalName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsCreateOrUpdateSample.js new file mode 100644 index 000000000000..25b84b146b66 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsCreateOrUpdateSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default API portal or update the existing API portal. + * + * @summary Create the default API portal or update the existing API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json + */ +async function apiPortalsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const apiPortalResource = { + properties: { + gatewayIds: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default", + ], + public: true, + }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + apiPortalResource + ); + console.log(result); +} + +apiPortalsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsDeleteSample.js new file mode 100644 index 000000000000..ff79c5a0eedf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the default API portal. + * + * @summary Delete the default API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json + */ +async function apiPortalsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsGetSample.js new file mode 100644 index 000000000000..d3478026dca9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the API portal and its properties. + * + * @summary Get the API portal and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json + */ +async function apiPortalsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.get(resourceGroupName, serviceName, apiPortalName); + console.log(result); +} + +apiPortalsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsListSample.js new file mode 100644 index 000000000000..07023c1e9b3d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json + */ +async function apiPortalsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortals.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsValidateDomainSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsValidateDomainSample.js new file mode 100644 index 000000000000..47109a9e94e6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/apiPortalsValidateDomainSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json + */ +async function apiPortalsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const validatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.validateDomain( + resourceGroupName, + serviceName, + apiPortalName, + validatePayload + ); + console.log(result); +} + +apiPortalsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsCreateOrUpdateSample.js new file mode 100644 index 000000000000..b3c91fe71173 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsCreateOrUpdateSample.js @@ -0,0 +1,99 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new App or update an exiting App. + * + * @summary Create a new App or update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json + */ +async function appsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": + { + clientId: undefined, + principalId: undefined, + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": + { + clientId: undefined, + principalId: undefined, + }, + }, + }, + location: "eastus", + properties: { + addonConfigs: { + applicationConfigurationService: { + resourceId: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", + }, + }, + serviceRegistry: { + resourceId: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", + }, + }, + }, + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: ["uid=0", "gid=0", "dir_mode=0777", "file_mode=0777"], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare", + }, + storageId: "myASCStorageID", + }, + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + loadedCertificates: [ + { + loadTrustStore: false, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1", + }, + { + loadTrustStore: true, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2", + }, + ], + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsDeleteSample.js new file mode 100644 index 000000000000..04b07c67c3bd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsDeleteSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete an App. + * + * @summary Operation to delete an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json + */ +async function appsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginDeleteAndWait(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetResourceUploadUrlSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetResourceUploadUrlSample.js new file mode 100644 index 000000000000..e97b2c87f738 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetResourceUploadUrlSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for an App, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json + */ +async function appsGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.getResourceUploadUrl(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetSample.js new file mode 100644 index 000000000000..0c3aa10a441d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get an App and its properties. + * + * @summary Get an App and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json + */ +async function appsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.get(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsListSample.js new file mode 100644 index 000000000000..f120b183cd96 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json + */ +async function appsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apps.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +appsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsSetActiveDeploymentsSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsSetActiveDeploymentsSample.js new file mode 100644 index 000000000000..90c0541ca06b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsSetActiveDeploymentsSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Set existing Deployment under the app as active + * + * @summary Set existing Deployment under the app as active + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json + */ +async function appsSetActiveDeployments() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const activeDeploymentCollection = { + activeDeploymentNames: ["default"], + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginSetActiveDeploymentsAndWait( + resourceGroupName, + serviceName, + appName, + activeDeploymentCollection + ); + console.log(result); +} + +appsSetActiveDeployments().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsUpdateSample.js new file mode 100644 index 000000000000..e30b91c0beae --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsUpdateSample.js @@ -0,0 +1,75 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting App. + * + * @summary Operation to update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json + */ +async function appsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": + { + clientId: undefined, + principalId: undefined, + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": + { + clientId: undefined, + principalId: undefined, + }, + }, + }, + location: "eastus", + properties: { + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: [], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare", + }, + storageId: "myASCStorageID", + }, + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsValidateDomainSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsValidateDomainSample.js new file mode 100644 index 000000000000..d6eb00918760 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/appsValidateDomainSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check the resource name is valid as well as not in use. + * + * @summary Check the resource name is valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json + */ +async function appsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const validatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.validateDomain( + resourceGroupName, + serviceName, + appName, + validatePayload + ); + console.log(result); +} + +appsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsCreateOrUpdateSample.js new file mode 100644 index 000000000000..5eb682035d2e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsCreateOrUpdateSample.js @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new Binding or update an exiting Binding. + * + * @summary Create a new Binding or update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json + */ +async function bindingsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource = { + properties: { + bindingParameters: { + apiType: { + name: "SQL", + }, + databaseName: { + name: "db1", + }, + }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1", + updatedAt: undefined, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsDeleteSample.js new file mode 100644 index 000000000000..b66d00e403d9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Binding. + * + * @summary Operation to delete a Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json + */ +async function bindingsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsGetSample.js new file mode 100644 index 000000000000..45c816f6d173 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsGetSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a Binding and its properties. + * + * @summary Get a Binding and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json + */ +async function bindingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.get(resourceGroupName, serviceName, appName, bindingName); + console.log(result); +} + +bindingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsListSample.js new file mode 100644 index 000000000000..55ea16d417aa --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsListSample.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json + */ +async function bindingsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bindings.list(resourceGroupName, serviceName, appName)) { + resArray.push(item); + } + console.log(resArray); +} + +bindingsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsUpdateSample.js new file mode 100644 index 000000000000..55434061e20b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/bindingsUpdateSample.js @@ -0,0 +1,54 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting Binding. + * + * @summary Operation to update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json + */ +async function bindingsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource = { + properties: { + bindingParameters: { + apiType: { + name: "SQL", + }, + databaseName: { + name: "db1", + }, + }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + updatedAt: undefined, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolGetSample.js new file mode 100644 index 000000000000..c0aa001e00fe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get build service agent pool. + * + * @summary Get build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json + */ +async function buildServiceAgentPoolGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.get( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName + ); + console.log(result); +} + +buildServiceAgentPoolGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolListSample.js new file mode 100644 index 000000000000..5a31b65837ca --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List build service agent pool. + * + * @summary List build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json + */ +async function buildServiceAgentPoolList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceAgentPool.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceAgentPoolList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolUpdatePutSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolUpdatePutSample.js new file mode 100644 index 000000000000..954c84fc5728 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceAgentPoolUpdatePutSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update build service agent pool. + * + * @summary Create or update build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json + */ +async function buildServiceAgentPoolUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const agentPoolResource = { + properties: { poolSize: { name: "S3" } }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + agentPoolResource + ); + console.log(result); +} + +buildServiceAgentPoolUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js new file mode 100644 index 000000000000..0e96bca2fac9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderCreateOrUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a KPack builder. + * + * @summary Create or update a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json + */ +async function buildServiceBuilderCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const builderResource = { + properties: { + buildpackGroups: [{ name: "mix", buildpacks: [{ id: "tanzu-buildpacks/java-azure" }] }], + stack: { id: "io.buildpacks.stacks.bionic", version: "base" }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + builderResource + ); + console.log(result); +} + +buildServiceBuilderCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderDeleteSample.js new file mode 100644 index 000000000000..14027f84c1e6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete a KPack builder. + * + * @summary Delete a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json + */ +async function buildServiceBuilderDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderGetSample.js new file mode 100644 index 000000000000..a127d4d68ac9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack builder. + * + * @summary Get a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json + */ +async function buildServiceBuilderGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderListSample.js new file mode 100644 index 000000000000..16c8f0184f8a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceBuilderListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List KPack builders result. + * + * @summary List KPack builders result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json + */ +async function buildServiceBuilderList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceBuilder.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceBuilderList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceCreateOrUpdateBuildSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceCreateOrUpdateBuildSample.js new file mode 100644 index 000000000000..ae9e24d66a50 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceCreateOrUpdateBuildSample.js @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a KPack build. + * + * @summary Create or update a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json + */ +async function buildServiceCreateOrUpdateBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const build = { + properties: { + agentPool: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default", + builder: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default", + env: { environmentVariable: "test" }, + relativePath: + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.createOrUpdateBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + build + ); + console.log(result); +} + +buildServiceCreateOrUpdateBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultLogSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultLogSample.js new file mode 100644 index 000000000000..bb98f3feaae5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultLogSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack build result log download URL. + * + * @summary Get a KPack build result log download URL. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json + */ +async function buildServiceGetBuildResultLog() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResultLog( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResultLog().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultSample.js new file mode 100644 index 000000000000..4023cda94d93 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildResultSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack build result. + * + * @summary Get a KPack build result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json + */ +async function buildServiceGetBuildResult() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResult( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResult().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildSample.js new file mode 100644 index 000000000000..b3efa0d0fe36 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a KPack build. + * + * @summary Get a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json + */ +async function buildServiceGetBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName + ); + console.log(result); +} + +buildServiceGetBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildServiceSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildServiceSample.js new file mode 100644 index 000000000000..085de81667fe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetBuildServiceSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a build service resource. + * + * @summary Get a build service resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json + */ +async function buildServiceGetBuildService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildService( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetBuildService().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetResourceUploadUrlSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetResourceUploadUrlSample.js new file mode 100644 index 000000000000..738e4abb05a3 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetResourceUploadUrlSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for build service, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json + */ +async function buildServiceGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getResourceUploadUrl( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedBuildpackSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedBuildpackSample.js new file mode 100644 index 000000000000..7afc007e1299 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedBuildpackSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the supported buildpack resource. + * + * @summary Get the supported buildpack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json + */ +async function buildServiceGetSupportedBuildpack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildpackName = "tanzu-buildpacks-java-azure"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedBuildpack( + resourceGroupName, + serviceName, + buildServiceName, + buildpackName + ); + console.log(result); +} + +buildServiceGetSupportedBuildpack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedStackSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedStackSample.js new file mode 100644 index 000000000000..26e9c784528c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceGetSupportedStackSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the supported stack resource. + * + * @summary Get the supported stack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json + */ +async function buildServiceGetSupportedStack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const stackName = "io.buildpacks.stacks.bionic-base"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedStack( + resourceGroupName, + serviceName, + buildServiceName, + stackName + ); + console.log(result); +} + +buildServiceGetSupportedStack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildResultsSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildResultsSample.js new file mode 100644 index 000000000000..a4d7918ac1f5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildResultsSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List KPack build results. + * + * @summary List KPack build results. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json + */ +async function buildServiceListBuildResults() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildResults( + resourceGroupName, + serviceName, + buildServiceName, + buildName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildResults().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildServicesSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildServicesSample.js new file mode 100644 index 000000000000..2218a92b73ff --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildServicesSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List build services resource. + * + * @summary List build services resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json + */ +async function buildServiceListBuildServices() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildServices( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildServices().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildsSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildsSample.js new file mode 100644 index 000000000000..4e1121befcc6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListBuildsSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List KPack builds. + * + * @summary List KPack builds. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json + */ +async function buildServiceListBuilds() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuilds( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuilds().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedBuildpacksSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedBuildpacksSample.js new file mode 100644 index 000000000000..fd58fa83fd70 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedBuildpacksSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get all supported buildpacks. + * + * @summary Get all supported buildpacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json + */ +async function buildServiceListSupportedBuildpacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedBuildpacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedBuildpacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedStacksSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedStacksSample.js new file mode 100644 index 000000000000..05926dd98fdb --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildServiceListSupportedStacksSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get all supported stacks. + * + * @summary Get all supported stacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json + */ +async function buildServiceListSupportedStacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedStacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedStacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingCreateOrUpdateSample.js new file mode 100644 index 000000000000..83805d1f8bc2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingCreateOrUpdateSample.js @@ -0,0 +1,56 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update a buildpack binding. + * + * @summary Create or update a buildpack binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json + */ +async function buildpackBindingCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const buildpackBinding = { + properties: { + bindingType: "ApplicationInsights", + launchProperties: { + properties: { + abc: "def", + anyString: "any-string", + samplingRate: "12.0", + }, + secrets: { + connectionString: + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding + ); + console.log(result); +} + +buildpackBindingCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingDeleteSample.js new file mode 100644 index 000000000000..bb99283f92c9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingDeleteSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Buildpack Binding + * + * @summary Operation to delete a Buildpack Binding + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json + */ +async function buildpackBindingDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingGetSample.js new file mode 100644 index 000000000000..6404503db150 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingGetSample.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a buildpack binding by name. + * + * @summary Get a buildpack binding by name. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingListSample.js new file mode 100644 index 000000000000..d2c1598dc6c8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/buildpackBindingListSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all buildpack bindings in a builder. + * + * @summary Handles requests to list all buildpack bindings in a builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildpackBinding.list( + resourceGroupName, + serviceName, + buildServiceName, + builderName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesCreateOrUpdateSample.js new file mode 100644 index 000000000000..b3ff553c185e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesCreateOrUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update certificate resource. + * + * @summary Create or update certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json + */ +async function certificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const certificateResource = { + properties: { + type: "KeyVaultCertificate", + certVersion: "08a219d06d874795a96db47e06fbb01e", + keyVaultCertName: "mycert", + vaultUri: "https://myvault.vault.azure.net", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + certificateName, + certificateResource + ); + console.log(result); +} + +certificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesDeleteSample.js new file mode 100644 index 000000000000..6df1ca1cdcb4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the certificate resource. + * + * @summary Delete the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json + */ +async function certificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginDeleteAndWait( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesGetSample.js new file mode 100644 index 000000000000..f1dd6d157899 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the certificate resource. + * + * @summary Get the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json + */ +async function certificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.get(resourceGroupName, serviceName, certificateName); + console.log(result); +} + +certificatesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesListSample.js new file mode 100644 index 000000000000..e0194b6994e9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/certificatesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all the certificates of one user. + * + * @summary List all the certificates of one user. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json + */ +async function certificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.certificates.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +certificatesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersGetSample.js new file mode 100644 index 000000000000..987bc66a536c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the config server and its properties. + * + * @summary Get the config server and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json + */ +async function configServersGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.get(resourceGroupName, serviceName); + console.log(result); +} + +configServersGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePatchSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePatchSample.js new file mode 100644 index 000000000000..88ef9101154f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePatchSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json + */ +async function configServersUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePutSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePutSample.js new file mode 100644 index 000000000000..b6f317df5a1f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersUpdatePutSample.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json + */ +async function configServersUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersValidateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersValidateSample.js new file mode 100644 index 000000000000..05fb4f30e14c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configServersValidateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check if the config server settings are valid. + * + * @summary Check if the config server settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json + */ +async function configServersValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerSettings = { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginValidateAndWait( + resourceGroupName, + serviceName, + configServerSettings + ); + console.log(result); +} + +configServersValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesCreateOrUpdateSample.js new file mode 100644 index 000000000000..fd5dba0174ac --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesCreateOrUpdateSample.js @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @summary Create the default Application Configuration Service or update the existing Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json + */ +async function configurationServicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const configurationServiceResource = { + properties: { + settings: { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository", + }, + ], + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource + ); + console.log(result); +} + +configurationServicesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesDeleteSample.js new file mode 100644 index 000000000000..f7617591ace3 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable the default Application Configuration Service. + * + * @summary Disable the default Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json + */ +async function configurationServicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginDeleteAndWait( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesGetSample.js new file mode 100644 index 000000000000..b5ab685bfd27 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Application Configuration Service and its properties. + * + * @summary Get the Application Configuration Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json + */ +async function configurationServicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.get( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesListSample.js new file mode 100644 index 000000000000..48111fecaec9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json + */ +async function configurationServicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.configurationServices.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +configurationServicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesValidateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesValidateSample.js new file mode 100644 index 000000000000..a1554543a226 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/configurationServicesValidateSample.js @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check if the Application Configuration Service settings are valid. + * + * @summary Check if the Application Configuration Service settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json + */ +async function configurationServicesValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const settings = { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginValidateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + settings + ); + console.log(result); +} + +configurationServicesValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsCreateOrUpdateSample.js new file mode 100644 index 000000000000..8af9b913aeef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsCreateOrUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update custom domain of one lifecycle application. + * + * @summary Create or update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json + */ +async function customDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsDeleteSample.js new file mode 100644 index 000000000000..71312b5c29a5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the custom domain of one lifecycle application. + * + * @summary Delete the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json + */ +async function customDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsGetSample.js new file mode 100644 index 000000000000..e5e634a26d27 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the custom domain of one lifecycle application. + * + * @summary Get the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json + */ +async function customDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.get( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsListSample.js new file mode 100644 index 000000000000..d46883582e9b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsListSample.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List the custom domains of one lifecycle application. + * + * @summary List the custom domains of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json + */ +async function customDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.customDomains.list(resourceGroupName, serviceName, appName)) { + resArray.push(item); + } + console.log(resArray); +} + +customDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsUpdateSample.js new file mode 100644 index 000000000000..d6df10c2276c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/customDomainsUpdateSample.js @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update custom domain of one lifecycle application. + * + * @summary Update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json + */ +async function customDomainsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsCreateOrUpdateSample.js new file mode 100644 index 000000000000..adce9f154d92 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsCreateOrUpdateSample.js @@ -0,0 +1,111 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json + */ +async function deploymentsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + deploymentSettings: { + addonConfigs: { + applicationConfigurationService: { + patterns: { + name: ["mypattern"], + }, + }, + }, + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" }, + }, + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0", + }, + }, + sku: { name: "S0", capacity: 1, tier: "Standard" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json + */ +async function deploymentsCreateOrUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + deploymentSettings: { + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" }, + }, + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myContainerImage:v1", + imageRegistryCredential: { + password: "myPassword", + username: "myUsername", + }, + languageFramework: "springboot", + server: "myacr.azurecr.io", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsDeleteSample.js new file mode 100644 index 000000000000..ca244ad67372 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Deployment. + * + * @summary Operation to delete a Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json + */ +async function deploymentsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateHeapDumpSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateHeapDumpSample.js new file mode 100644 index 000000000000..41bfd9209305 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateHeapDumpSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Generate Heap Dump + * + * @summary Generate Heap Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateHeapDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateThreadDumpSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateThreadDumpSample.js new file mode 100644 index 000000000000..d826086cc076 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGenerateThreadDumpSample.js @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Generate Thread Dump + * + * @summary Generate Thread Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateThreadDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetLogFileUrlSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetLogFileUrlSample.js new file mode 100644 index 000000000000..a5fce1ad9dbb --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetLogFileUrlSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get deployment log file URL + * + * @summary Get deployment log file URL + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json + */ +async function deploymentsGetLogFileUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.getLogFileUrl( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetLogFileUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetSample.js new file mode 100644 index 000000000000..a14265908cd7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsGetSample.js @@ -0,0 +1,62 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json + */ +async function deploymentsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGet().catch(console.error); + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get_CustomContainer.json + */ +async function deploymentsGetCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListForClusterSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListForClusterSample.js new file mode 100644 index 000000000000..949eaf0b97ea --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListForClusterSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List deployments for a certain service + * + * @summary List deployments for a certain service + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json + */ +async function deploymentsListForCluster() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.listForCluster(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsListForCluster().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListSample.js new file mode 100644 index 000000000000..ed5a189a45a5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsListSample.js @@ -0,0 +1,34 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json + */ +async function deploymentsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.list(resourceGroupName, serviceName, appName)) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsRestartSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsRestartSample.js new file mode 100644 index 000000000000..0a86c26a7200 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsRestartSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Restart the deployment. + * + * @summary Restart the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json + */ +async function deploymentsRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginRestartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsRestart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartJfrSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartJfrSample.js new file mode 100644 index 000000000000..84fc093f7083 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartJfrSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Start JFR + * + * @summary Start JFR + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json + */ +async function deploymentsStartJfr() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters = { + appInstance: "myappinstance", + duration: "60s", + filePath: "/byos/diagnose", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartJFRAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsStartJfr().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartSample.js new file mode 100644 index 000000000000..0cb73dcfe212 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStartSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Start the deployment. + * + * @summary Start the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json + */ +async function deploymentsStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStopSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStopSample.js new file mode 100644 index 000000000000..80c6da632547 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsStopSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Stop the deployment. + * + * @summary Stop the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json + */ +async function deploymentsStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStopAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsUpdateSample.js new file mode 100644 index 000000000000..375c5adfbd53 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/deploymentsUpdateSample.js @@ -0,0 +1,94 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json + */ +async function deploymentsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0", + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdate().catch(console.error); + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update_CustomContainer.json + */ +async function deploymentsUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource = { + properties: { + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myNewContainerImage:v1", + imageRegistryCredential: { + password: "", + username: "myNewUsername", + }, + server: "mynewacr.azurecr.io", + }, + }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js new file mode 100644 index 000000000000..c6bdeceb6594 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsCreateOrUpdateSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update the Spring Cloud Gateway custom domain. + * + * @summary Create or update the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json + */ +async function gatewayCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const gatewayCustomDomainResource = { + properties: { thumbprint: "*" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName, + gatewayCustomDomainResource + ); + console.log(result); +} + +gatewayCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsDeleteSample.js new file mode 100644 index 000000000000..288e4f6e0f4e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway custom domain. + * + * @summary Delete the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json + */ +async function gatewayCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsGetSample.js new file mode 100644 index 000000000000..6e1aeb109911 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway custom domain. + * + * @summary Get the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json + */ +async function gatewayCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.get( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsListSample.js new file mode 100644 index 000000000000..6696a529efd4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayCustomDomainsListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway custom domains. + * + * @summary Handle requests to list all Spring Cloud Gateway custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json + */ +async function gatewayCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayCustomDomains.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js new file mode 100644 index 000000000000..80abb71459cd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsCreateOrUpdateSample.js @@ -0,0 +1,52 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @summary Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json + */ +async function gatewayRouteConfigsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const gatewayRouteConfigResource = { + properties: { + appResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp", + routes: [ + { + filters: ["StripPrefix=2", "RateLimit=1,1s"], + predicates: ["Path=/api5/customer/**"], + ssoEnabled: true, + title: "myApp route config", + }, + ], + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + gatewayRouteConfigResource + ); + console.log(result); +} + +gatewayRouteConfigsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsDeleteSample.js new file mode 100644 index 000000000000..9105444d3f9a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsDeleteSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway route config. + * + * @summary Delete the Spring Cloud Gateway route config. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json + */ +async function gatewayRouteConfigsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsGetSample.js new file mode 100644 index 000000000000..c72b26c3ffd7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsGetSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway route configs. + * + * @summary Get the Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json + */ +async function gatewayRouteConfigsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.get( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsListSample.js new file mode 100644 index 000000000000..d69c77ef85a8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewayRouteConfigsListSample.js @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway route configs. + * + * @summary Handle requests to list all Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json + */ +async function gatewayRouteConfigsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayRouteConfigs.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayRouteConfigsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysCreateOrUpdateSample.js new file mode 100644 index 000000000000..5d00be3520d8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysCreateOrUpdateSample.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @summary Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json + */ +async function gatewaysCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const gatewayResource = { + properties: { public: true, resourceRequests: { cpu: "1", memory: "1G" } }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + gatewayResource + ); + console.log(result); +} + +gatewaysCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysDeleteSample.js new file mode 100644 index 000000000000..9a9e7ca45aa3 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable the default Spring Cloud Gateway. + * + * @summary Disable the default Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json + */ +async function gatewaysDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysGetSample.js new file mode 100644 index 000000000000..ce9eeb3f99ec --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway and its properties. + * + * @summary Get the Spring Cloud Gateway and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json + */ +async function gatewaysGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.get(resourceGroupName, serviceName, gatewayName); + console.log(result); +} + +gatewaysGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysListSample.js new file mode 100644 index 000000000000..7f07691f6173 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json + */ +async function gatewaysList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gateways.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +gatewaysList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysValidateDomainSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysValidateDomainSample.js new file mode 100644 index 000000000000..bc794ceae68e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/gatewaysValidateDomainSample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json + */ +async function gatewaysValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const validatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.validateDomain( + resourceGroupName, + serviceName, + gatewayName, + validatePayload + ); + console.log(result); +} + +gatewaysValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsGetSample.js new file mode 100644 index 000000000000..8a8fb495471a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Monitoring Setting and its properties. + * + * @summary Get the Monitoring Setting and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json + */ +async function monitoringSettingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.get(resourceGroupName, serviceName); + console.log(result); +} + +monitoringSettingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePatchSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePatchSample.js new file mode 100644 index 000000000000..124ba3fd58cd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePatchSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json + */ +async function monitoringSettingsUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePutSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePutSample.js new file mode 100644 index 000000000000..5e86444aab79 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/monitoringSettingsUpdatePutSample.js @@ -0,0 +1,41 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json + */ +async function monitoringSettingsUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/operationsListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..bb7749e70011 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/operationsListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/package.json b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/package.json new file mode 100644 index 000000000000..449429a61ad2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "azure-arm-appplatform-samples-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/appplatform/arm-appplatform" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform", + "dependencies": { + "@azure/arm-appplatform": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js new file mode 100644 index 000000000000..e56ce8d10d79 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/runtimeVersionsListRuntimeVersionsSample.js @@ -0,0 +1,28 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @summary Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json + */ +async function runtimeVersionsListRuntimeVersions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.runtimeVersions.listRuntimeVersions(); + console.log(result); +} + +runtimeVersionsListRuntimeVersions().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/sample.env b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesCreateOrUpdateSample.js new file mode 100644 index 000000000000..15b72cca8fda --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesCreateOrUpdateSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create the default Service Registry or update the existing Service Registry. + * + * @summary Create the default Service Registry or update the existing Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json + */ +async function serviceRegistriesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesDeleteSample.js new file mode 100644 index 000000000000..68d69b3d4c22 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable the default Service Registry. + * + * @summary Disable the default Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json + */ +async function serviceRegistriesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginDeleteAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesGetSample.js new file mode 100644 index 000000000000..74f4aeff281b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesGetSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the Service Registry and its properties. + * + * @summary Get the Service Registry and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json + */ +async function serviceRegistriesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.get( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesListSample.js new file mode 100644 index 000000000000..90e9704605a6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/serviceRegistriesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json + */ +async function serviceRegistriesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.serviceRegistries.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +serviceRegistriesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCheckNameAvailabilitySample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCheckNameAvailabilitySample.js new file mode 100644 index 000000000000..a0dd5ec0ea51 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCheckNameAvailabilitySample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json + */ +async function servicesCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const availabilityParameters = { + name: "myservice", + type: "Microsoft.AppPlatform/Spring", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.checkNameAvailability(location, availabilityParameters); + console.log(result); +} + +servicesCheckNameAvailability().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCreateOrUpdateSample.js new file mode 100644 index 000000000000..b3fbcc82fa73 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesCreateOrUpdateSample.js @@ -0,0 +1,78 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json + */ +async function servicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json + */ +async function servicesCreateOrUpdateVNetInjection() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource = { + location: "eastus", + properties: { + networkProfile: { + appNetworkResourceGroup: "my-app-network-rg", + appSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps", + serviceCidr: "10.8.0.0/16,10.244.0.0/16,10.245.0.1/16", + serviceRuntimeNetworkResourceGroup: "my-service-runtime-network-rg", + serviceRuntimeSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime", + }, + }, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdateVNetInjection().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDeleteSample.js new file mode 100644 index 000000000000..4645eae82380 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDeleteSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to delete a Service. + * + * @summary Operation to delete a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json + */ +async function servicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginDeleteAndWait(resourceGroupName, serviceName); + console.log(result); +} + +servicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDisableTestEndpointSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDisableTestEndpointSample.js new file mode 100644 index 000000000000..c849b9231752 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesDisableTestEndpointSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Disable test endpoint functionality for a Service. + * + * @summary Disable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json + */ +async function servicesDisableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.disableTestEndpoint(resourceGroupName, serviceName); + console.log(result); +} + +servicesDisableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesEnableTestEndpointSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesEnableTestEndpointSample.js new file mode 100644 index 000000000000..b1671b944114 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesEnableTestEndpointSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Enable test endpoint functionality for a Service. + * + * @summary Enable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json + */ +async function servicesEnableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.enableTestEndpoint(resourceGroupName, serviceName); + console.log(result); +} + +servicesEnableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesGetSample.js new file mode 100644 index 000000000000..06ab762d8d36 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesGetSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get a Service and its properties. + * + * @summary Get a Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json + */ +async function servicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.get(resourceGroupName, serviceName); + console.log(result); +} + +servicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListBySubscriptionSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListBySubscriptionSample.js new file mode 100644 index 000000000000..933dfcb61827 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListBySubscriptionSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json + */ +async function servicesListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +servicesListBySubscription().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListSample.js new file mode 100644 index 000000000000..e267d5942c79 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListSample.js @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json + */ +async function servicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +servicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListTestKeysSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListTestKeysSample.js new file mode 100644 index 000000000000..8c2e15020624 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesListTestKeysSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List test keys for a Service. + * + * @summary List test keys for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json + */ +async function servicesListTestKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.listTestKeys(resourceGroupName, serviceName); + console.log(result); +} + +servicesListTestKeys().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesRegenerateTestKeySample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesRegenerateTestKeySample.js new file mode 100644 index 000000000000..3c8a39573edd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesRegenerateTestKeySample.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Regenerate a test key for a Service. + * + * @summary Regenerate a test key for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json + */ +async function servicesRegenerateTestKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const regenerateTestKeyRequest = { + keyType: "Primary", + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.regenerateTestKey( + resourceGroupName, + serviceName, + regenerateTestKeyRequest + ); + console.log(result); +} + +servicesRegenerateTestKey().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStartSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStartSample.js new file mode 100644 index 000000000000..4113986192de --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStartSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Start a Service. + * + * @summary Start a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json + */ +async function servicesStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStartAndWait(resourceGroupName, serviceName); + console.log(result); +} + +servicesStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStopSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStopSample.js new file mode 100644 index 000000000000..0480a87a3621 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesStopSample.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Stop a Service. + * + * @summary Stop a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json + */ +async function servicesStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStopAndWait(resourceGroupName, serviceName); + console.log(result); +} + +servicesStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesUpdateSample.js new file mode 100644 index 000000000000..76ce8f9ef4cf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/servicesUpdateSample.js @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Operation to update an exiting Service. + * + * @summary Operation to update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json + */ +async function servicesUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginUpdateAndWait(resourceGroupName, serviceName, resource); + console.log(result); +} + +servicesUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/skusListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/skusListSample.js new file mode 100644 index 000000000000..6f005fcc99af --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/skusListSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available skus of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json + */ +async function skusList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.skus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +skusList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesCreateOrUpdateSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesCreateOrUpdateSample.js new file mode 100644 index 000000000000..9519bd43d185 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesCreateOrUpdateSample.js @@ -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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Create or update storage resource. + * + * @summary Create or update storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json + */ +async function storagesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const storageResource = { + properties: { + accountKey: "account-key-of-storage-account", + accountName: "storage-account-name", + storageType: "StorageAccount", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + storageName, + storageResource + ); + console.log(result); +} + +storagesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesDeleteSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesDeleteSample.js new file mode 100644 index 000000000000..3b81e678eaac --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesDeleteSample.js @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Delete the storage resource. + * + * @summary Delete the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json + */ +async function storagesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginDeleteAndWait( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesGetSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesGetSample.js new file mode 100644 index 000000000000..e55c1430cfbd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesGetSample.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Get the storage resource. + * + * @summary Get the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json + */ +async function storagesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.get(resourceGroupName, serviceName, storageName); + console.log(result); +} + +storagesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesListSample.js b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesListSample.js new file mode 100644 index 000000000000..17115e5a9ae7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/javascript/storagesListSample.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { AppPlatformManagementClient } = require("@azure/arm-appplatform"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to List all the storages of one Azure Spring Cloud instance. + * + * @summary List all the storages of one Azure Spring Cloud instance. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json + */ +async function storagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storages.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +storagesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/README.md b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/README.md new file mode 100644 index 000000000000..900902c42a67 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/README.md @@ -0,0 +1,295 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [apiPortalCustomDomainsCreateOrUpdateSample.ts][apiportalcustomdomainscreateorupdatesample] | Create or update the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json | +| [apiPortalCustomDomainsDeleteSample.ts][apiportalcustomdomainsdeletesample] | Delete the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json | +| [apiPortalCustomDomainsGetSample.ts][apiportalcustomdomainsgetsample] | Get the API portal custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json | +| [apiPortalCustomDomainsListSample.ts][apiportalcustomdomainslistsample] | Handle requests to list all API portal custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json | +| [apiPortalsCreateOrUpdateSample.ts][apiportalscreateorupdatesample] | Create the default API portal or update the existing API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json | +| [apiPortalsDeleteSample.ts][apiportalsdeletesample] | Delete the default API portal. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json | +| [apiPortalsGetSample.ts][apiportalsgetsample] | Get the API portal and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json | +| [apiPortalsListSample.ts][apiportalslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json | +| [apiPortalsValidateDomainSample.ts][apiportalsvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json | +| [appsCreateOrUpdateSample.ts][appscreateorupdatesample] | Create a new App or update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json | +| [appsDeleteSample.ts][appsdeletesample] | Operation to delete an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json | +| [appsGetResourceUploadUrlSample.ts][appsgetresourceuploadurlsample] | Get an resource upload URL for an App, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json | +| [appsGetSample.ts][appsgetsample] | Get an App and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json | +| [appsListSample.ts][appslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json | +| [appsSetActiveDeploymentsSample.ts][appssetactivedeploymentssample] | Set existing Deployment under the app as active x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json | +| [appsUpdateSample.ts][appsupdatesample] | Operation to update an exiting App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json | +| [appsValidateDomainSample.ts][appsvalidatedomainsample] | Check the resource name is valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json | +| [bindingsCreateOrUpdateSample.ts][bindingscreateorupdatesample] | Create a new Binding or update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json | +| [bindingsDeleteSample.ts][bindingsdeletesample] | Operation to delete a Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json | +| [bindingsGetSample.ts][bindingsgetsample] | Get a Binding and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json | +| [bindingsListSample.ts][bindingslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json | +| [bindingsUpdateSample.ts][bindingsupdatesample] | Operation to update an exiting Binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json | +| [buildServiceAgentPoolGetSample.ts][buildserviceagentpoolgetsample] | Get build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json | +| [buildServiceAgentPoolListSample.ts][buildserviceagentpoollistsample] | List build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json | +| [buildServiceAgentPoolUpdatePutSample.ts][buildserviceagentpoolupdateputsample] | Create or update build service agent pool. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json | +| [buildServiceBuilderCreateOrUpdateSample.ts][buildservicebuildercreateorupdatesample] | Create or update a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json | +| [buildServiceBuilderDeleteSample.ts][buildservicebuilderdeletesample] | Delete a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json | +| [buildServiceBuilderGetSample.ts][buildservicebuildergetsample] | Get a KPack builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json | +| [buildServiceBuilderListSample.ts][buildservicebuilderlistsample] | List KPack builders result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json | +| [buildServiceCreateOrUpdateBuildSample.ts][buildservicecreateorupdatebuildsample] | Create or update a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json | +| [buildServiceGetBuildResultLogSample.ts][buildservicegetbuildresultlogsample] | Get a KPack build result log download URL. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json | +| [buildServiceGetBuildResultSample.ts][buildservicegetbuildresultsample] | Get a KPack build result. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json | +| [buildServiceGetBuildSample.ts][buildservicegetbuildsample] | Get a KPack build. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json | +| [buildServiceGetBuildServiceSample.ts][buildservicegetbuildservicesample] | Get a build service resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json | +| [buildServiceGetResourceUploadUrlSample.ts][buildservicegetresourceuploadurlsample] | Get an resource upload URL for build service, which may be artifacts or source archive. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json | +| [buildServiceGetSupportedBuildpackSample.ts][buildservicegetsupportedbuildpacksample] | Get the supported buildpack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json | +| [buildServiceGetSupportedStackSample.ts][buildservicegetsupportedstacksample] | Get the supported stack resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json | +| [buildServiceListBuildResultsSample.ts][buildservicelistbuildresultssample] | List KPack build results. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json | +| [buildServiceListBuildServicesSample.ts][buildservicelistbuildservicessample] | List build services resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json | +| [buildServiceListBuildsSample.ts][buildservicelistbuildssample] | List KPack builds. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json | +| [buildServiceListSupportedBuildpacksSample.ts][buildservicelistsupportedbuildpackssample] | Get all supported buildpacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json | +| [buildServiceListSupportedStacksSample.ts][buildservicelistsupportedstackssample] | Get all supported stacks. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json | +| [buildpackBindingCreateOrUpdateSample.ts][buildpackbindingcreateorupdatesample] | Create or update a buildpack binding. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json | +| [buildpackBindingDeleteSample.ts][buildpackbindingdeletesample] | Operation to delete a Buildpack Binding x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json | +| [buildpackBindingGetSample.ts][buildpackbindinggetsample] | Get a buildpack binding by name. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json | +| [buildpackBindingListSample.ts][buildpackbindinglistsample] | Handles requests to list all buildpack bindings in a builder. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json | +| [certificatesCreateOrUpdateSample.ts][certificatescreateorupdatesample] | Create or update certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json | +| [certificatesDeleteSample.ts][certificatesdeletesample] | Delete the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json | +| [certificatesGetSample.ts][certificatesgetsample] | Get the certificate resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json | +| [certificatesListSample.ts][certificateslistsample] | List all the certificates of one user. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json | +| [configServersGetSample.ts][configserversgetsample] | Get the config server and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json | +| [configServersUpdatePatchSample.ts][configserversupdatepatchsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json | +| [configServersUpdatePutSample.ts][configserversupdateputsample] | Update the config server. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json | +| [configServersValidateSample.ts][configserversvalidatesample] | Check if the config server settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json | +| [configurationServicesCreateOrUpdateSample.ts][configurationservicescreateorupdatesample] | Create the default Application Configuration Service or update the existing Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json | +| [configurationServicesDeleteSample.ts][configurationservicesdeletesample] | Disable the default Application Configuration Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json | +| [configurationServicesGetSample.ts][configurationservicesgetsample] | Get the Application Configuration Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json | +| [configurationServicesListSample.ts][configurationserviceslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json | +| [configurationServicesValidateSample.ts][configurationservicesvalidatesample] | Check if the Application Configuration Service settings are valid. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json | +| [customDomainsCreateOrUpdateSample.ts][customdomainscreateorupdatesample] | Create or update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json | +| [customDomainsDeleteSample.ts][customdomainsdeletesample] | Delete the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json | +| [customDomainsGetSample.ts][customdomainsgetsample] | Get the custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json | +| [customDomainsListSample.ts][customdomainslistsample] | List the custom domains of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json | +| [customDomainsUpdateSample.ts][customdomainsupdatesample] | Update custom domain of one lifecycle application. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json | +| [deploymentsCreateOrUpdateSample.ts][deploymentscreateorupdatesample] | Create a new Deployment or update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json | +| [deploymentsDeleteSample.ts][deploymentsdeletesample] | Operation to delete a Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json | +| [deploymentsGenerateHeapDumpSample.ts][deploymentsgenerateheapdumpsample] | Generate Heap Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json | +| [deploymentsGenerateThreadDumpSample.ts][deploymentsgeneratethreaddumpsample] | Generate Thread Dump x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json | +| [deploymentsGetLogFileUrlSample.ts][deploymentsgetlogfileurlsample] | Get deployment log file URL x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json | +| [deploymentsGetSample.ts][deploymentsgetsample] | Get a Deployment and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json | +| [deploymentsListForClusterSample.ts][deploymentslistforclustersample] | List deployments for a certain service x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json | +| [deploymentsListSample.ts][deploymentslistsample] | Handles requests to list all resources in an App. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json | +| [deploymentsRestartSample.ts][deploymentsrestartsample] | Restart the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json | +| [deploymentsStartJfrSample.ts][deploymentsstartjfrsample] | Start JFR x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json | +| [deploymentsStartSample.ts][deploymentsstartsample] | Start the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json | +| [deploymentsStopSample.ts][deploymentsstopsample] | Stop the deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json | +| [deploymentsUpdateSample.ts][deploymentsupdatesample] | Operation to update an exiting Deployment. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json | +| [gatewayCustomDomainsCreateOrUpdateSample.ts][gatewaycustomdomainscreateorupdatesample] | Create or update the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json | +| [gatewayCustomDomainsDeleteSample.ts][gatewaycustomdomainsdeletesample] | Delete the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json | +| [gatewayCustomDomainsGetSample.ts][gatewaycustomdomainsgetsample] | Get the Spring Cloud Gateway custom domain. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json | +| [gatewayCustomDomainsListSample.ts][gatewaycustomdomainslistsample] | Handle requests to list all Spring Cloud Gateway custom domains. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json | +| [gatewayRouteConfigsCreateOrUpdateSample.ts][gatewayrouteconfigscreateorupdatesample] | Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json | +| [gatewayRouteConfigsDeleteSample.ts][gatewayrouteconfigsdeletesample] | Delete the Spring Cloud Gateway route config. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json | +| [gatewayRouteConfigsGetSample.ts][gatewayrouteconfigsgetsample] | Get the Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json | +| [gatewayRouteConfigsListSample.ts][gatewayrouteconfigslistsample] | Handle requests to list all Spring Cloud Gateway route configs. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json | +| [gatewaysCreateOrUpdateSample.ts][gatewayscreateorupdatesample] | Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json | +| [gatewaysDeleteSample.ts][gatewaysdeletesample] | Disable the default Spring Cloud Gateway. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json | +| [gatewaysGetSample.ts][gatewaysgetsample] | Get the Spring Cloud Gateway and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json | +| [gatewaysListSample.ts][gatewayslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json | +| [gatewaysValidateDomainSample.ts][gatewaysvalidatedomainsample] | Check the domains are valid as well as not in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json | +| [monitoringSettingsGetSample.ts][monitoringsettingsgetsample] | Get the Monitoring Setting and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json | +| [monitoringSettingsUpdatePatchSample.ts][monitoringsettingsupdatepatchsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json | +| [monitoringSettingsUpdatePutSample.ts][monitoringsettingsupdateputsample] | Update the Monitoring Setting. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json | +| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json | +| [runtimeVersionsListRuntimeVersionsSample.ts][runtimeversionslistruntimeversionssample] | Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json | +| [serviceRegistriesCreateOrUpdateSample.ts][serviceregistriescreateorupdatesample] | Create the default Service Registry or update the existing Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json | +| [serviceRegistriesDeleteSample.ts][serviceregistriesdeletesample] | Disable the default Service Registry. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json | +| [serviceRegistriesGetSample.ts][serviceregistriesgetsample] | Get the Service Registry and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json | +| [serviceRegistriesListSample.ts][serviceregistrieslistsample] | Handles requests to list all resources in a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json | +| [servicesCheckNameAvailabilitySample.ts][serviceschecknameavailabilitysample] | Checks that the resource name is valid and is not already in use. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json | +| [servicesCreateOrUpdateSample.ts][servicescreateorupdatesample] | Create a new Service or update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json | +| [servicesDeleteSample.ts][servicesdeletesample] | Operation to delete a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json | +| [servicesDisableTestEndpointSample.ts][servicesdisabletestendpointsample] | Disable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json | +| [servicesEnableTestEndpointSample.ts][servicesenabletestendpointsample] | Enable test endpoint functionality for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json | +| [servicesGetSample.ts][servicesgetsample] | Get a Service and its properties. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json | +| [servicesListBySubscriptionSample.ts][serviceslistbysubscriptionsample] | Handles requests to list all resources in a subscription. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json | +| [servicesListSample.ts][serviceslistsample] | Handles requests to list all resources in a resource group. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json | +| [servicesListTestKeysSample.ts][serviceslisttestkeyssample] | List test keys for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json | +| [servicesRegenerateTestKeySample.ts][servicesregeneratetestkeysample] | Regenerate a test key for a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json | +| [servicesStartSample.ts][servicesstartsample] | Start a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json | +| [servicesStopSample.ts][servicesstopsample] | Stop a Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json | +| [servicesUpdateSample.ts][servicesupdatesample] | Operation to update an exiting Service. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json | +| [skusListSample.ts][skuslistsample] | Lists all of the available skus of the Microsoft.AppPlatform provider. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json | +| [storagesCreateOrUpdateSample.ts][storagescreateorupdatesample] | Create or update storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json | +| [storagesDeleteSample.ts][storagesdeletesample] | Delete the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json | +| [storagesGetSample.ts][storagesgetsample] | Get the storage resource. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json | +| [storagesListSample.ts][storageslistsample] | List all the storages of one Azure Spring Cloud instance. x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/apiPortalCustomDomainsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[apiportalcustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts +[apiportalcustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts +[apiportalcustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsGetSample.ts +[apiportalcustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsListSample.ts +[apiportalscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts +[apiportalsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsDeleteSample.ts +[apiportalsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsGetSample.ts +[apiportalslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsListSample.ts +[apiportalsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsValidateDomainSample.ts +[appscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsCreateOrUpdateSample.ts +[appsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsDeleteSample.ts +[appsgetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetResourceUploadUrlSample.ts +[appsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetSample.ts +[appslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsListSample.ts +[appssetactivedeploymentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsSetActiveDeploymentsSample.ts +[appsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsUpdateSample.ts +[appsvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsValidateDomainSample.ts +[bindingscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsCreateOrUpdateSample.ts +[bindingsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsDeleteSample.ts +[bindingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsGetSample.ts +[bindingslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsListSample.ts +[bindingsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsUpdateSample.ts +[buildserviceagentpoolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolGetSample.ts +[buildserviceagentpoollistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolListSample.ts +[buildserviceagentpoolupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts +[buildservicebuildercreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts +[buildservicebuilderdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderDeleteSample.ts +[buildservicebuildergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderGetSample.ts +[buildservicebuilderlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderListSample.ts +[buildservicecreateorupdatebuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts +[buildservicegetbuildresultlogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultLogSample.ts +[buildservicegetbuildresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultSample.ts +[buildservicegetbuildsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildSample.ts +[buildservicegetbuildservicesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildServiceSample.ts +[buildservicegetresourceuploadurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts +[buildservicegetsupportedbuildpacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts +[buildservicegetsupportedstacksample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedStackSample.ts +[buildservicelistbuildresultssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildResultsSample.ts +[buildservicelistbuildservicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildServicesSample.ts +[buildservicelistbuildssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildsSample.ts +[buildservicelistsupportedbuildpackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts +[buildservicelistsupportedstackssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedStacksSample.ts +[buildpackbindingcreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts +[buildpackbindingdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingDeleteSample.ts +[buildpackbindinggetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingGetSample.ts +[buildpackbindinglistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingListSample.ts +[certificatescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesCreateOrUpdateSample.ts +[certificatesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesDeleteSample.ts +[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesGetSample.ts +[certificateslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesListSample.ts +[configserversgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersGetSample.ts +[configserversupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePatchSample.ts +[configserversupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePutSample.ts +[configserversvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersValidateSample.ts +[configurationservicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts +[configurationservicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesDeleteSample.ts +[configurationservicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesGetSample.ts +[configurationserviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesListSample.ts +[configurationservicesvalidatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesValidateSample.ts +[customdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsCreateOrUpdateSample.ts +[customdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsDeleteSample.ts +[customdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsGetSample.ts +[customdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsListSample.ts +[customdomainsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsUpdateSample.ts +[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsCreateOrUpdateSample.ts +[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsDeleteSample.ts +[deploymentsgenerateheapdumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts +[deploymentsgeneratethreaddumpsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts +[deploymentsgetlogfileurlsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetLogFileUrlSample.ts +[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetSample.ts +[deploymentslistforclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListForClusterSample.ts +[deploymentslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListSample.ts +[deploymentsrestartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsRestartSample.ts +[deploymentsstartjfrsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartJfrSample.ts +[deploymentsstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartSample.ts +[deploymentsstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStopSample.ts +[deploymentsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsUpdateSample.ts +[gatewaycustomdomainscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts +[gatewaycustomdomainsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts +[gatewaycustomdomainsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsGetSample.ts +[gatewaycustomdomainslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsListSample.ts +[gatewayrouteconfigscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts +[gatewayrouteconfigsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts +[gatewayrouteconfigsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsGetSample.ts +[gatewayrouteconfigslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsListSample.ts +[gatewayscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysCreateOrUpdateSample.ts +[gatewaysdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysDeleteSample.ts +[gatewaysgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysGetSample.ts +[gatewayslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysListSample.ts +[gatewaysvalidatedomainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysValidateDomainSample.ts +[monitoringsettingsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsGetSample.ts +[monitoringsettingsupdatepatchsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts +[monitoringsettingsupdateputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePutSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/operationsListSample.ts +[runtimeversionslistruntimeversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts +[serviceregistriescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts +[serviceregistriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesDeleteSample.ts +[serviceregistriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesGetSample.ts +[serviceregistrieslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesListSample.ts +[serviceschecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCheckNameAvailabilitySample.ts +[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCreateOrUpdateSample.ts +[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDeleteSample.ts +[servicesdisabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDisableTestEndpointSample.ts +[servicesenabletestendpointsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesEnableTestEndpointSample.ts +[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesGetSample.ts +[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListBySubscriptionSample.ts +[serviceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListSample.ts +[serviceslisttestkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListTestKeysSample.ts +[servicesregeneratetestkeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesRegenerateTestKeySample.ts +[servicesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStartSample.ts +[servicesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStopSample.ts +[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesUpdateSample.ts +[skuslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/skusListSample.ts +[storagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesCreateOrUpdateSample.ts +[storagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesDeleteSample.ts +[storagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesGetSample.ts +[storageslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesListSample.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-appplatform?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/package.json b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/package.json new file mode 100644 index 000000000000..701f8bd64a6c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "azure-arm-appplatform-samples-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/appplatform/arm-appplatform" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/appplatform/arm-appplatform", + "dependencies": { + "@azure/arm-appplatform": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/sample.env b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..79f2f5ccc8a9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApiPortalCustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the API portal custom domain. + * + * @summary Create or update the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json + */ +async function apiPortalCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const apiPortalCustomDomainResource: ApiPortalCustomDomainResource = { + properties: { thumbprint: "*" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName, + apiPortalCustomDomainResource + ); + console.log(result); +} + +apiPortalCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..53356fd2c799 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the API portal custom domain. + * + * @summary Delete the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Delete.json + */ +async function apiPortalCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsGetSample.ts new file mode 100644 index 000000000000..f3850cef0fa7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the API portal custom domain. + * + * @summary Get the API portal custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_Get.json + */ +async function apiPortalCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortalCustomDomains.get( + resourceGroupName, + serviceName, + apiPortalName, + domainName + ); + console.log(result); +} + +apiPortalCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsListSample.ts new file mode 100644 index 000000000000..eabad4c24d0c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalCustomDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all API portal custom domains. + * + * @summary Handle requests to list all API portal custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortalCustomDomains_List.json + */ +async function apiPortalCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortalCustomDomains.list( + resourceGroupName, + serviceName, + apiPortalName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b5fe4364aa3f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ApiPortalResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default API portal or update the existing API portal. + * + * @summary Create the default API portal or update the existing API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_CreateOrUpdate.json + */ +async function apiPortalsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const apiPortalResource: ApiPortalResource = { + properties: { + gatewayIds: [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default" + ], + public: true + }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + apiPortalName, + apiPortalResource + ); + console.log(result); +} + +apiPortalsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsDeleteSample.ts new file mode 100644 index 000000000000..80ae88d8a03c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the default API portal. + * + * @summary Delete the default API portal. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Delete.json + */ +async function apiPortalsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.beginDeleteAndWait( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsGetSample.ts new file mode 100644 index 000000000000..f7ab08f1c983 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the API portal and its properties. + * + * @summary Get the API portal and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_Get.json + */ +async function apiPortalsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.get( + resourceGroupName, + serviceName, + apiPortalName + ); + console.log(result); +} + +apiPortalsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsListSample.ts new file mode 100644 index 000000000000..11e4525e3bac --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_List.json + */ +async function apiPortalsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apiPortals.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +apiPortalsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsValidateDomainSample.ts new file mode 100644 index 000000000000..1bfec026b167 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/apiPortalsValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ApiPortals_ValidateDomain.json + */ +async function apiPortalsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const apiPortalName = "default"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apiPortals.validateDomain( + resourceGroupName, + serviceName, + apiPortalName, + validatePayload + ); + console.log(result); +} + +apiPortalsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..b062530b38f6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsCreateOrUpdateSample.ts @@ -0,0 +1,101 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AppResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new App or update an exiting App. + * + * @summary Create a new App or update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_CreateOrUpdate.json + */ +async function appsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource: AppResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": { + clientId: undefined, + principalId: undefined + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": { + clientId: undefined, + principalId: undefined + } + } + }, + location: "eastus", + properties: { + addonConfigs: { + applicationConfigurationService: { + resourceId: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs" + } + + }, + serviceRegistry: { + resourceId: { + id: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry" + } + } + }, + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: ["uid=0", "gid=0", "dir_mode=0777", "file_mode=0777"], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare" + }, + storageId: "myASCStorageID" + } + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + loadedCertificates: [ + { + loadTrustStore: false, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1" + }, + { + loadTrustStore: true, + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2" + } + ], + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsDeleteSample.ts new file mode 100644 index 000000000000..920b3db7a2e7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete an App. + * + * @summary Operation to delete an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Delete.json + */ +async function appsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName + ); + console.log(result); +} + +appsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetResourceUploadUrlSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetResourceUploadUrlSample.ts new file mode 100644 index 000000000000..5e66e3e4298b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetResourceUploadUrlSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for an App, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_GetResourceUploadUrl.json + */ +async function appsGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.getResourceUploadUrl( + resourceGroupName, + serviceName, + appName + ); + console.log(result); +} + +appsGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetSample.ts new file mode 100644 index 000000000000..c3bd2d0a9b2d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsGetSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an App and its properties. + * + * @summary Get an App and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Get.json + */ +async function appsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.get(resourceGroupName, serviceName, appName); + console.log(result); +} + +appsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsListSample.ts new file mode 100644 index 000000000000..8008f13c1edf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_List.json + */ +async function appsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.apps.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +appsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsSetActiveDeploymentsSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsSetActiveDeploymentsSample.ts new file mode 100644 index 000000000000..5d8d3632f5ef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsSetActiveDeploymentsSample.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ActiveDeploymentCollection, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Set existing Deployment under the app as active + * + * @summary Set existing Deployment under the app as active + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_SetActiveDeployments.json + */ +async function appsSetActiveDeployments() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const activeDeploymentCollection: ActiveDeploymentCollection = { + activeDeploymentNames: ["default"] + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginSetActiveDeploymentsAndWait( + resourceGroupName, + serviceName, + appName, + activeDeploymentCollection + ); + console.log(result); +} + +appsSetActiveDeployments().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsUpdateSample.ts new file mode 100644 index 000000000000..b7832ad3e93f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsUpdateSample.ts @@ -0,0 +1,76 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + AppResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting App. + * + * @summary Operation to update an exiting App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_Update.json + */ +async function appsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const appResource: AppResource = { + identity: { + type: "SystemAssigned,UserAssigned", + principalId: undefined, + tenantId: undefined, + userAssignedIdentities: { + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": { + clientId: undefined, + principalId: undefined + }, + "/subscriptions/00000000000000000000000000000000/resourceGroups/samplegroup/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": { + clientId: undefined, + principalId: undefined + } + } + }, + location: "eastus", + properties: { + customPersistentDisks: [ + { + customPersistentDiskProperties: { + type: "AzureFileVolume", + mountOptions: [], + mountPath: "/mypath1/mypath2", + shareName: "myFileShare" + }, + storageId: "myASCStorageID" + } + ], + enableEndToEndTLS: false, + fqdn: "myapp.mydomain.com", + httpsOnly: false, + persistentDisk: { mountPath: "/mypersistentdisk", sizeInGB: 2 }, + public: true, + temporaryDisk: { mountPath: "/mytemporarydisk", sizeInGB: 2 } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + appResource + ); + console.log(result); +} + +appsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsValidateDomainSample.ts new file mode 100644 index 000000000000..57ccfc6fe72d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/appsValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the resource name is valid as well as not in use. + * + * @summary Check the resource name is valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Apps_ValidateDomain.json + */ +async function appsValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.apps.validateDomain( + resourceGroupName, + serviceName, + appName, + validatePayload + ); + console.log(result); +} + +appsValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7b3a0a5eb110 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Binding or update an exiting Binding. + * + * @summary Create a new Binding or update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_CreateOrUpdate.json + */ +async function bindingsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource: BindingResource = { + properties: { + bindingParameters: { + apiType: { + name: "SQL" + }, + databaseName: { + name: "db1" + } + }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + resourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1", + updatedAt: undefined + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsDeleteSample.ts new file mode 100644 index 000000000000..291d496c6aa5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Binding. + * + * @summary Operation to delete a Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Delete.json + */ +async function bindingsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsGetSample.ts new file mode 100644 index 000000000000..486acacdd6da --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Binding and its properties. + * + * @summary Get a Binding and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Get.json + */ +async function bindingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.get( + resourceGroupName, + serviceName, + appName, + bindingName + ); + console.log(result); +} + +bindingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsListSample.ts new file mode 100644 index 000000000000..54021ded717d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_List.json + */ +async function bindingsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.bindings.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +bindingsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsUpdateSample.ts new file mode 100644 index 000000000000..31af28f30a06 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/bindingsUpdateSample.ts @@ -0,0 +1,57 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Binding. + * + * @summary Operation to update an exiting Binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Bindings_Update.json + */ +async function bindingsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const bindingName = "mybinding"; + const bindingResource: BindingResource = { + properties: { + bindingParameters: { + apiType: { + name: "SQL" + }, + databaseName: { + name: "db1" + } + }, + createdAt: undefined, + generatedProperties: undefined, + key: "xxxx", + updatedAt: undefined + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.bindings.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource + ); + console.log(result); +} + +bindingsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolGetSample.ts new file mode 100644 index 000000000000..844751ab423e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get build service agent pool. + * + * @summary Get build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_Get.json + */ +async function buildServiceAgentPoolGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.get( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName + ); + console.log(result); +} + +buildServiceAgentPoolGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolListSample.ts new file mode 100644 index 000000000000..f3942f2d2ca2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List build service agent pool. + * + * @summary List build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_List.json + */ +async function buildServiceAgentPoolList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceAgentPool.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceAgentPoolList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts new file mode 100644 index 000000000000..60740254be14 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceAgentPoolUpdatePutSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuildServiceAgentPoolResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update build service agent pool. + * + * @summary Create or update build service agent pool. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceAgentPool_UpdatePut.json + */ +async function buildServiceAgentPoolUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const agentPoolName = "default"; + const agentPoolResource: BuildServiceAgentPoolResource = { + properties: { poolSize: { name: "S3" } } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceAgentPool.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + agentPoolResource + ); + console.log(result); +} + +buildServiceAgentPoolUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9fd9f2e922e1 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderCreateOrUpdateSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuilderResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a KPack builder. + * + * @summary Create or update a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json + */ +async function buildServiceBuilderCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const builderResource: BuilderResource = { + properties: { + buildpackGroups: [ + { name: "mix", buildpacks: [{ id: "tanzu-buildpacks/java-azure" }] } + ], + stack: { id: "io.buildpacks.stacks.bionic", version: "base" } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + builderResource + ); + console.log(result); +} + +buildServiceBuilderCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderDeleteSample.ts new file mode 100644 index 000000000000..a5c149c6519b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete a KPack builder. + * + * @summary Delete a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Delete.json + */ +async function buildServiceBuilderDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderGetSample.ts new file mode 100644 index 000000000000..b0853f0483d9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack builder. + * + * @summary Get a KPack builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_Get.json + */ +async function buildServiceBuilderGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "mybuilder"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceBuilder.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName + ); + console.log(result); +} + +buildServiceBuilderGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderListSample.ts new file mode 100644 index 000000000000..5ffeaee55c0a --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceBuilderListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack builders result. + * + * @summary List KPack builders result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildServiceBuilder_List.json + */ +async function buildServiceBuilderList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceBuilder.list( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceBuilderList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts new file mode 100644 index 000000000000..d291119ad979 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceCreateOrUpdateBuildSample.ts @@ -0,0 +1,49 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Build, AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a KPack build. + * + * @summary Create or update a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_CreateOrUpdateBuild.json + */ +async function buildServiceCreateOrUpdateBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const build: Build = { + properties: { + agentPool: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default", + builder: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default", + env: { environmentVariable: "test" }, + relativePath: + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.createOrUpdateBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + build + ); + console.log(result); +} + +buildServiceCreateOrUpdateBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultLogSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultLogSample.ts new file mode 100644 index 000000000000..0c35bdefbee4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultLogSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build result log download URL. + * + * @summary Get a KPack build result log download URL. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResultLog.json + */ +async function buildServiceGetBuildResultLog() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResultLog( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResultLog().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultSample.ts new file mode 100644 index 000000000000..2c366f21cff6 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildResultSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build result. + * + * @summary Get a KPack build result. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildResult.json + */ +async function buildServiceGetBuildResult() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const buildResultName = "123"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildResult( + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName + ); + console.log(result); +} + +buildServiceGetBuildResult().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildSample.ts new file mode 100644 index 000000000000..b29ac5e0cecf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a KPack build. + * + * @summary Get a KPack build. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuild.json + */ +async function buildServiceGetBuild() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuild( + resourceGroupName, + serviceName, + buildServiceName, + buildName + ); + console.log(result); +} + +buildServiceGetBuild().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildServiceSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildServiceSample.ts new file mode 100644 index 000000000000..f1db49f92e6e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetBuildServiceSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a build service resource. + * + * @summary Get a build service resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetBuildService.json + */ +async function buildServiceGetBuildService() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getBuildService( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetBuildService().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts new file mode 100644 index 000000000000..89243d370192 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetResourceUploadUrlSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @summary Get an resource upload URL for build service, which may be artifacts or source archive. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetResourceUploadUrl.json + */ +async function buildServiceGetResourceUploadUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getResourceUploadUrl( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceGetResourceUploadUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts new file mode 100644 index 000000000000..1a8f66c2b0c7 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedBuildpackSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the supported buildpack resource. + * + * @summary Get the supported buildpack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedBuildpack.json + */ +async function buildServiceGetSupportedBuildpack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildpackName = "tanzu-buildpacks-java-azure"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedBuildpack( + resourceGroupName, + serviceName, + buildServiceName, + buildpackName + ); + console.log(result); +} + +buildServiceGetSupportedBuildpack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedStackSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedStackSample.ts new file mode 100644 index 000000000000..c897a5e0467d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceGetSupportedStackSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the supported stack resource. + * + * @summary Get the supported stack resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_GetSupportedStack.json + */ +async function buildServiceGetSupportedStack() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const stackName = "io.buildpacks.stacks.bionic-base"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.getSupportedStack( + resourceGroupName, + serviceName, + buildServiceName, + stackName + ); + console.log(result); +} + +buildServiceGetSupportedStack().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildResultsSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildResultsSample.ts new file mode 100644 index 000000000000..999666a73cd4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildResultsSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack build results. + * + * @summary List KPack build results. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildResults.json + */ +async function buildServiceListBuildResults() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const buildName = "mybuild"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildResults( + resourceGroupName, + serviceName, + buildServiceName, + buildName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildResults().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildServicesSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildServicesSample.ts new file mode 100644 index 000000000000..30543425b720 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildServicesSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List build services resource. + * + * @summary List build services resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuildServices.json + */ +async function buildServiceListBuildServices() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuildServices( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuildServices().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildsSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildsSample.ts new file mode 100644 index 000000000000..6c9ca0f68887 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListBuildsSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List KPack builds. + * + * @summary List KPack builds. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListBuilds.json + */ +async function buildServiceListBuilds() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildServiceOperations.listBuilds( + resourceGroupName, + serviceName, + buildServiceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildServiceListBuilds().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts new file mode 100644 index 000000000000..1327dde3c966 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedBuildpacksSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get all supported buildpacks. + * + * @summary Get all supported buildpacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedBuildpacks.json + */ +async function buildServiceListSupportedBuildpacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedBuildpacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedBuildpacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedStacksSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedStacksSample.ts new file mode 100644 index 000000000000..40f88fa94e80 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildServiceListSupportedStacksSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get all supported stacks. + * + * @summary Get all supported stacks. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildService_ListSupportedStacks.json + */ +async function buildServiceListSupportedStacks() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildServiceOperations.listSupportedStacks( + resourceGroupName, + serviceName, + buildServiceName + ); + console.log(result); +} + +buildServiceListSupportedStacks().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts new file mode 100644 index 000000000000..12ef67660337 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingCreateOrUpdateSample.ts @@ -0,0 +1,59 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + BuildpackBindingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update a buildpack binding. + * + * @summary Create or update a buildpack binding. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_CreateOrUpdate.json + */ +async function buildpackBindingCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const buildpackBinding: BuildpackBindingResource = { + properties: { + bindingType: "ApplicationInsights", + launchProperties: { + properties: { + abc: "def", + anyString: "any-string", + samplingRate: "12.0" + }, + secrets: { + connectionString: + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding + ); + console.log(result); +} + +buildpackBindingCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingDeleteSample.ts new file mode 100644 index 000000000000..3dcb2b246e74 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingDeleteSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Buildpack Binding + * + * @summary Operation to delete a Buildpack Binding + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Delete.json + */ +async function buildpackBindingDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.beginDeleteAndWait( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingGetSample.ts new file mode 100644 index 000000000000..a31bae78936c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingGetSample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a buildpack binding by name. + * + * @summary Get a buildpack binding by name. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_Get.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const buildpackBindingName = "myBuildpackBinding"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.buildpackBinding.get( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName + ); + console.log(result); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingListSample.ts new file mode 100644 index 000000000000..e951e71bb253 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/buildpackBindingListSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all buildpack bindings in a builder. + * + * @summary Handles requests to list all buildpack bindings in a builder. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/BuildpackBinding_List.json + */ +async function buildpackBindingGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const buildServiceName = "default"; + const builderName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.buildpackBinding.list( + resourceGroupName, + serviceName, + buildServiceName, + builderName + )) { + resArray.push(item); + } + console.log(resArray); +} + +buildpackBindingGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f25bf7117c35 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CertificateResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update certificate resource. + * + * @summary Create or update certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_CreateOrUpdate.json + */ +async function certificatesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const certificateResource: CertificateResource = { + properties: { + type: "KeyVaultCertificate", + certVersion: "08a219d06d874795a96db47e06fbb01e", + keyVaultCertName: "mycert", + vaultUri: "https://myvault.vault.azure.net" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + certificateName, + certificateResource + ); + console.log(result); +} + +certificatesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesDeleteSample.ts new file mode 100644 index 000000000000..7db1c9877424 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the certificate resource. + * + * @summary Delete the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Delete.json + */ +async function certificatesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.beginDeleteAndWait( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesGetSample.ts new file mode 100644 index 000000000000..8ab5b74ef97d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the certificate resource. + * + * @summary Get the certificate resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_Get.json + */ +async function certificatesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const certificateName = "mycertificate"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.certificates.get( + resourceGroupName, + serviceName, + certificateName + ); + console.log(result); +} + +certificatesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesListSample.ts new file mode 100644 index 000000000000..da1d6022277e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/certificatesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all the certificates of one user. + * + * @summary List all the certificates of one user. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Certificates_List.json + */ +async function certificatesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.certificates.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +certificatesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersGetSample.ts new file mode 100644 index 000000000000..71621a915cb9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersGetSample.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the config server and its properties. + * + * @summary Get the config server and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Get.json + */ +async function configServersGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.get(resourceGroupName, serviceName); + console.log(result); +} + +configServersGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePatchSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePatchSample.ts new file mode 100644 index 000000000000..fc87b6343931 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePatchSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePatch.json + */ +async function configServersUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource: ConfigServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePutSample.ts new file mode 100644 index 000000000000..4bfd37686cfa --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersUpdatePutSample.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the config server. + * + * @summary Update the config server. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_UpdatePut.json + */ +async function configServersUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerResource: ConfigServerResource = { + properties: { + configServer: { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + configServerResource + ); + console.log(result); +} + +configServersUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersValidateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersValidateSample.ts new file mode 100644 index 000000000000..6262cea8e5a0 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configServersValidateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigServerSettings, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if the config server settings are valid. + * + * @summary Check if the config server settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigServers_Validate.json + */ +async function configServersValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configServerSettings: ConfigServerSettings = { + gitProperty: { + label: "master", + searchPaths: ["/"], + uri: "https://github.com/fake-user/fake-repository.git" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configServers.beginValidateAndWait( + resourceGroupName, + serviceName, + configServerSettings + ); + console.log(result); +} + +configServersValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f116ea415312 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigurationServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @summary Create the default Application Configuration Service or update the existing Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_CreateOrUpdate.json + */ +async function configurationServicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const configurationServiceResource: ConfigurationServiceResource = { + properties: { + settings: { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository" + } + ] + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource + ); + console.log(result); +} + +configurationServicesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesDeleteSample.ts new file mode 100644 index 000000000000..8d65fa2afdb8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Application Configuration Service. + * + * @summary Disable the default Application Configuration Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Delete.json + */ +async function configurationServicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginDeleteAndWait( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesGetSample.ts new file mode 100644 index 000000000000..e66b0136e79f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Application Configuration Service and its properties. + * + * @summary Get the Application Configuration Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Get.json + */ +async function configurationServicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.get( + resourceGroupName, + serviceName, + configurationServiceName + ); + console.log(result); +} + +configurationServicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesListSample.ts new file mode 100644 index 000000000000..7f2ddb25d9c2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_List.json + */ +async function configurationServicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.configurationServices.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +configurationServicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesValidateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesValidateSample.ts new file mode 100644 index 000000000000..5b2328e2ed29 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/configurationServicesValidateSample.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ConfigurationServiceSettings, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check if the Application Configuration Service settings are valid. + * + * @summary Check if the Application Configuration Service settings are valid. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ConfigurationServices_Validate.json + */ +async function configurationServicesValidate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const configurationServiceName = "default"; + const settings: ConfigurationServiceSettings = { + gitProperty: { + repositories: [ + { + name: "fake", + label: "master", + patterns: ["app/dev"], + uri: "https://github.com/fake-user/fake-repository" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.configurationServices.beginValidateAndWait( + resourceGroupName, + serviceName, + configurationServiceName, + settings + ); + console.log(result); +} + +configurationServicesValidate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7eed0cd3c7fe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsCreateOrUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update custom domain of one lifecycle application. + * + * @summary Create or update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_CreateOrUpdate.json + */ +async function customDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource: CustomDomainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsDeleteSample.ts new file mode 100644 index 000000000000..cba07e81cbcd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the custom domain of one lifecycle application. + * + * @summary Delete the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Delete.json + */ +async function customDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsGetSample.ts new file mode 100644 index 000000000000..d244db1582bc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the custom domain of one lifecycle application. + * + * @summary Get the custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Get.json + */ +async function customDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.get( + resourceGroupName, + serviceName, + appName, + domainName + ); + console.log(result); +} + +customDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsListSample.ts new file mode 100644 index 000000000000..c950368ef7c8 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List the custom domains of one lifecycle application. + * + * @summary List the custom domains of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_List.json + */ +async function customDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.customDomains.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +customDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsUpdateSample.ts new file mode 100644 index 000000000000..f4fbc2f6dbfe --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/customDomainsUpdateSample.ts @@ -0,0 +1,47 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update custom domain of one lifecycle application. + * + * @summary Update custom domain of one lifecycle application. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/CustomDomains_Update.json + */ +async function customDomainsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const domainName = "mydomain.com"; + const domainResource: CustomDomainResource = { + properties: { + certName: "mycert", + thumbprint: "934367bf1c97033f877db0f15cb1b586957d3133" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.customDomains.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + domainName, + domainResource + ); + console.log(result); +} + +customDomainsUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..76a028ac199d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsCreateOrUpdateSample.ts @@ -0,0 +1,114 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DeploymentResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate.json + */ +async function deploymentsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + deploymentSettings: { + addonConfigs: { + applicationConfigurationService: { + patterns: { + name: ["mypattern"] + } + } + }, + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" } + }, + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0" + } + }, + sku: { name: "S0", capacity: 1, tier: "Standard" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Deployment or update an exiting Deployment. + * + * @summary Create a new Deployment or update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json + */ +async function deploymentsCreateOrUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + deploymentSettings: { + environmentVariables: { env: "test" }, + resourceRequests: { cpu: "1000m", memory: "3Gi" } + }, + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myContainerImage:v1", + imageRegistryCredential: { + password: "myPassword", + username: "myUsername" + }, + languageFramework: "springboot", + server: "myacr.azurecr.io" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsCreateOrUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsDeleteSample.ts new file mode 100644 index 000000000000..f39c17972300 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Deployment. + * + * @summary Operation to delete a Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Delete.json + */ +async function deploymentsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginDeleteAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts new file mode 100644 index 000000000000..c759bbbe0cc9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateHeapDumpSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generate Heap Dump + * + * @summary Generate Heap Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateHeapDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateHeapDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts new file mode 100644 index 000000000000..57fc3c7ae66b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGenerateThreadDumpSample.ts @@ -0,0 +1,45 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Generate Thread Dump + * + * @summary Generate Thread Dump + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GenerateThreadDump.json + */ +async function deploymentsGenerateHeapDump() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginGenerateThreadDumpAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsGenerateHeapDump().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetLogFileUrlSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetLogFileUrlSample.ts new file mode 100644 index 000000000000..bfce5700d2dd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetLogFileUrlSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get deployment log file URL + * + * @summary Get deployment log file URL + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_GetLogFileUrl.json + */ +async function deploymentsGetLogFileUrl() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.getLogFileUrl( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetLogFileUrl().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetSample.ts new file mode 100644 index 000000000000..bd658b648e98 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsGetSample.ts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get.json + */ +async function deploymentsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGet().catch(console.error); + +/** + * This sample demonstrates how to Get a Deployment and its properties. + * + * @summary Get a Deployment and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Get_CustomContainer.json + */ +async function deploymentsGetCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.get( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsGetCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListForClusterSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListForClusterSample.ts new file mode 100644 index 000000000000..bb04c2847be5 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListForClusterSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List deployments for a certain service + * + * @summary List deployments for a certain service + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_ListForCluster.json + */ +async function deploymentsListForCluster() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.listForCluster( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsListForCluster().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListSample.ts new file mode 100644 index 000000000000..aa950eed396f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in an App. + * + * @summary Handles requests to list all resources in an App. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_List.json + */ +async function deploymentsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.deployments.list( + resourceGroupName, + serviceName, + appName + )) { + resArray.push(item); + } + console.log(resArray); +} + +deploymentsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsRestartSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsRestartSample.ts new file mode 100644 index 000000000000..07493d014386 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsRestartSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Restart the deployment. + * + * @summary Restart the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Restart.json + */ +async function deploymentsRestart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginRestartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsRestart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartJfrSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartJfrSample.ts new file mode 100644 index 000000000000..35e6b3e2f8ab --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartJfrSample.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DiagnosticParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start JFR + * + * @summary Start JFR + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_StartJFR.json + */ +async function deploymentsStartJfr() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const diagnosticParameters: DiagnosticParameters = { + appInstance: "myappinstance", + duration: "60s", + filePath: "/byos/diagnose" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartJFRAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters + ); + console.log(result); +} + +deploymentsStartJfr().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartSample.ts new file mode 100644 index 000000000000..ec8f56ffe3ff --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStartSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start the deployment. + * + * @summary Start the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Start.json + */ +async function deploymentsStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStartAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStopSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStopSample.ts new file mode 100644 index 000000000000..24a9fd9a03c1 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsStopSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop the deployment. + * + * @summary Stop the deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Stop.json + */ +async function deploymentsStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginStopAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName + ); + console.log(result); +} + +deploymentsStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsUpdateSample.ts new file mode 100644 index 000000000000..ad32420f9caf --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/deploymentsUpdateSample.ts @@ -0,0 +1,97 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + DeploymentResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update.json + */ +async function deploymentsUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + instances: [], + source: { + type: "Source", + artifactSelector: "sub-module-1", + relativePath: + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc", + version: "1.0" + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdate().catch(console.error); + +/** + * This sample demonstrates how to Operation to update an exiting Deployment. + * + * @summary Operation to update an exiting Deployment. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Deployments_Update_CustomContainer.json + */ +async function deploymentsUpdateCustomContainer() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const appName = "myapp"; + const deploymentName = "mydeployment"; + const deploymentResource: DeploymentResource = { + properties: { + instances: [], + source: { + type: "Container", + customContainer: { + args: ["-c", "while true; do echo hello; sleep 10;done"], + command: ["/bin/sh"], + containerImage: "myNewContainerImage:v1", + imageRegistryCredential: { + password: "", + username: "myNewUsername" + }, + server: "mynewacr.azurecr.io" + } + } + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.deployments.beginUpdateAndWait( + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource + ); + console.log(result); +} + +deploymentsUpdateCustomContainer().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..9fdc049cfe21 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsCreateOrUpdateSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayCustomDomainResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update the Spring Cloud Gateway custom domain. + * + * @summary Create or update the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json + */ +async function gatewayCustomDomainsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const gatewayCustomDomainResource: GatewayCustomDomainResource = { + properties: { thumbprint: "*" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName, + gatewayCustomDomainResource + ); + console.log(result); +} + +gatewayCustomDomainsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts new file mode 100644 index 000000000000..857cdac7ecec --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway custom domain. + * + * @summary Delete the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Delete.json + */ +async function gatewayCustomDomainsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsGetSample.ts new file mode 100644 index 000000000000..b2d1e9a59889 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway custom domain. + * + * @summary Get the Spring Cloud Gateway custom domain. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_Get.json + */ +async function gatewayCustomDomainsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const domainName = "myDomainName"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayCustomDomains.get( + resourceGroupName, + serviceName, + gatewayName, + domainName + ); + console.log(result); +} + +gatewayCustomDomainsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsListSample.ts new file mode 100644 index 000000000000..00fd3ad2f5e2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayCustomDomainsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway custom domains. + * + * @summary Handle requests to list all Spring Cloud Gateway custom domains. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayCustomDomains_List.json + */ +async function gatewayCustomDomainsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayCustomDomains.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayCustomDomainsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..88ac2615cf9b --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsCreateOrUpdateSample.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayRouteConfigResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @summary Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json + */ +async function gatewayRouteConfigsCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const gatewayRouteConfigResource: GatewayRouteConfigResource = { + properties: { + appResourceId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp", + routes: [ + { + filters: ["StripPrefix=2", "RateLimit=1,1s"], + predicates: ["Path=/api5/customer/**"], + ssoEnabled: true, + title: "myApp route config" + } + ] + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + gatewayRouteConfigResource + ); + console.log(result); +} + +gatewayRouteConfigsCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts new file mode 100644 index 000000000000..5f973acfb703 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsDeleteSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the Spring Cloud Gateway route config. + * + * @summary Delete the Spring Cloud Gateway route config. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Delete.json + */ +async function gatewayRouteConfigsDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsGetSample.ts new file mode 100644 index 000000000000..022ec6d0935f --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsGetSample.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway route configs. + * + * @summary Get the Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_Get.json + */ +async function gatewayRouteConfigsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const routeConfigName = "myRouteConfig"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gatewayRouteConfigs.get( + resourceGroupName, + serviceName, + gatewayName, + routeConfigName + ); + console.log(result); +} + +gatewayRouteConfigsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsListSample.ts new file mode 100644 index 000000000000..9dd386692c90 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewayRouteConfigsListSample.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handle requests to list all Spring Cloud Gateway route configs. + * + * @summary Handle requests to list all Spring Cloud Gateway route configs. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/GatewayRouteConfigs_List.json + */ +async function gatewayRouteConfigsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gatewayRouteConfigs.list( + resourceGroupName, + serviceName, + gatewayName + )) { + resArray.push(item); + } + console.log(resArray); +} + +gatewayRouteConfigsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysCreateOrUpdateSample.ts new file mode 100644 index 000000000000..8e710655cd82 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysCreateOrUpdateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + GatewayResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @summary Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_CreateOrUpdate.json + */ +async function gatewaysCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const gatewayResource: GatewayResource = { + properties: { public: true, resourceRequests: { cpu: "1", memory: "1G" } }, + sku: { name: "E0", capacity: 2, tier: "Enterprise" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + gatewayName, + gatewayResource + ); + console.log(result); +} + +gatewaysCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysDeleteSample.ts new file mode 100644 index 000000000000..47b1e99706c2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Spring Cloud Gateway. + * + * @summary Disable the default Spring Cloud Gateway. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Delete.json + */ +async function gatewaysDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.beginDeleteAndWait( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysGetSample.ts new file mode 100644 index 000000000000..b9c4aaa5bd35 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Spring Cloud Gateway and its properties. + * + * @summary Get the Spring Cloud Gateway and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_Get.json + */ +async function gatewaysGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.get( + resourceGroupName, + serviceName, + gatewayName + ); + console.log(result); +} + +gatewaysGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysListSample.ts new file mode 100644 index 000000000000..037edc040095 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_List.json + */ +async function gatewaysList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.gateways.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +gatewaysList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysValidateDomainSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysValidateDomainSample.ts new file mode 100644 index 000000000000..2b3c3fb51905 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/gatewaysValidateDomainSample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + CustomDomainValidatePayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Check the domains are valid as well as not in use. + * + * @summary Check the domains are valid as well as not in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Gateways_ValidateDomain.json + */ +async function gatewaysValidateDomain() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const gatewayName = "default"; + const validatePayload: CustomDomainValidatePayload = { name: "mydomain.io" }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.gateways.validateDomain( + resourceGroupName, + serviceName, + gatewayName, + validatePayload + ); + console.log(result); +} + +gatewaysValidateDomain().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsGetSample.ts new file mode 100644 index 000000000000..6e1e97242b05 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsGetSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Monitoring Setting and its properties. + * + * @summary Get the Monitoring Setting and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_Get.json + */ +async function monitoringSettingsGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.get( + resourceGroupName, + serviceName + ); + console.log(result); +} + +monitoringSettingsGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts new file mode 100644 index 000000000000..a0e8ec0e5c37 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePatchSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MonitoringSettingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePatch.json + */ +async function monitoringSettingsUpdatePatch() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource: MonitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePatchAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePatch().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePutSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePutSample.ts new file mode 100644 index 000000000000..da94a4ed4bef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/monitoringSettingsUpdatePutSample.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MonitoringSettingResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Update the Monitoring Setting. + * + * @summary Update the Monitoring Setting. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/MonitoringSettings_UpdatePut.json + */ +async function monitoringSettingsUpdatePut() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const monitoringSettingResource: MonitoringSettingResource = { + properties: { + appInsightsInstrumentationKey: "00000000-0000-0000-0000-000000000000", + appInsightsSamplingRate: 10, + traceEnabled: true + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.monitoringSettings.beginUpdatePutAndWait( + resourceGroupName, + serviceName, + monitoringSettingResource + ); + console.log(result); +} + +monitoringSettingsUpdatePut().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/operationsListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..cb8183f68b16 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/operationsListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Operations_List.json + */ +async function operationsList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +operationsList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts new file mode 100644 index 000000000000..232decc28d89 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/runtimeVersionsListRuntimeVersionsSample.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @summary Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json + */ +async function runtimeVersionsListRuntimeVersions() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.runtimeVersions.listRuntimeVersions(); + console.log(result); +} + +runtimeVersionsListRuntimeVersions().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..89cfc1eb1289 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesCreateOrUpdateSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create the default Service Registry or update the existing Service Registry. + * + * @summary Create the default Service Registry or update the existing Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_CreateOrUpdate.json + */ +async function serviceRegistriesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesDeleteSample.ts new file mode 100644 index 000000000000..7777e2649892 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable the default Service Registry. + * + * @summary Disable the default Service Registry. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Delete.json + */ +async function serviceRegistriesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.beginDeleteAndWait( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesGetSample.ts new file mode 100644 index 000000000000..8e2c5b28bdc9 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the Service Registry and its properties. + * + * @summary Get the Service Registry and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_Get.json + */ +async function serviceRegistriesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const serviceRegistryName = "default"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.serviceRegistries.get( + resourceGroupName, + serviceName, + serviceRegistryName + ); + console.log(result); +} + +serviceRegistriesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesListSample.ts new file mode 100644 index 000000000000..3194e4603279 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/serviceRegistriesListSample.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a Service. + * + * @summary Handles requests to list all resources in a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/ServiceRegistries_List.json + */ +async function serviceRegistriesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.serviceRegistries.list( + resourceGroupName, + serviceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +serviceRegistriesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCheckNameAvailabilitySample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..e5a0b6d4d875 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCheckNameAvailabilitySample.ts @@ -0,0 +1,39 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + NameAvailabilityParameters, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Checks that the resource name is valid and is not already in use. + * + * @summary Checks that the resource name is valid and is not already in use. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CheckNameAvailability.json + */ +async function servicesCheckNameAvailability() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const location = "eastus"; + const availabilityParameters: NameAvailabilityParameters = { + name: "myservice", + type: "Microsoft.AppPlatform/Spring" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.checkNameAvailability( + location, + availabilityParameters + ); + console.log(result); +} + +servicesCheckNameAvailability().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ba959e2e0685 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesCreateOrUpdateSample.ts @@ -0,0 +1,81 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate.json + */ +async function servicesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdate().catch(console.error); + +/** + * This sample demonstrates how to Create a new Service or update an exiting Service. + * + * @summary Create a new Service or update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json + */ +async function servicesCreateOrUpdateVNetInjection() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: { + networkProfile: { + appNetworkResourceGroup: "my-app-network-rg", + appSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps", + serviceCidr: "10.8.0.0/16,10.244.0.0/16,10.245.0.1/16", + serviceRuntimeNetworkResourceGroup: "my-service-runtime-network-rg", + serviceRuntimeSubnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime" + } + }, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesCreateOrUpdateVNetInjection().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDeleteSample.ts new file mode 100644 index 000000000000..cec8f52a524e --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to delete a Service. + * + * @summary Operation to delete a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Delete.json + */ +async function servicesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginDeleteAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDisableTestEndpointSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDisableTestEndpointSample.ts new file mode 100644 index 000000000000..85ac01c403fc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesDisableTestEndpointSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Disable test endpoint functionality for a Service. + * + * @summary Disable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_DisableTestEndpoint.json + */ +async function servicesDisableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.disableTestEndpoint( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesDisableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesEnableTestEndpointSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesEnableTestEndpointSample.ts new file mode 100644 index 000000000000..f00ea74e8464 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesEnableTestEndpointSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Enable test endpoint functionality for a Service. + * + * @summary Enable test endpoint functionality for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_EnableTestEndpoint.json + */ +async function servicesEnableTestEndpoint() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.enableTestEndpoint( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesEnableTestEndpoint().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesGetSample.ts new file mode 100644 index 000000000000..5dbe592a0ecd --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesGetSample.ts @@ -0,0 +1,30 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get a Service and its properties. + * + * @summary Get a Service and its properties. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Get.json + */ +async function servicesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.get(resourceGroupName, serviceName); + console.log(result); +} + +servicesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListBySubscriptionSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListBySubscriptionSample.ts new file mode 100644 index 000000000000..994fda4e5fa4 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListBySubscriptionSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a subscription. + * + * @summary Handles requests to list all resources in a subscription. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListBySubscription.json + */ +async function servicesListBySubscription() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.listBySubscription()) { + resArray.push(item); + } + console.log(resArray); +} + +servicesListBySubscription().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListSample.ts new file mode 100644 index 000000000000..b1dfae56602c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListSample.ts @@ -0,0 +1,32 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Handles requests to list all resources in a resource group. + * + * @summary Handles requests to list all resources in a resource group. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_List.json + */ +async function servicesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.services.list(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +servicesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListTestKeysSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListTestKeysSample.ts new file mode 100644 index 000000000000..9ab4ed1af0f2 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesListTestKeysSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List test keys for a Service. + * + * @summary List test keys for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_ListTestKeys.json + */ +async function servicesListTestKeys() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.listTestKeys( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesListTestKeys().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesRegenerateTestKeySample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesRegenerateTestKeySample.ts new file mode 100644 index 000000000000..7cefb695c7bc --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesRegenerateTestKeySample.ts @@ -0,0 +1,40 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RegenerateTestKeyRequestPayload, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Regenerate a test key for a Service. + * + * @summary Regenerate a test key for a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_RegenerateTestKey.json + */ +async function servicesRegenerateTestKey() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const regenerateTestKeyRequest: RegenerateTestKeyRequestPayload = { + keyType: "Primary" + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.regenerateTestKey( + resourceGroupName, + serviceName, + regenerateTestKeyRequest + ); + console.log(result); +} + +servicesRegenerateTestKey().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStartSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStartSample.ts new file mode 100644 index 000000000000..05a7cacc4767 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStartSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Start a Service. + * + * @summary Start a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Start.json + */ +async function servicesStart() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStartAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesStart().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStopSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStopSample.ts new file mode 100644 index 000000000000..3bd4b6495977 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesStopSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Stop a Service. + * + * @summary Stop a Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Stop.json + */ +async function servicesStop() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginStopAndWait( + resourceGroupName, + serviceName + ); + console.log(result); +} + +servicesStop().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesUpdateSample.ts new file mode 100644 index 000000000000..d989c2a742ef --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/servicesUpdateSample.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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ServiceResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Operation to update an exiting Service. + * + * @summary Operation to update an exiting Service. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Services_Update.json + */ +async function servicesUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const resource: ServiceResource = { + location: "eastus", + properties: {}, + sku: { name: "S0", tier: "Standard" }, + tags: { key1: "value1" } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.services.beginUpdateAndWait( + resourceGroupName, + serviceName, + resource + ); + console.log(result); +} + +servicesUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/skusListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/skusListSample.ts new file mode 100644 index 000000000000..8eb9edda85db --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/skusListSample.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @summary Lists all of the available skus of the Microsoft.AppPlatform provider. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Skus_List.json + */ +async function skusList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.skus.list()) { + resArray.push(item); + } + console.log(resArray); +} + +skusList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesCreateOrUpdateSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..485e96fb0705 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesCreateOrUpdateSample.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + StorageResource, + AppPlatformManagementClient +} from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Create or update storage resource. + * + * @summary Create or update storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_CreateOrUpdate.json + */ +async function storagesCreateOrUpdate() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const storageResource: StorageResource = { + properties: { + accountKey: "account-key-of-storage-account", + accountName: "storage-account-name", + storageType: "StorageAccount" + } + }; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginCreateOrUpdateAndWait( + resourceGroupName, + serviceName, + storageName, + storageResource + ); + console.log(result); +} + +storagesCreateOrUpdate().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesDeleteSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesDeleteSample.ts new file mode 100644 index 000000000000..7c98f959e31d --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Delete the storage resource. + * + * @summary Delete the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Delete.json + */ +async function storagesDelete() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.beginDeleteAndWait( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesDelete().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesGetSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesGetSample.ts new file mode 100644 index 000000000000..ea9e5d32550c --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesGetSample.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Get the storage resource. + * + * @summary Get the storage resource. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_Get.json + */ +async function storagesGet() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myservice"; + const storageName = "mystorage"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const result = await client.storages.get( + resourceGroupName, + serviceName, + storageName + ); + console.log(result); +} + +storagesGet().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesListSample.ts b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesListSample.ts new file mode 100644 index 000000000000..6c6a99170421 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/src/storagesListSample.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AppPlatformManagementClient } from "@azure/arm-appplatform"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to List all the storages of one Azure Spring Cloud instance. + * + * @summary List all the storages of one Azure Spring Cloud instance. + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-03-01-preview/examples/Storages_List.json + */ +async function storagesList() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = "myResourceGroup"; + const serviceName = "myService"; + const credential = new DefaultAzureCredential(); + const client = new AppPlatformManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.storages.list(resourceGroupName, serviceName)) { + resArray.push(item); + } + console.log(resArray); +} + +storagesList().catch(console.error); diff --git a/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/tsconfig.json b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/appplatform/arm-appplatform/samples/v2-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts index 7cd6566b6645..7dca6ea144ff 100644 --- a/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts +++ b/sdk/appplatform/arm-appplatform/src/appPlatformManagementClient.ts @@ -116,7 +116,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-01-01-preview"; + this.apiVersion = options.apiVersion || "2022-03-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 13578d641f38..448f414ea767 100644 --- a/sdk/appplatform/arm-appplatform/src/models/index.ts +++ b/sdk/appplatform/arm-appplatform/src/models/index.ts @@ -893,10 +893,28 @@ export interface LoadedCertificate { export interface ManagedIdentityProperties { /** Type of the managed identity */ type?: ManagedIdentityType; - /** Principal Id */ + /** Principal Id of system-assigned managed identity. */ principalId?: string; - /** Tenant Id */ + /** Tenant Id of system-assigned managed identity. */ tenantId?: string; + /** Properties of user-assigned managed identities */ + userAssignedIdentities?: { + [propertyName: string]: UserAssignedManagedIdentity; + }; +} + +/** The details of the user-assigned managed identity assigned to an App. */ +export interface UserAssignedManagedIdentity { + /** + * Principal Id of user-assigned managed identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * Client Id of user-assigned managed identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; } /** Object that includes an array of App resources and a possible link for next set */ @@ -1744,6 +1762,8 @@ export interface CustomContainer { args?: string[]; /** Credential of the image registry */ imageRegistryCredential?: ImageRegistryCredential; + /** Language framework of the container image uploaded */ + languageFramework?: string; } /** Credential of the image registry */ @@ -2022,6 +2042,8 @@ export type NetCoreZipUploadedUserSourceInfo = UploadedUserSourceInfo & { export enum KnownProvisioningState { Creating = "Creating", Updating = "Updating", + Starting = "Starting", + Stopping = "Stopping", Deleting = "Deleting", Deleted = "Deleted", Succeeded = "Succeeded", @@ -2038,6 +2060,8 @@ export enum KnownProvisioningState { * ### Known values supported by the service * **Creating** \ * **Updating** \ + * **Starting** \ + * **Stopping** \ * **Deleting** \ * **Deleted** \ * **Succeeded** \ diff --git a/sdk/appplatform/arm-appplatform/src/models/mappers.ts b/sdk/appplatform/arm-appplatform/src/models/mappers.ts index 2c14ffc1da45..9d094157b76d 100644 --- a/sdk/appplatform/arm-appplatform/src/models/mappers.ts +++ b/sdk/appplatform/arm-appplatform/src/models/mappers.ts @@ -2163,6 +2163,41 @@ export const ManagedIdentityProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "UserAssignedManagedIdentity" + } + } + } + } + } + } +}; + +export const UserAssignedManagedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedManagedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "String" + } } } } @@ -4333,6 +4368,12 @@ export const CustomContainer: coreClient.CompositeMapper = { name: "Composite", className: "ImageRegistryCredential" } + }, + languageFramework: { + serializedName: "languageFramework", + type: { + name: "String" + } } } } diff --git a/sdk/appplatform/arm-appplatform/src/models/parameters.ts b/sdk/appplatform/arm-appplatform/src/models/parameters.ts index 7f6461c5a744..3aa840e05696 100644 --- a/sdk/appplatform/arm-appplatform/src/models/parameters.ts +++ b/sdk/appplatform/arm-appplatform/src/models/parameters.ts @@ -67,7 +67,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-01-01-preview", + defaultValue: "2022-03-01-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/appplatform/arm-appplatform/tsconfig.json b/sdk/appplatform/arm-appplatform/tsconfig.json index 3e6ae96443f3..04fa881dd845 100644 --- a/sdk/appplatform/arm-appplatform/tsconfig.json +++ b/sdk/appplatform/arm-appplatform/tsconfig.json @@ -15,11 +15,17 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true + "importHelpers": true, + "paths": { + "@azure/arm-appplatform": [ + "./src/index" + ] + } }, "include": [ "./src/**/*.ts", - "./test/**/*.ts" + "./test/**/*.ts", + "samples-dev/**/*.ts" ], "exclude": [ "node_modules"