kazrael2119 2023-08-25 17:24:04 +08:00 коммит произвёл GitHub
Родитель c0c9995344
Коммит e3417c651c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
80 изменённых файлов: 7099 добавлений и 3 удалений

4
.github/CODEOWNERS поставляемый
Просмотреть файл

@ -723,6 +723,10 @@
/sdk/resourcehealth/arm-resourcehealth/ @qiaozha @MaryGao
/sdk/resourcehealth/ci.mgmt.yml @qiaozha @MaryGao
# PRLabel: %Mgmt
/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/ @qiaozha @MaryGao
/sdk/resourcesdeploymentstacks/ci.mgmt.yml @qiaozha @MaryGao
# PRLabel: %Mgmt
/sdk/resourcemover/arm-resourcemover/ @qiaozha @MaryGao
/sdk/resourcemover/ci.mgmt.yml @qiaozha @MaryGao

Просмотреть файл

@ -190,6 +190,7 @@ specifiers:
'@rush-temp/arm-resources': file:./projects/arm-resources.tgz
'@rush-temp/arm-resources-profile-2020-09-01-hybrid': file:./projects/arm-resources-profile-2020-09-01-hybrid.tgz
'@rush-temp/arm-resources-subscriptions': file:./projects/arm-resources-subscriptions.tgz
'@rush-temp/arm-resourcesdeploymentstacks': file:./projects/arm-resourcesdeploymentstacks.tgz
'@rush-temp/arm-scvmm': file:./projects/arm-scvmm.tgz
'@rush-temp/arm-search': file:./projects/arm-search.tgz
'@rush-temp/arm-security': file:./projects/arm-security.tgz
@ -550,6 +551,7 @@ dependencies:
'@rush-temp/arm-resources': file:projects/arm-resources.tgz
'@rush-temp/arm-resources-profile-2020-09-01-hybrid': file:projects/arm-resources-profile-2020-09-01-hybrid.tgz
'@rush-temp/arm-resources-subscriptions': file:projects/arm-resources-subscriptions.tgz
'@rush-temp/arm-resourcesdeploymentstacks': file:projects/arm-resourcesdeploymentstacks.tgz
'@rush-temp/arm-scvmm': file:projects/arm-scvmm.tgz
'@rush-temp/arm-search': file:projects/arm-search.tgz
'@rush-temp/arm-security': file:projects/arm-security.tgz
@ -4088,7 +4090,7 @@ packages:
dependencies:
semver: 7.5.4
shelljs: 0.8.5
typescript: 5.3.0-dev.20230824
typescript: 5.3.0-dev.20230825
dev: false
/ecdsa-sig-formatter/1.0.11:
@ -8657,8 +8659,8 @@ packages:
hasBin: true
dev: false
/typescript/5.3.0-dev.20230824:
resolution: {integrity: sha512-iiUWxGibzrRHEBLDJfVymsvpPKflf3cMrw0oQTMQoguFS2ikNlVlfQWAsYeHqGpRQc77nSQkzsE9rAHNHqvIjw==}
/typescript/5.3.0-dev.20230825:
resolution: {integrity: sha512-LbxxB17+nHqe7e6oA/240Ha1kOhtrgmLz98Dq3Nbm1sEdkqOnsv3j9XbI0tqd+RWtC/5pgnljHmZRHk/qUeKpQ==}
engines: {node: '>=14.17'}
hasBin: true
dev: false
@ -15238,6 +15240,37 @@ packages:
- supports-color
dev: false
file:projects/arm-resourcesdeploymentstacks.tgz:
resolution: {integrity: sha512-p16puIbqDXPmBD2qKJIWamOShrGypt1f474OMvs/dhlPs1gcFVq84e5SQnNH7rwwh78wmt7ZaWbNv2DobDugoQ==, tarball: file:projects/arm-resourcesdeploymentstacks.tgz}
name: '@rush-temp/arm-resourcesdeploymentstacks'
version: 0.0.0
dependencies:
'@azure/identity': 2.1.0
'@microsoft/api-extractor': 7.36.4_@types+node@14.18.54
'@rollup/plugin-commonjs': 24.1.0_rollup@2.79.1
'@rollup/plugin-json': 6.0.0_rollup@2.79.1
'@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
'@types/chai': 4.3.5
'@types/node': 14.18.54
chai: 4.3.7
cross-env: 7.0.3
dotenv: 16.3.1
mkdirp: 2.1.6
mocha: 7.2.0
rimraf: 3.0.2
rollup: 2.79.1
rollup-plugin-sourcemaps: 0.6.3_dmbj5memikchm63lpeyt6ukdau
ts-node: 10.9.1_n7tz6hmpirns3flqdptizaxofa
tslib: 2.6.2
typescript: 5.0.4
uglify-js: 3.17.4
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- supports-color
dev: false
file:projects/arm-scvmm.tgz:
resolution: {integrity: sha512-fIaEOvjvdHr0mm48Baa516AKY8eJMVC5T7Cvs5qWv3KEwIJBCE0iM2r3H54UbE1OS9zXW5Y2Ob9ZeelcqGoY3g==, tarball: file:projects/arm-scvmm.tgz}
name: '@rush-temp/arm-scvmm'

Просмотреть файл

@ -28,4 +28,5 @@ https://docs.microsoft.com/javascript/api/@azure/arm-quantum?view=azure-node-pre
https://docs.microsoft.com/javascript/api/@azure/arm-sphere?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-apicenter?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-defendereasm?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-hdinsightcontainers?view=azure-node-preview

Просмотреть файл

@ -2065,6 +2065,11 @@
"projectFolder": "sdk/sphere/arm-sphere",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-resourcesdeploymentstacks",
"projectFolder": "sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-apicenter",
"projectFolder": "sdk/apicenter/arm-apicenter",

Просмотреть файл

@ -0,0 +1,5 @@
# Release History
## 1.0.0-beta.1 (2023-08-21)
The package of @azure/arm-resourcesdeploymentstacks is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

Просмотреть файл

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2023 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -0,0 +1,109 @@
# Azure DeploymentStacks client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DeploymentStacks client.
The APIs listed in this specification can be used to manage deployment stack resources through the Azure Resource Manager.
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourcesdeploymentstacks) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started
### Currently supported environments
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- Latest versions of Safari, Chrome, Edge and Firefox.
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
### Prerequisites
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-resourcesdeploymentstacks` package
Install the Azure DeploymentStacks client library for JavaScript with `npm`:
```bash
npm install @azure/arm-resourcesdeploymentstacks
```
### Create and authenticate a `DeploymentStacksClient`
To create a client object to access the Azure DeploymentStacks API, you will need the `endpoint` of your Azure DeploymentStacks resource and a `credential`. The Azure DeploymentStacks client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure DeploymentStacks resource in the [Azure Portal][azure_portal].
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
```bash
npm install @azure/identity
```
You will also need to **register a new AAD application and grant access to Azure DeploymentStacks** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
```javascript
const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DeploymentStacksClient(new DefaultAzureCredential(), subscriptionId);
// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new DeploymentStacksClient(credential, subscriptionId);
```
### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
## Key concepts
### DeploymentStacksClient
`DeploymentStacksClient` is the primary interface for developers using the Azure DeploymentStacks client library. Explore the methods on this client object to understand the different features of the Azure DeploymentStacks service that you can access.
## Troubleshooting
### Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
```javascript
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
```
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
## Next steps
Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
## Related projects
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fresourcesdeploymentstacks%2Farm-resourcesdeploymentstacks%2FREADME.png)
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

Просмотреть файл

@ -0,0 +1,8 @@
{
"commit": "90e96702622e3cdd2a51701157a37b96b895383b",
"readme": "specification/resources/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.8 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.0",
"use": "@autorest/typescript@6.0.8"
}

Просмотреть файл

@ -0,0 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-resourcesdeploymentstacks.d.ts"
},
"messages": {
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/resourcesdeploymentstacks/arm-resourcesdeploymentstacks",
"Tag": "js/resourcesdeploymentstacks/arm-resourcesdeploymentstacks_2f2bdaf7a6"
}

Просмотреть файл

@ -0,0 +1,124 @@
{
"name": "@azure/arm-resourcesdeploymentstacks",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for DeploymentStacksClient.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=14.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.12.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-resourcesdeploymentstacks.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^2.1.2",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~5.0.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"dotenv": "^16.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^14.0.0",
"ts-node": "^10.0.0",
"@azure/dev-tool": "^1.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"dist-esm/**/*.js",
"dist-esm/**/*.js.map",
"dist-esm/**/*.d.ts",
"dist-esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"prepack": "npm run build",
"pack": "npm pack 2>&1",
"extract-api": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"execute:samples": "echo skipped",
"format": "echo skipped",
"test": "npm run integration-test",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/deploymentStacksClient.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview"
}
}

Просмотреть файл

@ -0,0 +1,469 @@
## API Report File for "@azure/arm-resourcesdeploymentstacks"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import * as coreAuth from '@azure/core-auth';
import * as coreClient from '@azure/core-client';
import { OperationState } from '@azure/core-lro';
import { PagedAsyncIterableIterator } from '@azure/core-paging';
import { SimplePollerLike } from '@azure/core-lro';
// @public
export interface AzureResourceBase {
readonly id?: string;
readonly name?: string;
readonly systemData?: SystemData;
readonly type?: string;
}
// @public
export type CreatedByType = string;
// @public
export interface DenySettings {
applyToChildScopes?: boolean;
excludedActions?: string[];
excludedPrincipals?: string[];
mode: DenySettingsMode;
}
// @public
export type DenySettingsMode = string;
// @public
export type DenyStatusMode = string;
// @public
export interface DeploymentStack extends AzureResourceBase {
actionOnUnmanage?: DeploymentStackPropertiesActionOnUnmanage;
debugSetting?: DeploymentStacksDebugSetting;
readonly deletedResources?: ResourceReference[];
denySettings?: DenySettings;
readonly deploymentId?: string;
deploymentScope?: string;
description?: string;
readonly detachedResources?: ResourceReference[];
readonly duration?: string;
error?: ErrorResponse;
readonly failedResources?: ResourceReferenceExtended[];
location?: string;
readonly outputs?: Record<string, unknown>;
parameters?: Record<string, unknown>;
parametersLink?: DeploymentStacksParametersLink;
readonly provisioningState?: DeploymentStackProvisioningState;
readonly resources?: ManagedResourceReference[];
tags?: {
[propertyName: string]: string;
};
template?: Record<string, unknown>;
templateLink?: DeploymentStacksTemplateLink;
}
// @public
export interface DeploymentStackListResult {
readonly nextLink?: string;
value?: DeploymentStack[];
}
// @public
export interface DeploymentStackProperties extends DeploymentStacksError {
actionOnUnmanage: DeploymentStackPropertiesActionOnUnmanage;
debugSetting?: DeploymentStacksDebugSetting;
readonly deletedResources?: ResourceReference[];
denySettings: DenySettings;
readonly deploymentId?: string;
deploymentScope?: string;
description?: string;
readonly detachedResources?: ResourceReference[];
readonly duration?: string;
readonly failedResources?: ResourceReferenceExtended[];
readonly outputs?: Record<string, unknown>;
parameters?: Record<string, unknown>;
parametersLink?: DeploymentStacksParametersLink;
readonly provisioningState?: DeploymentStackProvisioningState;
readonly resources?: ManagedResourceReference[];
template?: Record<string, unknown>;
templateLink?: DeploymentStacksTemplateLink;
}
// @public
export interface DeploymentStackPropertiesActionOnUnmanage {
managementGroups?: DeploymentStacksDeleteDetachEnum;
resourceGroups?: DeploymentStacksDeleteDetachEnum;
resources: DeploymentStacksDeleteDetachEnum;
}
// @public
export type DeploymentStackProvisioningState = string;
// @public
export interface DeploymentStacks {
beginCreateOrUpdateAtManagementGroup(managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams): Promise<SimplePollerLike<OperationState<DeploymentStacksCreateOrUpdateAtManagementGroupResponse>, DeploymentStacksCreateOrUpdateAtManagementGroupResponse>>;
beginCreateOrUpdateAtManagementGroupAndWait(managementGroupId: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams): Promise<DeploymentStacksCreateOrUpdateAtManagementGroupResponse>;
beginCreateOrUpdateAtResourceGroup(resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams): Promise<SimplePollerLike<OperationState<DeploymentStacksCreateOrUpdateAtResourceGroupResponse>, DeploymentStacksCreateOrUpdateAtResourceGroupResponse>>;
beginCreateOrUpdateAtResourceGroupAndWait(resourceGroupName: string, deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams): Promise<DeploymentStacksCreateOrUpdateAtResourceGroupResponse>;
beginCreateOrUpdateAtSubscription(deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams): Promise<SimplePollerLike<OperationState<DeploymentStacksCreateOrUpdateAtSubscriptionResponse>, DeploymentStacksCreateOrUpdateAtSubscriptionResponse>>;
beginCreateOrUpdateAtSubscriptionAndWait(deploymentStackName: string, deploymentStack: DeploymentStack, options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams): Promise<DeploymentStacksCreateOrUpdateAtSubscriptionResponse>;
beginDeleteAtManagementGroup(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtManagementGroupOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
beginDeleteAtManagementGroupAndWait(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtManagementGroupOptionalParams): Promise<void>;
beginDeleteAtResourceGroup(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtResourceGroupOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
beginDeleteAtResourceGroupAndWait(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksDeleteAtResourceGroupOptionalParams): Promise<void>;
beginDeleteAtSubscription(deploymentStackName: string, options?: DeploymentStacksDeleteAtSubscriptionOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
beginDeleteAtSubscriptionAndWait(deploymentStackName: string, options?: DeploymentStacksDeleteAtSubscriptionOptionalParams): Promise<void>;
exportTemplateAtManagementGroup(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams): Promise<DeploymentStacksExportTemplateAtManagementGroupResponse>;
exportTemplateAtResourceGroup(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams): Promise<DeploymentStacksExportTemplateAtResourceGroupResponse>;
exportTemplateAtSubscription(deploymentStackName: string, options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams): Promise<DeploymentStacksExportTemplateAtSubscriptionResponse>;
getAtManagementGroup(managementGroupId: string, deploymentStackName: string, options?: DeploymentStacksGetAtManagementGroupOptionalParams): Promise<DeploymentStacksGetAtManagementGroupResponse>;
getAtResourceGroup(resourceGroupName: string, deploymentStackName: string, options?: DeploymentStacksGetAtResourceGroupOptionalParams): Promise<DeploymentStacksGetAtResourceGroupResponse>;
getAtSubscription(deploymentStackName: string, options?: DeploymentStacksGetAtSubscriptionOptionalParams): Promise<DeploymentStacksGetAtSubscriptionResponse>;
listAtManagementGroup(managementGroupId: string, options?: DeploymentStacksListAtManagementGroupOptionalParams): PagedAsyncIterableIterator<DeploymentStack>;
listAtResourceGroup(resourceGroupName: string, options?: DeploymentStacksListAtResourceGroupOptionalParams): PagedAsyncIterableIterator<DeploymentStack>;
listAtSubscription(options?: DeploymentStacksListAtSubscriptionOptionalParams): PagedAsyncIterableIterator<DeploymentStack>;
}
// @public (undocumented)
export class DeploymentStacksClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: DeploymentStacksClientOptionalParams);
constructor(credentials: coreAuth.TokenCredential, options?: DeploymentStacksClientOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
deploymentStacks: DeploymentStacks;
// (undocumented)
subscriptionId?: string;
}
// @public
export interface DeploymentStacksClientOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}
// @public
export interface DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type DeploymentStacksCreateOrUpdateAtManagementGroupResponse = DeploymentStack;
// @public
export interface DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type DeploymentStacksCreateOrUpdateAtResourceGroupResponse = DeploymentStack;
// @public
export interface DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type DeploymentStacksCreateOrUpdateAtSubscriptionResponse = DeploymentStack;
// @public
export interface DeploymentStacksDebugSetting {
detailLevel?: string;
}
// @public
export interface DeploymentStacksDeleteAtManagementGroupHeaders {
// (undocumented)
location?: string;
}
// @public
export interface DeploymentStacksDeleteAtManagementGroupOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
unmanageActionManagementGroups?: UnmanageActionManagementGroupMode;
unmanageActionResourceGroups?: UnmanageActionResourceGroupMode;
unmanageActionResources?: UnmanageActionResourceMode;
updateIntervalInMs?: number;
}
// @public
export interface DeploymentStacksDeleteAtResourceGroupHeaders {
// (undocumented)
location?: string;
}
// @public
export interface DeploymentStacksDeleteAtResourceGroupOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
unmanageActionResourceGroups?: UnmanageActionResourceGroupMode;
unmanageActionResources?: UnmanageActionResourceMode;
updateIntervalInMs?: number;
}
// @public
export interface DeploymentStacksDeleteAtSubscriptionHeaders {
// (undocumented)
location?: string;
}
// @public
export interface DeploymentStacksDeleteAtSubscriptionOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
unmanageActionResourceGroups?: UnmanageActionResourceGroupMode;
unmanageActionResources?: UnmanageActionResourceMode;
updateIntervalInMs?: number;
}
// @public
export type DeploymentStacksDeleteDetachEnum = string;
// @public
export interface DeploymentStacksError {
error?: ErrorResponse;
}
// @public
export interface DeploymentStacksExportTemplateAtManagementGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksExportTemplateAtManagementGroupResponse = DeploymentStackTemplateDefinition;
// @public
export interface DeploymentStacksExportTemplateAtResourceGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksExportTemplateAtResourceGroupResponse = DeploymentStackTemplateDefinition;
// @public
export interface DeploymentStacksExportTemplateAtSubscriptionOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksExportTemplateAtSubscriptionResponse = DeploymentStackTemplateDefinition;
// @public
export interface DeploymentStacksGetAtManagementGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksGetAtManagementGroupResponse = DeploymentStack;
// @public
export interface DeploymentStacksGetAtResourceGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksGetAtResourceGroupResponse = DeploymentStack;
// @public
export interface DeploymentStacksGetAtSubscriptionOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksGetAtSubscriptionResponse = DeploymentStack;
// @public
export interface DeploymentStacksListAtManagementGroupNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksListAtManagementGroupNextResponse = DeploymentStackListResult;
// @public
export interface DeploymentStacksListAtManagementGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksListAtManagementGroupResponse = DeploymentStackListResult;
// @public
export interface DeploymentStacksListAtResourceGroupNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksListAtResourceGroupNextResponse = DeploymentStackListResult;
// @public
export interface DeploymentStacksListAtResourceGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksListAtResourceGroupResponse = DeploymentStackListResult;
// @public
export interface DeploymentStacksListAtSubscriptionNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksListAtSubscriptionNextResponse = DeploymentStackListResult;
// @public
export interface DeploymentStacksListAtSubscriptionOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DeploymentStacksListAtSubscriptionResponse = DeploymentStackListResult;
// @public
export interface DeploymentStacksParametersLink {
contentVersion?: string;
uri: string;
}
// @public
export interface DeploymentStacksTemplateLink {
contentVersion?: string;
id?: string;
queryString?: string;
relativePath?: string;
uri?: string;
}
// @public
export interface DeploymentStackTemplateDefinition {
template?: Record<string, unknown>;
templateLink?: DeploymentStacksTemplateLink;
}
// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, unknown>;
readonly type?: string;
}
// @public
export interface ErrorDetail {
readonly additionalInfo?: ErrorAdditionalInfo[];
readonly code?: string;
readonly details?: ErrorDetail[];
readonly message?: string;
readonly target?: string;
}
// @public
export interface ErrorResponse {
error?: ErrorDetail;
}
// @public
export function getContinuationToken(page: unknown): string | undefined;
// @public
export enum KnownCreatedByType {
Application = "Application",
Key = "Key",
ManagedIdentity = "ManagedIdentity",
User = "User"
}
// @public
export enum KnownDenySettingsMode {
DenyDelete = "denyDelete",
DenyWriteAndDelete = "denyWriteAndDelete",
None = "none"
}
// @public
export enum KnownDenyStatusMode {
DenyDelete = "denyDelete",
DenyWriteAndDelete = "denyWriteAndDelete",
Inapplicable = "inapplicable",
None = "None",
NotSupported = "notSupported",
RemovedBySystem = "removedBySystem"
}
// @public
export enum KnownDeploymentStackProvisioningState {
Canceled = "Canceled",
Canceling = "Canceling",
Creating = "Creating",
Deleting = "Deleting",
DeletingResources = "DeletingResources",
Deploying = "Deploying",
Failed = "Failed",
Locking = "Locking",
Succeeded = "Succeeded",
Validating = "Validating",
Waiting = "Waiting"
}
// @public
export enum KnownDeploymentStacksDeleteDetachEnum {
Delete = "delete",
Detach = "detach"
}
// @public
export enum KnownResourceStatusMode {
DeleteFailed = "deleteFailed",
Managed = "Managed",
None = "None",
RemoveDenyFailed = "removeDenyFailed"
}
// @public
export enum KnownUnmanageActionManagementGroupMode {
Delete = "delete",
Detach = "detach"
}
// @public
export enum KnownUnmanageActionResourceGroupMode {
Delete = "delete",
Detach = "detach"
}
// @public
export enum KnownUnmanageActionResourceMode {
Delete = "delete",
Detach = "detach"
}
// @public
export interface ManagedResourceReference extends ResourceReference {
denyStatus?: DenyStatusMode;
status?: ResourceStatusMode;
}
// @public
export interface ResourceReference {
readonly id?: string;
}
// @public
export interface ResourceReferenceExtended extends ResourceReference, DeploymentStacksError {
}
// @public
export type ResourceStatusMode = string;
// @public
export interface SystemData {
createdAt?: Date;
createdBy?: string;
createdByType?: CreatedByType;
lastModifiedAt?: Date;
lastModifiedBy?: string;
lastModifiedByType?: CreatedByType;
}
// @public
export type UnmanageActionManagementGroupMode = string;
// @public
export type UnmanageActionResourceGroupMode = string;
// @public
export type UnmanageActionResourceMode = string;
// (No @packageDocumentation comment for this package)
```

Просмотреть файл

@ -0,0 +1,122 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import nodeResolve from "@rollup/plugin-node-resolve";
import cjs from "@rollup/plugin-commonjs";
import sourcemaps from "rollup-plugin-sourcemaps";
import multiEntry from "@rollup/plugin-multi-entry";
import json from "@rollup/plugin-json";
import nodeBuiltins from "builtin-modules";
// #region Warning Handler
/**
* A function that can determine whether a rollup warning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/
function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}
function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
/**
* Construct a warning handler for the shared rollup configuration
* that ignores certain warnings that are not relevant to testing.
*/
function makeOnWarnForTesting() {
return (warning, warn) => {
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
if (warningInhibitors.every((inhib) => !inhib(warning))) {
warn(warning);
}
};
}
// #endregion
function makeBrowserTestConfig() {
const config = {
input: {
include: ["dist-esm/test/**/*.spec.js"],
exclude: ["dist-esm/test/**/node/**"]
},
output: {
file: `dist-test/index.browser.js`,
format: "umd",
sourcemap: true
},
preserveSymlinks: false,
plugins: [
multiEntry({ exports: false }),
nodeResolve({
mainFields: ["module", "browser"]
}),
cjs(),
json(),
sourcemaps()
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
],
onwarn: makeOnWarnForTesting(),
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
// rollup started respecting the "sideEffects" field in package.json. Since
// our package.json sets "sideEffects=false", this also applies to test
// code, which causes all tests to be removed by tree-shaking.
treeshake: false
};
return config;
}
const defaultConfigurationOptions = {
disableBrowserBundle: false
};
export function makeConfig(pkg, options) {
options = {
...defaultConfigurationOptions,
...(options || {})
};
const baseConfig = {
// Use the package's module field if it has one
input: pkg["module"] || "dist-esm/src/index.js",
external: [
...nodeBuiltins,
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies)
],
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
preserveSymlinks: false,
plugins: [sourcemaps(), nodeResolve()]
};
const config = [baseConfig];
if (!options.disableBrowserBundle) {
config.push(makeBrowserTestConfig());
}
return config;
}
export default makeConfig(require("./package.json"));

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -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 {
DeploymentStack,
DeploymentStacksClient
} from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack: DeploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete"
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete"
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" }
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.beginCreateOrUpdateAtManagementGroupAndWait(
managementGroupId,
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,64 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
DeploymentStack,
DeploymentStacksClient
} from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack: DeploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete"
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete"
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" }
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait(
resourceGroupName,
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,60 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
DeploymentStack,
DeploymentStacksClient
} from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack: DeploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete"
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete"
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" }
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginCreateOrUpdateAtSubscriptionAndWait(
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupDelete.json
*/
async function deploymentStacksDelete() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.beginDeleteAtManagementGroupAndWait(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupDelete.json
*/
async function deploymentStacksDelete() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginDeleteAtResourceGroupAndWait(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionDelete.json
*/
async function deploymentStacksDelete() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginDeleteAtSubscriptionAndWait(
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.exportTemplateAtManagementGroup(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"subscriptions/00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.exportTemplateAtResourceGroup(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"subscriptions/00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.exportTemplateAtSubscription(
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupGet.json
*/
async function deploymentStacksGet() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.getAtManagementGroup(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupGet.json
*/
async function deploymentStacksGet() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.getAtResourceGroup(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionGet.json
*/
async function deploymentStacksGet() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.getAtSubscription(
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified management group.
*
* @summary Lists all the Deployment Stacks within the specified management group.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupList.json
*/
async function deploymentStacksList() {
const managementGroupId = "myMg";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtManagementGroup(
managementGroupId
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified resource group.
*
* @summary Lists all the Deployment Stacks within the specified resource group.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupList.json
*/
async function deploymentStacksList() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified subscription.
*
* @summary Lists all the Deployment Stacks within the specified subscription.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionList.json
*/
async function deploymentStacksList() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtSubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,78 @@
# 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** |
| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [deploymentStacksCreateOrUpdateAtManagementGroupSample.js][deploymentstackscreateorupdateatmanagementgroupsample] | Creates or updates a Deployment Stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupCreate.json |
| [deploymentStacksCreateOrUpdateAtResourceGroupSample.js][deploymentstackscreateorupdateatresourcegroupsample] | Creates or updates a Deployment Stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupCreate.json |
| [deploymentStacksCreateOrUpdateAtSubscriptionSample.js][deploymentstackscreateorupdateatsubscriptionsample] | Creates or updates a Deployment Stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionCreate.json |
| [deploymentStacksDeleteAtManagementGroupSample.js][deploymentstacksdeleteatmanagementgroupsample] | Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupDelete.json |
| [deploymentStacksDeleteAtResourceGroupSample.js][deploymentstacksdeleteatresourcegroupsample] | Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupDelete.json |
| [deploymentStacksDeleteAtSubscriptionSample.js][deploymentstacksdeleteatsubscriptionsample] | Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionDelete.json |
| [deploymentStacksExportTemplateAtManagementGroupSample.js][deploymentstacksexporttemplateatmanagementgroupsample] | Exports the template used to create the deployment stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupExportTemplate.json |
| [deploymentStacksExportTemplateAtResourceGroupSample.js][deploymentstacksexporttemplateatresourcegroupsample] | Exports the template used to create the deployment stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackExportTemplate.json |
| [deploymentStacksExportTemplateAtSubscriptionSample.js][deploymentstacksexporttemplateatsubscriptionsample] | Exports the template used to create the deployment stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionExportTemplate.json |
| [deploymentStacksGetAtManagementGroupSample.js][deploymentstacksgetatmanagementgroupsample] | Gets a Deployment Stack with a given name. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupGet.json |
| [deploymentStacksGetAtResourceGroupSample.js][deploymentstacksgetatresourcegroupsample] | Gets a Deployment Stack with a given name. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupGet.json |
| [deploymentStacksGetAtSubscriptionSample.js][deploymentstacksgetatsubscriptionsample] | Gets a Deployment Stack with a given name. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionGet.json |
| [deploymentStacksListAtManagementGroupSample.js][deploymentstackslistatmanagementgroupsample] | Lists all the Deployment Stacks within the specified management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupList.json |
| [deploymentStacksListAtResourceGroupSample.js][deploymentstackslistatresourcegroupsample] | Lists all the Deployment Stacks within the specified resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupList.json |
| [deploymentStacksListAtSubscriptionSample.js][deploymentstackslistatsubscriptionsample] | Lists all the Deployment Stacks within the specified subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionList.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
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 deploymentStacksCreateOrUpdateAtManagementGroupSample.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 deploymentStacksCreateOrUpdateAtManagementGroupSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[deploymentstackscreateorupdateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksCreateOrUpdateAtManagementGroupSample.js
[deploymentstackscreateorupdateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksCreateOrUpdateAtResourceGroupSample.js
[deploymentstackscreateorupdateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksCreateOrUpdateAtSubscriptionSample.js
[deploymentstacksdeleteatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksDeleteAtManagementGroupSample.js
[deploymentstacksdeleteatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksDeleteAtResourceGroupSample.js
[deploymentstacksdeleteatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksDeleteAtSubscriptionSample.js
[deploymentstacksexporttemplateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksExportTemplateAtManagementGroupSample.js
[deploymentstacksexporttemplateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksExportTemplateAtResourceGroupSample.js
[deploymentstacksexporttemplateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksExportTemplateAtSubscriptionSample.js
[deploymentstacksgetatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksGetAtManagementGroupSample.js
[deploymentstacksgetatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksGetAtResourceGroupSample.js
[deploymentstacksgetatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksGetAtSubscriptionSample.js
[deploymentstackslistatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksListAtManagementGroupSample.js
[deploymentstackslistatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksListAtResourceGroupSample.js
[deploymentstackslistatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/javascript/deploymentStacksListAtSubscriptionSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete",
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete",
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" },
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.beginCreateOrUpdateAtManagementGroupAndWait(
managementGroupId,
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,58 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code 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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete",
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete",
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" },
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait(
resourceGroupName,
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -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.
const { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete",
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete",
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" },
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginCreateOrUpdateAtSubscriptionAndWait(
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupDelete.json
*/
async function deploymentStacksDelete() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.beginDeleteAtManagementGroupAndWait(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupDelete.json
*/
async function deploymentStacksDelete() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginDeleteAtResourceGroupAndWait(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionDelete.json
*/
async function deploymentStacksDelete() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginDeleteAtSubscriptionAndWait(
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.exportTemplateAtManagementGroup(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"subscriptions/00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.exportTemplateAtResourceGroup(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"subscriptions/00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.exportTemplateAtSubscription(deploymentStackName);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupGet.json
*/
async function deploymentStacksGet() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.getAtManagementGroup(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupGet.json
*/
async function deploymentStacksGet() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.getAtResourceGroup(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionGet.json
*/
async function deploymentStacksGet() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.getAtSubscription(deploymentStackName);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified management group.
*
* @summary Lists all the Deployment Stacks within the specified management group.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupList.json
*/
async function deploymentStacksList() {
const managementGroupId = "myMg";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtManagementGroup(managementGroupId)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified resource group.
*
* @summary Lists all the Deployment Stacks within the specified resource group.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupList.json
*/
async function deploymentStacksList() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] || "deploymentStacksRG";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } = require("@azure/arm-resourcesdeploymentstacks");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified subscription.
*
* @summary Lists all the Deployment Stacks within the specified subscription.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionList.json
*/
async function deploymentStacksList() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtSubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,32 @@
{
"name": "@azure-samples/arm-resourcesdeploymentstacks-js-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript (Beta)",
"engines": {
"node": ">=14.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks"
},
"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/resourcesdeploymentstacks/arm-resourcesdeploymentstacks",
"dependencies": {
"@azure/arm-resourcesdeploymentstacks": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -0,0 +1,91 @@
# 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** |
| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [deploymentStacksCreateOrUpdateAtManagementGroupSample.ts][deploymentstackscreateorupdateatmanagementgroupsample] | Creates or updates a Deployment Stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupCreate.json |
| [deploymentStacksCreateOrUpdateAtResourceGroupSample.ts][deploymentstackscreateorupdateatresourcegroupsample] | Creates or updates a Deployment Stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupCreate.json |
| [deploymentStacksCreateOrUpdateAtSubscriptionSample.ts][deploymentstackscreateorupdateatsubscriptionsample] | Creates or updates a Deployment Stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionCreate.json |
| [deploymentStacksDeleteAtManagementGroupSample.ts][deploymentstacksdeleteatmanagementgroupsample] | Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupDelete.json |
| [deploymentStacksDeleteAtResourceGroupSample.ts][deploymentstacksdeleteatresourcegroupsample] | Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupDelete.json |
| [deploymentStacksDeleteAtSubscriptionSample.ts][deploymentstacksdeleteatsubscriptionsample] | Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionDelete.json |
| [deploymentStacksExportTemplateAtManagementGroupSample.ts][deploymentstacksexporttemplateatmanagementgroupsample] | Exports the template used to create the deployment stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupExportTemplate.json |
| [deploymentStacksExportTemplateAtResourceGroupSample.ts][deploymentstacksexporttemplateatresourcegroupsample] | Exports the template used to create the deployment stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackExportTemplate.json |
| [deploymentStacksExportTemplateAtSubscriptionSample.ts][deploymentstacksexporttemplateatsubscriptionsample] | Exports the template used to create the deployment stack. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionExportTemplate.json |
| [deploymentStacksGetAtManagementGroupSample.ts][deploymentstacksgetatmanagementgroupsample] | Gets a Deployment Stack with a given name. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupGet.json |
| [deploymentStacksGetAtResourceGroupSample.ts][deploymentstacksgetatresourcegroupsample] | Gets a Deployment Stack with a given name. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupGet.json |
| [deploymentStacksGetAtSubscriptionSample.ts][deploymentstacksgetatsubscriptionsample] | Gets a Deployment Stack with a given name. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionGet.json |
| [deploymentStacksListAtManagementGroupSample.ts][deploymentstackslistatmanagementgroupsample] | Lists all the Deployment Stacks within the specified management group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupList.json |
| [deploymentStacksListAtResourceGroupSample.ts][deploymentstackslistatresourcegroupsample] | Lists all the Deployment Stacks within the specified resource group. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupList.json |
| [deploymentStacksListAtSubscriptionSample.ts][deploymentstackslistatsubscriptionsample] | Lists all the Deployment Stacks within the specified subscription. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionList.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
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/deploymentStacksCreateOrUpdateAtManagementGroupSample.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/deploymentStacksCreateOrUpdateAtManagementGroupSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[deploymentstackscreateorupdateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksCreateOrUpdateAtManagementGroupSample.ts
[deploymentstackscreateorupdateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksCreateOrUpdateAtResourceGroupSample.ts
[deploymentstackscreateorupdateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksCreateOrUpdateAtSubscriptionSample.ts
[deploymentstacksdeleteatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksDeleteAtManagementGroupSample.ts
[deploymentstacksdeleteatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksDeleteAtResourceGroupSample.ts
[deploymentstacksdeleteatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksDeleteAtSubscriptionSample.ts
[deploymentstacksexporttemplateatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksExportTemplateAtManagementGroupSample.ts
[deploymentstacksexporttemplateatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksExportTemplateAtResourceGroupSample.ts
[deploymentstacksexporttemplateatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksExportTemplateAtSubscriptionSample.ts
[deploymentstacksgetatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksGetAtManagementGroupSample.ts
[deploymentstacksgetatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksGetAtResourceGroupSample.ts
[deploymentstacksgetatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksGetAtSubscriptionSample.ts
[deploymentstackslistatmanagementgroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksListAtManagementGroupSample.ts
[deploymentstackslistatresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksListAtResourceGroupSample.ts
[deploymentstackslistatsubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/samples/v1-beta/typescript/src/deploymentStacksListAtSubscriptionSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

Просмотреть файл

@ -0,0 +1,41 @@
{
"name": "@azure-samples/arm-resourcesdeploymentstacks-ts-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript (Beta)",
"engines": {
"node": ">=14.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks"
},
"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/resourcesdeploymentstacks/arm-resourcesdeploymentstacks",
"dependencies": {
"@azure/arm-resourcesdeploymentstacks": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~5.0.0",
"rimraf": "latest"
}
}

Просмотреть файл

@ -0,0 +1,4 @@
# App registration secret for AAD authentication
AZURE_CLIENT_SECRET=
AZURE_CLIENT_ID=
AZURE_TENANT_ID=

Просмотреть файл

@ -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 {
DeploymentStack,
DeploymentStacksClient
} from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack: DeploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete"
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete"
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" }
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.beginCreateOrUpdateAtManagementGroupAndWait(
managementGroupId,
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,64 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
DeploymentStack,
DeploymentStacksClient
} from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack: DeploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete"
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete"
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" }
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait(
resourceGroupName,
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,60 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
DeploymentStack,
DeploymentStacksClient
} from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Creates or updates a Deployment Stack.
*
* @summary Creates or updates a Deployment Stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionCreate.json
*/
async function deploymentStacksCreateOrUpdate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const deploymentStack: DeploymentStack = {
actionOnUnmanage: {
managementGroups: "detach",
resourceGroups: "delete",
resources: "delete"
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete"
},
location: "eastus",
parameters: { parameter1: { value: "a string" } },
tags: { tagkey: "tagVal" }
};
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginCreateOrUpdateAtSubscriptionAndWait(
deploymentStackName,
deploymentStack
);
console.log(result);
}
async function main() {
deploymentStacksCreateOrUpdate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupDelete.json
*/
async function deploymentStacksDelete() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.beginDeleteAtManagementGroupAndWait(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupDelete.json
*/
async function deploymentStacksDelete() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginDeleteAtResourceGroupAndWait(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
*
* @summary Deletes a Deployment Stack by name. When operation completes, status code 200 returned without content.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionDelete.json
*/
async function deploymentStacksDelete() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.beginDeleteAtSubscriptionAndWait(
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksDelete();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.exportTemplateAtManagementGroup(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"subscriptions/00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.exportTemplateAtResourceGroup(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Exports the template used to create the deployment stack.
*
* @summary Exports the template used to create the deployment stack.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionExportTemplate.json
*/
async function deploymentStacksExportTemplate() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"subscriptions/00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.exportTemplateAtSubscription(
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksExportTemplate();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupGet.json
*/
async function deploymentStacksGet() {
const managementGroupId = "myMg";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const result = await client.deploymentStacks.getAtManagementGroup(
managementGroupId,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupGet.json
*/
async function deploymentStacksGet() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.getAtResourceGroup(
resourceGroupName,
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Gets a Deployment Stack with a given name.
*
* @summary Gets a Deployment Stack with a given name.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionGet.json
*/
async function deploymentStacksGet() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const deploymentStackName = "simpleDeploymentStack";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const result = await client.deploymentStacks.getAtSubscription(
deploymentStackName
);
console.log(result);
}
async function main() {
deploymentStacksGet();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified management group.
*
* @summary Lists all the Deployment Stacks within the specified management group.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackManagementGroupList.json
*/
async function deploymentStacksList() {
const managementGroupId = "myMg";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtManagementGroup(
managementGroupId
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified resource group.
*
* @summary Lists all the Deployment Stacks within the specified resource group.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackResourceGroupList.json
*/
async function deploymentStacksList() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const resourceGroupName =
process.env["RESOURCESDEPLOYMENTSTACKS_RESOURCE_GROUP"] ||
"deploymentStacksRG";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -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 { DeploymentStacksClient } from "@azure/arm-resourcesdeploymentstacks";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Lists all the Deployment Stacks within the specified subscription.
*
* @summary Lists all the Deployment Stacks within the specified subscription.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/preview/2022-08-01-preview/examples/DeploymentStackSubscriptionList.json
*/
async function deploymentStacksList() {
const subscriptionId =
process.env["RESOURCESDEPLOYMENTSTACKS_SUBSCRIPTION_ID"] ||
"00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new DeploymentStacksClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtSubscription()) {
resArray.push(item);
}
console.log(resArray);
}
async function main() {
deploymentStacksList();
}
main().catch(console.error);

Просмотреть файл

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"alwaysStrict": true,
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src/**.ts"
]
}

Просмотреть файл

@ -0,0 +1,154 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import { DeploymentStacksImpl } from "./operations";
import { DeploymentStacks } from "./operationsInterfaces";
import { DeploymentStacksClientOptionalParams } from "./models";
export class DeploymentStacksClient extends coreClient.ServiceClient {
$host: string;
subscriptionId?: string;
apiVersion: string;
/**
* Initializes a new instance of the DeploymentStacksClient class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param subscriptionId The ID of the target subscription.
* @param options The parameter options
*/
constructor(
credentials: coreAuth.TokenCredential,
subscriptionId: string,
options?: DeploymentStacksClientOptionalParams
);
constructor(
credentials: coreAuth.TokenCredential,
options?: DeploymentStacksClientOptionalParams
);
constructor(
credentials: coreAuth.TokenCredential,
subscriptionIdOrOptions?: DeploymentStacksClientOptionalParams | string,
options?: DeploymentStacksClientOptionalParams
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
}
let subscriptionId: string | undefined;
if (typeof subscriptionIdOrOptions === "string") {
subscriptionId = subscriptionIdOrOptions;
} else if (typeof subscriptionIdOrOptions === "object") {
options = subscriptionIdOrOptions;
}
// Initializing default values for options
if (!options) {
options = {};
}
const defaults: DeploymentStacksClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};
const packageDetails = `azsdk-js-arm-resourcesdeploymentstacks/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
endpoint:
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);
let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
}
if (
!options ||
!options.pipeline ||
options.pipeline.getOrderedPolicies().length == 0 ||
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
credential: credentials,
scopes:
optionsWithDefaults.credentialScopes ??
`${optionsWithDefaults.endpoint}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge
}
})
);
}
// Parameter assignments
this.subscriptionId = subscriptionId;
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-08-01-preview";
this.deploymentStacks = new DeploymentStacksImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return "api-version=" + apiVersion;
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}
deploymentStacks: DeploymentStacks;
}

Просмотреть файл

@ -0,0 +1,13 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
/// <reference lib="esnext.asynciterable" />
export { getContinuationToken } from "./pagingHelper";
export * from "./models";
export { DeploymentStacksClient } from "./deploymentStacksClient";
export * from "./operationsInterfaces";

Просмотреть файл

@ -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 { AbortSignalLike } from "@azure/abort-controller";
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
export function createLroSpec<T>(inputs: {
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
args: Record<string, unknown>;
spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>;
}): LongRunningOperation<T> {
const { args, spec, sendOperationFn } = inputs;
return {
requestMethod: spec.httpMethod,
requestPath: spec.path!,
sendInitialRequest: () => sendOperationFn(args, spec),
sendPollRequest: (
path: string,
options?: { abortSignal?: AbortSignalLike }
) => {
const { requestBody, ...restSpec } = spec;
return sendOperationFn(args, {
...restSpec,
httpMethod: "GET",
path,
abortSignal: options?.abortSignal
});
}
};
}

Просмотреть файл

@ -0,0 +1,728 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
/** List of deployment stacks. */
export interface DeploymentStackListResult {
/** An array of deployment stacks. */
value?: DeploymentStack[];
/**
* The URL to use for getting the next set of results.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly nextLink?: string;
}
/** Entity representing the reference to the template. */
export interface DeploymentStacksTemplateLink {
/** The URI of the template to deploy. Use either the uri or id property, but not both. */
uri?: string;
/** The resource id of a Template Spec. Use either the id or uri property, but not both. */
id?: string;
/** The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs */
relativePath?: string;
/** The query string (for example, a SAS token) to be used with the templateLink URI. */
queryString?: string;
/** If included, must match the ContentVersion in the template. */
contentVersion?: string;
}
/** Entity representing the reference to the deployment parameters. */
export interface DeploymentStacksParametersLink {
/** The URI of the parameters file. */
uri: string;
/** If included, must match the ContentVersion in the template. */
contentVersion?: string;
}
/** Defines the behavior of resources that are not managed immediately after the stack is updated. */
export interface DeploymentStackPropertiesActionOnUnmanage {
/** Specifies the action that should be taken on the resource when the deployment stack is deleted. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */
resources: DeploymentStacksDeleteDetachEnum;
/** Specifies the action that should be taken on the resource when the deployment stack is deleted. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */
resourceGroups?: DeploymentStacksDeleteDetachEnum;
/** Specifies the action that should be taken on the resource when the deployment stack is deleted. Delete will attempt to delete the resource from Azure. Detach will leave the resource in it's current state. */
managementGroups?: DeploymentStacksDeleteDetachEnum;
}
/** The debug setting. */
export interface DeploymentStacksDebugSetting {
/** Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. */
detailLevel?: string;
}
/** Defines how resources deployed by the deployment stack are locked. */
export interface DenySettings {
/** denySettings Mode. */
mode: DenySettingsMode;
/** List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted. */
excludedPrincipals?: string[];
/** List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted. If the denySetting mode is set to 'denyWriteAndDelete', then the following actions are automatically appended to 'excludedActions': '*\/read' and 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to 'denyDelete', then the following actions are automatically appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate actions will be removed. */
excludedActions?: string[];
/** DenySettings will be applied to child scopes. */
applyToChildScopes?: boolean;
}
/** The resource Id model. */
export interface ResourceReference {
/**
* The resourceId of a resource managed by the deployment stack.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
}
/** Deployment Stacks error response. */
export interface DeploymentStacksError {
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
error?: ErrorResponse;
}
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
export interface ErrorResponse {
/** The error object. */
error?: ErrorDetail;
}
/** The error detail. */
export interface ErrorDetail {
/**
* The error code.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly code?: string;
/**
* The error message.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly message?: string;
/**
* The error target.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly target?: string;
/**
* The error details.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly details?: ErrorDetail[];
/**
* The error additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly additionalInfo?: ErrorAdditionalInfo[];
}
/** The resource management error additional info. */
export interface ErrorAdditionalInfo {
/**
* The additional info type.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/**
* The additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly info?: Record<string, unknown>;
}
/** Common properties for all Azure resources. */
export interface AzureResourceBase {
/**
* String Id used to locate any resource on Azure.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* Name of this resource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* Type of this resource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly systemData?: SystemData;
}
/** Metadata pertaining to creation and last modification of the resource. */
export interface SystemData {
/** The identity that created the resource. */
createdBy?: string;
/** The type of identity that created the resource. */
createdByType?: CreatedByType;
/** The timestamp of resource creation (UTC). */
createdAt?: Date;
/** The identity that last modified the resource. */
lastModifiedBy?: string;
/** The type of identity that last modified the resource. */
lastModifiedByType?: CreatedByType;
/** The timestamp of resource last modification (UTC) */
lastModifiedAt?: Date;
}
/** Export Template specific properties of the Stack. */
export interface DeploymentStackTemplateDefinition {
/** The template content. Use this element to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. */
template?: Record<string, unknown>;
/** The URI of the template. Use either the templateLink property or the template property, but not both. */
templateLink?: DeploymentStacksTemplateLink;
}
/** The resource Id extended model. */
export interface ResourceReferenceExtended
extends ResourceReference,
DeploymentStacksError {}
/** The managed resource model. */
export interface ManagedResourceReference extends ResourceReference {
/** Current management state of the resource in the deployment stack. */
status?: ResourceStatusMode;
/** denyAssignment settings applied to the resource. */
denyStatus?: DenyStatusMode;
}
/** Deployment stack properties. */
export interface DeploymentStackProperties extends DeploymentStacksError {
/** The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. */
template?: Record<string, unknown>;
/** The URI of the template. Use either the templateLink property or the template property, but not both. */
templateLink?: DeploymentStacksTemplateLink;
/** Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. */
parameters?: Record<string, unknown>;
/** The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */
parametersLink?: DeploymentStacksParametersLink;
/** Defines the behavior of resources that are not managed immediately after the stack is updated. */
actionOnUnmanage: DeploymentStackPropertiesActionOnUnmanage;
/** The debug setting of the deployment. */
debugSetting?: DeploymentStacksDebugSetting;
/** The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). */
deploymentScope?: string;
/** Deployment stack description. */
description?: string;
/** Defines how resources deployed by the stack are locked. */
denySettings: DenySettings;
/**
* State of the deployment stack.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: DeploymentStackProvisioningState;
/**
* An array of resources that were detached during the most recent update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly detachedResources?: ResourceReference[];
/**
* An array of resources that were deleted during the most recent update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly deletedResources?: ResourceReference[];
/**
* An array of resources that failed to reach goal state during the most recent update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly failedResources?: ResourceReferenceExtended[];
/**
* An array of resources currently managed by the deployment stack.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resources?: ManagedResourceReference[];
/**
* The resourceId of the deployment resource created by the deployment stack.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly deploymentId?: string;
/**
* The outputs of the underlying deployment.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly outputs?: Record<string, unknown>;
/**
* The duration of the deployment stack update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly duration?: string;
}
/** Deployment stack object. */
export interface DeploymentStack extends AzureResourceBase {
/** The location of the deployment stack. It cannot be changed after creation. It must be one of the supported Azure locations. */
location?: string;
/** Deployment stack resource tags. */
tags?: { [propertyName: string]: string };
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
error?: ErrorResponse;
/** The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. */
template?: Record<string, unknown>;
/** The URI of the template. Use either the templateLink property or the template property, but not both. */
templateLink?: DeploymentStacksTemplateLink;
/** Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string. */
parameters?: Record<string, unknown>;
/** The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. */
parametersLink?: DeploymentStacksParametersLink;
/** Defines the behavior of resources that are not managed immediately after the stack is updated. */
actionOnUnmanage?: DeploymentStackPropertiesActionOnUnmanage;
/** The debug setting of the deployment. */
debugSetting?: DeploymentStacksDebugSetting;
/** The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). */
deploymentScope?: string;
/** Deployment stack description. */
description?: string;
/** Defines how resources deployed by the stack are locked. */
denySettings?: DenySettings;
/**
* State of the deployment stack.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: DeploymentStackProvisioningState;
/**
* An array of resources that were detached during the most recent update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly detachedResources?: ResourceReference[];
/**
* An array of resources that were deleted during the most recent update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly deletedResources?: ResourceReference[];
/**
* An array of resources that failed to reach goal state during the most recent update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly failedResources?: ResourceReferenceExtended[];
/**
* An array of resources currently managed by the deployment stack.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resources?: ManagedResourceReference[];
/**
* The resourceId of the deployment resource created by the deployment stack.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly deploymentId?: string;
/**
* The outputs of the underlying deployment.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly outputs?: Record<string, unknown>;
/**
* The duration of the deployment stack update.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly duration?: string;
}
/** Defines headers for DeploymentStacks_deleteAtResourceGroup operation. */
export interface DeploymentStacksDeleteAtResourceGroupHeaders {
location?: string;
}
/** Defines headers for DeploymentStacks_deleteAtSubscription operation. */
export interface DeploymentStacksDeleteAtSubscriptionHeaders {
location?: string;
}
/** Defines headers for DeploymentStacks_deleteAtManagementGroup operation. */
export interface DeploymentStacksDeleteAtManagementGroupHeaders {
location?: string;
}
/** Known values of {@link DeploymentStacksDeleteDetachEnum} that the service accepts. */
export enum KnownDeploymentStacksDeleteDetachEnum {
/** Delete */
Delete = "delete",
/** Detach */
Detach = "detach"
}
/**
* Defines values for DeploymentStacksDeleteDetachEnum. \
* {@link KnownDeploymentStacksDeleteDetachEnum} can be used interchangeably with DeploymentStacksDeleteDetachEnum,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **delete** \
* **detach**
*/
export type DeploymentStacksDeleteDetachEnum = string;
/** Known values of {@link DenySettingsMode} that the service accepts. */
export enum KnownDenySettingsMode {
/** Authorized users are able to read and modify the resources, but cannot delete. */
DenyDelete = "denyDelete",
/** Authorized users can only read from a resource, but cannot modify or delete it. */
DenyWriteAndDelete = "denyWriteAndDelete",
/** No denyAssignments have been applied. */
None = "none"
}
/**
* Defines values for DenySettingsMode. \
* {@link KnownDenySettingsMode} can be used interchangeably with DenySettingsMode,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **denyDelete**: Authorized users are able to read and modify the resources, but cannot delete. \
* **denyWriteAndDelete**: Authorized users can only read from a resource, but cannot modify or delete it. \
* **none**: No denyAssignments have been applied.
*/
export type DenySettingsMode = string;
/** Known values of {@link DeploymentStackProvisioningState} that the service accepts. */
export enum KnownDeploymentStackProvisioningState {
/** Creating */
Creating = "Creating",
/** Validating */
Validating = "Validating",
/** Waiting */
Waiting = "Waiting",
/** Deploying */
Deploying = "Deploying",
/** Canceling */
Canceling = "Canceling",
/** Locking */
Locking = "Locking",
/** DeletingResources */
DeletingResources = "DeletingResources",
/** Succeeded */
Succeeded = "Succeeded",
/** Failed */
Failed = "Failed",
/** Canceled */
Canceled = "Canceled",
/** Deleting */
Deleting = "Deleting"
}
/**
* Defines values for DeploymentStackProvisioningState. \
* {@link KnownDeploymentStackProvisioningState} can be used interchangeably with DeploymentStackProvisioningState,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Creating** \
* **Validating** \
* **Waiting** \
* **Deploying** \
* **Canceling** \
* **Locking** \
* **DeletingResources** \
* **Succeeded** \
* **Failed** \
* **Canceled** \
* **Deleting**
*/
export type DeploymentStackProvisioningState = string;
/** Known values of {@link ResourceStatusMode} that the service accepts. */
export enum KnownResourceStatusMode {
/** This resource is managed by the deployment stack. */
Managed = "Managed",
/** Unable to remove the deny assignment on resource. */
RemoveDenyFailed = "removeDenyFailed",
/** Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. */
DeleteFailed = "deleteFailed",
/** No denyAssignments have been applied. */
None = "None"
}
/**
* Defines values for ResourceStatusMode. \
* {@link KnownResourceStatusMode} can be used interchangeably with ResourceStatusMode,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Managed**: This resource is managed by the deployment stack. \
* **removeDenyFailed**: Unable to remove the deny assignment on resource. \
* **deleteFailed**: Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. \
* **None**: No denyAssignments have been applied.
*/
export type ResourceStatusMode = string;
/** Known values of {@link DenyStatusMode} that the service accepts. */
export enum KnownDenyStatusMode {
/** Authorized users are able to read and modify the resources, but cannot delete. */
DenyDelete = "denyDelete",
/** Resource type does not support denyAssignments. */
NotSupported = "notSupported",
/** denyAssignments are not supported on resources outside the scope of the deployment stack. */
Inapplicable = "inapplicable",
/** Authorized users can only read from a resource, but cannot modify or delete it. */
DenyWriteAndDelete = "denyWriteAndDelete",
/** Deny assignment has been removed by Azure due to a resource management change (management group move, etc.) */
RemovedBySystem = "removedBySystem",
/** No denyAssignments have been applied. */
None = "None"
}
/**
* Defines values for DenyStatusMode. \
* {@link KnownDenyStatusMode} can be used interchangeably with DenyStatusMode,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **denyDelete**: Authorized users are able to read and modify the resources, but cannot delete. \
* **notSupported**: Resource type does not support denyAssignments. \
* **inapplicable**: denyAssignments are not supported on resources outside the scope of the deployment stack. \
* **denyWriteAndDelete**: Authorized users can only read from a resource, but cannot modify or delete it. \
* **removedBySystem**: Deny assignment has been removed by Azure due to a resource management change (management group move, etc.) \
* **None**: No denyAssignments have been applied.
*/
export type DenyStatusMode = string;
/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
/** User */
User = "User",
/** Application */
Application = "Application",
/** ManagedIdentity */
ManagedIdentity = "ManagedIdentity",
/** Key */
Key = "Key"
}
/**
* Defines values for CreatedByType. \
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **User** \
* **Application** \
* **ManagedIdentity** \
* **Key**
*/
export type CreatedByType = string;
/** Known values of {@link UnmanageActionResourceMode} that the service accepts. */
export enum KnownUnmanageActionResourceMode {
/** Delete */
Delete = "delete",
/** Detach */
Detach = "detach"
}
/**
* Defines values for UnmanageActionResourceMode. \
* {@link KnownUnmanageActionResourceMode} can be used interchangeably with UnmanageActionResourceMode,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **delete** \
* **detach**
*/
export type UnmanageActionResourceMode = string;
/** Known values of {@link UnmanageActionResourceGroupMode} that the service accepts. */
export enum KnownUnmanageActionResourceGroupMode {
/** Delete */
Delete = "delete",
/** Detach */
Detach = "detach"
}
/**
* Defines values for UnmanageActionResourceGroupMode. \
* {@link KnownUnmanageActionResourceGroupMode} can be used interchangeably with UnmanageActionResourceGroupMode,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **delete** \
* **detach**
*/
export type UnmanageActionResourceGroupMode = string;
/** Known values of {@link UnmanageActionManagementGroupMode} that the service accepts. */
export enum KnownUnmanageActionManagementGroupMode {
/** Delete */
Delete = "delete",
/** Detach */
Detach = "detach"
}
/**
* Defines values for UnmanageActionManagementGroupMode. \
* {@link KnownUnmanageActionManagementGroupMode} can be used interchangeably with UnmanageActionManagementGroupMode,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **delete** \
* **detach**
*/
export type UnmanageActionManagementGroupMode = string;
/** Optional parameters. */
export interface DeploymentStacksListAtResourceGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listAtResourceGroup operation. */
export type DeploymentStacksListAtResourceGroupResponse = DeploymentStackListResult;
/** Optional parameters. */
export interface DeploymentStacksListAtSubscriptionOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listAtSubscription operation. */
export type DeploymentStacksListAtSubscriptionResponse = DeploymentStackListResult;
/** Optional parameters. */
export interface DeploymentStacksListAtManagementGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listAtManagementGroup operation. */
export type DeploymentStacksListAtManagementGroupResponse = DeploymentStackListResult;
/** Optional parameters. */
export interface DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Contains response data for the createOrUpdateAtResourceGroup operation. */
export type DeploymentStacksCreateOrUpdateAtResourceGroupResponse = DeploymentStack;
/** Optional parameters. */
export interface DeploymentStacksGetAtResourceGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the getAtResourceGroup operation. */
export type DeploymentStacksGetAtResourceGroupResponse = DeploymentStack;
/** Optional parameters. */
export interface DeploymentStacksDeleteAtResourceGroupOptionalParams
extends coreClient.OperationOptions {
/** Flag to indicate delete rather than detach for the resources. */
unmanageActionResources?: UnmanageActionResourceMode;
/** Flag to indicate delete rather than detach for the resource groups. */
unmanageActionResourceGroups?: UnmanageActionResourceGroupMode;
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Optional parameters. */
export interface DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Contains response data for the createOrUpdateAtSubscription operation. */
export type DeploymentStacksCreateOrUpdateAtSubscriptionResponse = DeploymentStack;
/** Optional parameters. */
export interface DeploymentStacksGetAtSubscriptionOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the getAtSubscription operation. */
export type DeploymentStacksGetAtSubscriptionResponse = DeploymentStack;
/** Optional parameters. */
export interface DeploymentStacksDeleteAtSubscriptionOptionalParams
extends coreClient.OperationOptions {
/** Flag to indicate delete rather than detach for the resources. */
unmanageActionResources?: UnmanageActionResourceMode;
/** Flag to indicate delete rather than detach for the resource groups. */
unmanageActionResourceGroups?: UnmanageActionResourceGroupMode;
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Optional parameters. */
export interface DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Contains response data for the createOrUpdateAtManagementGroup operation. */
export type DeploymentStacksCreateOrUpdateAtManagementGroupResponse = DeploymentStack;
/** Optional parameters. */
export interface DeploymentStacksGetAtManagementGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the getAtManagementGroup operation. */
export type DeploymentStacksGetAtManagementGroupResponse = DeploymentStack;
/** Optional parameters. */
export interface DeploymentStacksDeleteAtManagementGroupOptionalParams
extends coreClient.OperationOptions {
/** Flag to indicate delete rather than detach for the resources. */
unmanageActionResources?: UnmanageActionResourceMode;
/** Flag to indicate delete rather than detach for the resource groups. */
unmanageActionResourceGroups?: UnmanageActionResourceGroupMode;
/** Flag to indicate delete rather than detach for the management groups. */
unmanageActionManagementGroups?: UnmanageActionManagementGroupMode;
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Optional parameters. */
export interface DeploymentStacksExportTemplateAtResourceGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the exportTemplateAtResourceGroup operation. */
export type DeploymentStacksExportTemplateAtResourceGroupResponse = DeploymentStackTemplateDefinition;
/** Optional parameters. */
export interface DeploymentStacksExportTemplateAtSubscriptionOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the exportTemplateAtSubscription operation. */
export type DeploymentStacksExportTemplateAtSubscriptionResponse = DeploymentStackTemplateDefinition;
/** Optional parameters. */
export interface DeploymentStacksExportTemplateAtManagementGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the exportTemplateAtManagementGroup operation. */
export type DeploymentStacksExportTemplateAtManagementGroupResponse = DeploymentStackTemplateDefinition;
/** Optional parameters. */
export interface DeploymentStacksListAtResourceGroupNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listAtResourceGroupNext operation. */
export type DeploymentStacksListAtResourceGroupNextResponse = DeploymentStackListResult;
/** Optional parameters. */
export interface DeploymentStacksListAtSubscriptionNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listAtSubscriptionNext operation. */
export type DeploymentStacksListAtSubscriptionNextResponse = DeploymentStackListResult;
/** Optional parameters. */
export interface DeploymentStacksListAtManagementGroupNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listAtManagementGroupNext operation. */
export type DeploymentStacksListAtManagementGroupNextResponse = DeploymentStackListResult;
/** Optional parameters. */
export interface DeploymentStacksClientOptionalParams
extends coreClient.ServiceClientOptions {
/** server parameter */
$host?: string;
/** Api Version */
apiVersion?: string;
/** Overrides client endpoint. */
endpoint?: string;
}

Просмотреть файл

@ -0,0 +1,828 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
export const DeploymentStackListResult: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStackListResult",
modelProperties: {
value: {
serializedName: "value",
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "DeploymentStack"
}
}
}
},
nextLink: {
serializedName: "nextLink",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const DeploymentStacksTemplateLink: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStacksTemplateLink",
modelProperties: {
uri: {
serializedName: "uri",
type: {
name: "String"
}
},
id: {
serializedName: "id",
type: {
name: "String"
}
},
relativePath: {
serializedName: "relativePath",
type: {
name: "String"
}
},
queryString: {
serializedName: "queryString",
type: {
name: "String"
}
},
contentVersion: {
serializedName: "contentVersion",
type: {
name: "String"
}
}
}
}
};
export const DeploymentStacksParametersLink: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStacksParametersLink",
modelProperties: {
uri: {
serializedName: "uri",
required: true,
type: {
name: "String"
}
},
contentVersion: {
serializedName: "contentVersion",
type: {
name: "String"
}
}
}
}
};
export const DeploymentStackPropertiesActionOnUnmanage: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStackPropertiesActionOnUnmanage",
modelProperties: {
resources: {
serializedName: "resources",
required: true,
type: {
name: "String"
}
},
resourceGroups: {
serializedName: "resourceGroups",
type: {
name: "String"
}
},
managementGroups: {
serializedName: "managementGroups",
type: {
name: "String"
}
}
}
}
};
export const DeploymentStacksDebugSetting: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStacksDebugSetting",
modelProperties: {
detailLevel: {
serializedName: "detailLevel",
type: {
name: "String"
}
}
}
}
};
export const DenySettings: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DenySettings",
modelProperties: {
mode: {
serializedName: "mode",
required: true,
type: {
name: "String"
}
},
excludedPrincipals: {
serializedName: "excludedPrincipals",
type: {
name: "Sequence",
element: {
type: {
name: "String"
}
}
}
},
excludedActions: {
serializedName: "excludedActions",
type: {
name: "Sequence",
element: {
type: {
name: "String"
}
}
}
},
applyToChildScopes: {
serializedName: "applyToChildScopes",
type: {
name: "Boolean"
}
}
}
}
};
export const ResourceReference: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ResourceReference",
modelProperties: {
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const DeploymentStacksError: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStacksError",
modelProperties: {
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorResponse"
}
}
}
}
};
export const ErrorResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorResponse",
modelProperties: {
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
}
};
export const ErrorDetail: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorDetail",
modelProperties: {
code: {
serializedName: "code",
readOnly: true,
type: {
name: "String"
}
},
message: {
serializedName: "message",
readOnly: true,
type: {
name: "String"
}
},
target: {
serializedName: "target",
readOnly: true,
type: {
name: "String"
}
},
details: {
serializedName: "details",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
},
additionalInfo: {
serializedName: "additionalInfo",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorAdditionalInfo"
}
}
}
}
}
}
};
export const ErrorAdditionalInfo: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorAdditionalInfo",
modelProperties: {
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
},
info: {
serializedName: "info",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
}
}
}
};
export const AzureResourceBase: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "AzureResourceBase",
modelProperties: {
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String"
}
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
},
systemData: {
serializedName: "systemData",
type: {
name: "Composite",
className: "SystemData"
}
}
}
}
};
export const SystemData: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SystemData",
modelProperties: {
createdBy: {
serializedName: "createdBy",
type: {
name: "String"
}
},
createdByType: {
serializedName: "createdByType",
type: {
name: "String"
}
},
createdAt: {
serializedName: "createdAt",
type: {
name: "DateTime"
}
},
lastModifiedBy: {
serializedName: "lastModifiedBy",
type: {
name: "String"
}
},
lastModifiedByType: {
serializedName: "lastModifiedByType",
type: {
name: "String"
}
},
lastModifiedAt: {
serializedName: "lastModifiedAt",
type: {
name: "DateTime"
}
}
}
}
};
export const DeploymentStackTemplateDefinition: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStackTemplateDefinition",
modelProperties: {
template: {
serializedName: "template",
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
},
templateLink: {
serializedName: "templateLink",
type: {
name: "Composite",
className: "DeploymentStacksTemplateLink"
}
}
}
}
};
export const ResourceReferenceExtended: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ResourceReferenceExtended",
modelProperties: {
...ResourceReference.type.modelProperties,
...DeploymentStacksError.type.modelProperties
}
}
};
export const ManagedResourceReference: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ManagedResourceReference",
modelProperties: {
...ResourceReference.type.modelProperties,
status: {
defaultValue: "None",
serializedName: "status",
type: {
name: "String"
}
},
denyStatus: {
defaultValue: "None",
serializedName: "denyStatus",
type: {
name: "String"
}
}
}
}
};
export const DeploymentStackProperties: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStackProperties",
modelProperties: {
...DeploymentStacksError.type.modelProperties,
template: {
serializedName: "template",
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
},
templateLink: {
serializedName: "templateLink",
type: {
name: "Composite",
className: "DeploymentStacksTemplateLink"
}
},
parameters: {
serializedName: "parameters",
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
},
parametersLink: {
serializedName: "parametersLink",
type: {
name: "Composite",
className: "DeploymentStacksParametersLink"
}
},
actionOnUnmanage: {
serializedName: "actionOnUnmanage",
type: {
name: "Composite",
className: "DeploymentStackPropertiesActionOnUnmanage"
}
},
debugSetting: {
serializedName: "debugSetting",
type: {
name: "Composite",
className: "DeploymentStacksDebugSetting"
}
},
deploymentScope: {
serializedName: "deploymentScope",
type: {
name: "String"
}
},
description: {
constraints: {
MaxLength: 4096
},
serializedName: "description",
type: {
name: "String"
}
},
denySettings: {
serializedName: "denySettings",
type: {
name: "Composite",
className: "DenySettings"
}
},
provisioningState: {
serializedName: "provisioningState",
readOnly: true,
type: {
name: "String"
}
},
detachedResources: {
serializedName: "detachedResources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ResourceReference"
}
}
}
},
deletedResources: {
serializedName: "deletedResources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ResourceReference"
}
}
}
},
failedResources: {
serializedName: "failedResources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ResourceReferenceExtended"
}
}
}
},
resources: {
serializedName: "resources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ManagedResourceReference"
}
}
}
},
deploymentId: {
serializedName: "deploymentId",
readOnly: true,
type: {
name: "String"
}
},
outputs: {
serializedName: "outputs",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
},
duration: {
serializedName: "duration",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const DeploymentStack: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStack",
modelProperties: {
...AzureResourceBase.type.modelProperties,
location: {
serializedName: "location",
type: {
name: "String"
}
},
tags: {
serializedName: "tags",
type: {
name: "Dictionary",
value: { type: { name: "String" } }
}
},
error: {
serializedName: "properties.error",
type: {
name: "Composite",
className: "ErrorResponse"
}
},
template: {
serializedName: "properties.template",
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
},
templateLink: {
serializedName: "properties.templateLink",
type: {
name: "Composite",
className: "DeploymentStacksTemplateLink"
}
},
parameters: {
serializedName: "properties.parameters",
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
},
parametersLink: {
serializedName: "properties.parametersLink",
type: {
name: "Composite",
className: "DeploymentStacksParametersLink"
}
},
actionOnUnmanage: {
serializedName: "properties.actionOnUnmanage",
type: {
name: "Composite",
className: "DeploymentStackPropertiesActionOnUnmanage"
}
},
debugSetting: {
serializedName: "properties.debugSetting",
type: {
name: "Composite",
className: "DeploymentStacksDebugSetting"
}
},
deploymentScope: {
serializedName: "properties.deploymentScope",
type: {
name: "String"
}
},
description: {
constraints: {
MaxLength: 4096
},
serializedName: "properties.description",
type: {
name: "String"
}
},
denySettings: {
serializedName: "properties.denySettings",
type: {
name: "Composite",
className: "DenySettings"
}
},
provisioningState: {
serializedName: "properties.provisioningState",
readOnly: true,
type: {
name: "String"
}
},
detachedResources: {
serializedName: "properties.detachedResources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ResourceReference"
}
}
}
},
deletedResources: {
serializedName: "properties.deletedResources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ResourceReference"
}
}
}
},
failedResources: {
serializedName: "properties.failedResources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ResourceReferenceExtended"
}
}
}
},
resources: {
serializedName: "properties.resources",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ManagedResourceReference"
}
}
}
},
deploymentId: {
serializedName: "properties.deploymentId",
readOnly: true,
type: {
name: "String"
}
},
outputs: {
serializedName: "properties.outputs",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
},
duration: {
serializedName: "properties.duration",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const DeploymentStacksDeleteAtResourceGroupHeaders: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStacksDeleteAtResourceGroupHeaders",
modelProperties: {
location: {
serializedName: "location",
type: {
name: "String"
}
}
}
}
};
export const DeploymentStacksDeleteAtSubscriptionHeaders: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStacksDeleteAtSubscriptionHeaders",
modelProperties: {
location: {
serializedName: "location",
type: {
name: "String"
}
}
}
}
};
export const DeploymentStacksDeleteAtManagementGroupHeaders: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DeploymentStacksDeleteAtManagementGroupHeaders",
modelProperties: {
location: {
serializedName: "location",
type: {
name: "String"
}
}
}
}
};

Просмотреть файл

@ -0,0 +1,170 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
OperationParameter,
OperationURLParameter,
OperationQueryParameter
} from "@azure/core-client";
import { DeploymentStack as DeploymentStackMapper } from "../models/mappers";
export const accept: OperationParameter = {
parameterPath: "accept",
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Accept",
type: {
name: "String"
}
}
};
export const $host: OperationURLParameter = {
parameterPath: "$host",
mapper: {
serializedName: "$host",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};
export const subscriptionId: OperationURLParameter = {
parameterPath: "subscriptionId",
mapper: {
constraints: {
MinLength: 1
},
serializedName: "subscriptionId",
required: true,
type: {
name: "String"
}
}
};
export const resourceGroupName: OperationURLParameter = {
parameterPath: "resourceGroupName",
mapper: {
constraints: {
MaxLength: 90,
MinLength: 1
},
serializedName: "resourceGroupName",
required: true,
type: {
name: "String"
}
}
};
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2022-08-01-preview",
isConstant: true,
serializedName: "api-version",
type: {
name: "String"
}
}
};
export const managementGroupId: OperationURLParameter = {
parameterPath: "managementGroupId",
mapper: {
constraints: {
Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"),
MaxLength: 90,
MinLength: 1
},
serializedName: "managementGroupId",
required: true,
type: {
name: "String"
}
}
};
export const contentType: OperationParameter = {
parameterPath: ["options", "contentType"],
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Content-Type",
type: {
name: "String"
}
}
};
export const deploymentStack: OperationParameter = {
parameterPath: "deploymentStack",
mapper: DeploymentStackMapper
};
export const deploymentStackName: OperationURLParameter = {
parameterPath: "deploymentStackName",
mapper: {
constraints: {
Pattern: new RegExp("^[-\\w\\._\\(\\)]+$"),
MaxLength: 90,
MinLength: 1
},
serializedName: "deploymentStackName",
required: true,
type: {
name: "String"
}
}
};
export const unmanageActionResources: OperationQueryParameter = {
parameterPath: ["options", "unmanageActionResources"],
mapper: {
serializedName: "unmanageAction.Resources",
type: {
name: "String"
}
}
};
export const unmanageActionResourceGroups: OperationQueryParameter = {
parameterPath: ["options", "unmanageActionResourceGroups"],
mapper: {
serializedName: "unmanageAction.ResourceGroups",
type: {
name: "String"
}
}
};
export const unmanageActionManagementGroups: OperationQueryParameter = {
parameterPath: ["options", "unmanageActionManagementGroups"],
mapper: {
serializedName: "unmanageAction.ManagementGroups",
type: {
name: "String"
}
}
};
export const nextLink: OperationURLParameter = {
parameterPath: "nextLink",
mapper: {
serializedName: "nextLink",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,9 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./deploymentStacks";

Просмотреть файл

@ -0,0 +1,286 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { SimplePollerLike, OperationState } from "@azure/core-lro";
import {
DeploymentStack,
DeploymentStacksListAtResourceGroupOptionalParams,
DeploymentStacksListAtSubscriptionOptionalParams,
DeploymentStacksListAtManagementGroupOptionalParams,
DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams,
DeploymentStacksCreateOrUpdateAtResourceGroupResponse,
DeploymentStacksGetAtResourceGroupOptionalParams,
DeploymentStacksGetAtResourceGroupResponse,
DeploymentStacksDeleteAtResourceGroupOptionalParams,
DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams,
DeploymentStacksCreateOrUpdateAtSubscriptionResponse,
DeploymentStacksGetAtSubscriptionOptionalParams,
DeploymentStacksGetAtSubscriptionResponse,
DeploymentStacksDeleteAtSubscriptionOptionalParams,
DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams,
DeploymentStacksCreateOrUpdateAtManagementGroupResponse,
DeploymentStacksGetAtManagementGroupOptionalParams,
DeploymentStacksGetAtManagementGroupResponse,
DeploymentStacksDeleteAtManagementGroupOptionalParams,
DeploymentStacksExportTemplateAtResourceGroupOptionalParams,
DeploymentStacksExportTemplateAtResourceGroupResponse,
DeploymentStacksExportTemplateAtSubscriptionOptionalParams,
DeploymentStacksExportTemplateAtSubscriptionResponse,
DeploymentStacksExportTemplateAtManagementGroupOptionalParams,
DeploymentStacksExportTemplateAtManagementGroupResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a DeploymentStacks. */
export interface DeploymentStacks {
/**
* Lists all the Deployment Stacks within the specified resource group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
listAtResourceGroup(
resourceGroupName: string,
options?: DeploymentStacksListAtResourceGroupOptionalParams
): PagedAsyncIterableIterator<DeploymentStack>;
/**
* Lists all the Deployment Stacks within the specified subscription.
* @param options The options parameters.
*/
listAtSubscription(
options?: DeploymentStacksListAtSubscriptionOptionalParams
): PagedAsyncIterableIterator<DeploymentStack>;
/**
* Lists all the Deployment Stacks within the specified management group.
* @param managementGroupId Management Group.
* @param options The options parameters.
*/
listAtManagementGroup(
managementGroupId: string,
options?: DeploymentStacksListAtManagementGroupOptionalParams
): PagedAsyncIterableIterator<DeploymentStack>;
/**
* Creates or updates a Deployment Stack.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deploymentStackName Name of the deployment stack.
* @param deploymentStack Deployment Stack supplied to the operation.
* @param options The options parameters.
*/
beginCreateOrUpdateAtResourceGroup(
resourceGroupName: string,
deploymentStackName: string,
deploymentStack: DeploymentStack,
options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams
): Promise<
SimplePollerLike<
OperationState<DeploymentStacksCreateOrUpdateAtResourceGroupResponse>,
DeploymentStacksCreateOrUpdateAtResourceGroupResponse
>
>;
/**
* Creates or updates a Deployment Stack.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deploymentStackName Name of the deployment stack.
* @param deploymentStack Deployment Stack supplied to the operation.
* @param options The options parameters.
*/
beginCreateOrUpdateAtResourceGroupAndWait(
resourceGroupName: string,
deploymentStackName: string,
deploymentStack: DeploymentStack,
options?: DeploymentStacksCreateOrUpdateAtResourceGroupOptionalParams
): Promise<DeploymentStacksCreateOrUpdateAtResourceGroupResponse>;
/**
* Gets a Deployment Stack with a given name.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
getAtResourceGroup(
resourceGroupName: string,
deploymentStackName: string,
options?: DeploymentStacksGetAtResourceGroupOptionalParams
): Promise<DeploymentStacksGetAtResourceGroupResponse>;
/**
* Deletes a Deployment Stack by name. When operation completes, status code 200 returned without
* content.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
beginDeleteAtResourceGroup(
resourceGroupName: string,
deploymentStackName: string,
options?: DeploymentStacksDeleteAtResourceGroupOptionalParams
): Promise<SimplePollerLike<OperationState<void>, void>>;
/**
* Deletes a Deployment Stack by name. When operation completes, status code 200 returned without
* content.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
beginDeleteAtResourceGroupAndWait(
resourceGroupName: string,
deploymentStackName: string,
options?: DeploymentStacksDeleteAtResourceGroupOptionalParams
): Promise<void>;
/**
* Creates or updates a Deployment Stack.
* @param deploymentStackName Name of the deployment stack.
* @param deploymentStack Deployment Stack supplied to the operation.
* @param options The options parameters.
*/
beginCreateOrUpdateAtSubscription(
deploymentStackName: string,
deploymentStack: DeploymentStack,
options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams
): Promise<
SimplePollerLike<
OperationState<DeploymentStacksCreateOrUpdateAtSubscriptionResponse>,
DeploymentStacksCreateOrUpdateAtSubscriptionResponse
>
>;
/**
* Creates or updates a Deployment Stack.
* @param deploymentStackName Name of the deployment stack.
* @param deploymentStack Deployment Stack supplied to the operation.
* @param options The options parameters.
*/
beginCreateOrUpdateAtSubscriptionAndWait(
deploymentStackName: string,
deploymentStack: DeploymentStack,
options?: DeploymentStacksCreateOrUpdateAtSubscriptionOptionalParams
): Promise<DeploymentStacksCreateOrUpdateAtSubscriptionResponse>;
/**
* Gets a Deployment Stack with a given name.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
getAtSubscription(
deploymentStackName: string,
options?: DeploymentStacksGetAtSubscriptionOptionalParams
): Promise<DeploymentStacksGetAtSubscriptionResponse>;
/**
* Deletes a Deployment Stack by name. When operation completes, status code 200 returned without
* content.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
beginDeleteAtSubscription(
deploymentStackName: string,
options?: DeploymentStacksDeleteAtSubscriptionOptionalParams
): Promise<SimplePollerLike<OperationState<void>, void>>;
/**
* Deletes a Deployment Stack by name. When operation completes, status code 200 returned without
* content.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
beginDeleteAtSubscriptionAndWait(
deploymentStackName: string,
options?: DeploymentStacksDeleteAtSubscriptionOptionalParams
): Promise<void>;
/**
* Creates or updates a Deployment Stack.
* @param managementGroupId Management Group.
* @param deploymentStackName Name of the deployment stack.
* @param deploymentStack Deployment Stack supplied to the operation.
* @param options The options parameters.
*/
beginCreateOrUpdateAtManagementGroup(
managementGroupId: string,
deploymentStackName: string,
deploymentStack: DeploymentStack,
options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams
): Promise<
SimplePollerLike<
OperationState<DeploymentStacksCreateOrUpdateAtManagementGroupResponse>,
DeploymentStacksCreateOrUpdateAtManagementGroupResponse
>
>;
/**
* Creates or updates a Deployment Stack.
* @param managementGroupId Management Group.
* @param deploymentStackName Name of the deployment stack.
* @param deploymentStack Deployment Stack supplied to the operation.
* @param options The options parameters.
*/
beginCreateOrUpdateAtManagementGroupAndWait(
managementGroupId: string,
deploymentStackName: string,
deploymentStack: DeploymentStack,
options?: DeploymentStacksCreateOrUpdateAtManagementGroupOptionalParams
): Promise<DeploymentStacksCreateOrUpdateAtManagementGroupResponse>;
/**
* Gets a Deployment Stack with a given name.
* @param managementGroupId Management Group.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
getAtManagementGroup(
managementGroupId: string,
deploymentStackName: string,
options?: DeploymentStacksGetAtManagementGroupOptionalParams
): Promise<DeploymentStacksGetAtManagementGroupResponse>;
/**
* Deletes a Deployment Stack by name. When operation completes, status code 200 returned without
* content.
* @param managementGroupId Management Group.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
beginDeleteAtManagementGroup(
managementGroupId: string,
deploymentStackName: string,
options?: DeploymentStacksDeleteAtManagementGroupOptionalParams
): Promise<SimplePollerLike<OperationState<void>, void>>;
/**
* Deletes a Deployment Stack by name. When operation completes, status code 200 returned without
* content.
* @param managementGroupId Management Group.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
beginDeleteAtManagementGroupAndWait(
managementGroupId: string,
deploymentStackName: string,
options?: DeploymentStacksDeleteAtManagementGroupOptionalParams
): Promise<void>;
/**
* Exports the template used to create the deployment stack.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
exportTemplateAtResourceGroup(
resourceGroupName: string,
deploymentStackName: string,
options?: DeploymentStacksExportTemplateAtResourceGroupOptionalParams
): Promise<DeploymentStacksExportTemplateAtResourceGroupResponse>;
/**
* Exports the template used to create the deployment stack.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
exportTemplateAtSubscription(
deploymentStackName: string,
options?: DeploymentStacksExportTemplateAtSubscriptionOptionalParams
): Promise<DeploymentStacksExportTemplateAtSubscriptionResponse>;
/**
* Exports the template used to create the deployment stack.
* @param managementGroupId Management Group.
* @param deploymentStackName Name of the deployment stack.
* @param options The options parameters.
*/
exportTemplateAtManagementGroup(
managementGroupId: string,
deploymentStackName: string,
options?: DeploymentStacksExportTemplateAtManagementGroupOptionalParams
): Promise<DeploymentStacksExportTemplateAtManagementGroupResponse>;
}

Просмотреть файл

@ -0,0 +1,9 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./deploymentStacks";

Просмотреть файл

@ -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.
*/
export interface PageInfo {
continuationToken?: string;
}
const pageMap = new WeakMap<object, PageInfo>();
/**
* Given the last `.value` produced by the `byPage` iterator,
* returns a continuation token that can be used to begin paging from
* that point later.
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
* @returns The continuation token that can be passed into byPage() during future calls.
*/
export function getContinuationToken(page: unknown): string | undefined {
if (typeof page !== "object" || page === null) {
return undefined;
}
return pageMap.get(page)?.continuationToken;
}
export function setContinuationToken(
page: unknown,
continuationToken: string | undefined
): void {
if (typeof page !== "object" || page === null || !continuationToken) {
return;
}
const pageInfo = pageMap.get(page) ?? {};
pageInfo.continuationToken = continuationToken;
pageMap.set(page, pageInfo);
}

Просмотреть файл

@ -0,0 +1,139 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
env,
Recorder,
RecorderStartOptions,
delay,
isPlaybackMode,
} from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { assert } from "chai";
import { Context } from "mocha";
import { DeploymentStacksClient } from "../src/deploymentStacksClient";
const replaceableVariables: Record<string, string> = {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
};
const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("DeploymentStacks test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: DeploymentStacksClient;
let location: string;
let resourceGroup: string;
let resourcename: string;
beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new DeploymentStacksClient(credential, subscriptionId, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "myjstest";
resourcename = "resourcetest";
});
afterEach(async function () {
await recorder.stop();
});
it("deploymentStacks create test", async function () {
const res = await client.deploymentStacks.beginCreateOrUpdateAtResourceGroupAndWait(
resourceGroup,
resourcename,
{
actionOnUnmanage: {
resources: "delete"
},
denySettings: {
applyToChildScopes: false,
excludedActions: ["action"],
excludedPrincipals: ["principal"],
mode: "denyDelete"
},
template:{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"foo": {
"type": "string",
"defaultValue": "foo",
"metadata": {
"description": "description"
}
},
"bar": {
"type": "string",
"defaultValue": "bar",
"metadata": {
"description": "description"
}
}
},
"functions": [],
"variables": {
},
"resources": [],
"outputs": {
"foo": {
"type": "string",
"value": "[parameters('foo')]"
},
"bar": {
"type": "string",
"value": "[parameters('bar')]"
}
}
},
tags: { tagkey: "tagVal" }
},
testPollingOptions);
assert.equal(res.name, resourcename);
});
it("deploymentStacks get test", async function () {
const res = await client.deploymentStacks.getAtResourceGroup(resourceGroup,
resourcename);
assert.equal(res.name, resourcename);
});
it("deploymentStacks list test", async function () {
const resArray = new Array();
for await (let item of client.deploymentStacks.listAtResourceGroup(resourceGroup)) {
resArray.push(item);
}
assert.equal(resArray.length, 1);
});
it("deploymentStacks delete test", async function () {
const resArray = new Array();
const res = await client.deploymentStacks.beginDeleteAtResourceGroupAndWait(resourceGroup, resourcename
)
for await (let item of client.deploymentStacks.listAtResourceGroup(resourceGroup)) {
resArray.push(item);
}
assert.equal(resArray.length, 0);
});
})

Просмотреть файл

@ -0,0 +1,33 @@
{
"compilerOptions": {
"module": "es6",
"moduleResolution": "node",
"strict": true,
"target": "es6",
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"lib": [
"es6",
"dom"
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-resourcesdeploymentstacks": [
"./src/index"
]
}
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
],
"exclude": [
"node_modules"
]
}

Просмотреть файл

@ -0,0 +1,38 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks
- sdk/resourcesdeploymentstacks/ci.mgmt.yml
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/resourcesdeploymentstacks/arm-resourcesdeploymentstacks
- sdk/resourcesdeploymentstacks/ci.mgmt.yml
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: resourcesdeploymentstacks
Artifacts:
- name: azure-arm-resourcesdeploymentstacks
safeName: azurearmresourcesdeploymentstacks