Skip to content

Commit 5d7779c

Browse files
author
SDKAuto
committed
CodeGen from PR 3611 in test-repo-billy/azure-rest-api-specs
Merge c069ab2cc6da69d96bd7a4803569969b2c72a37b into 8d0e2cf50583eb8def697c1a7f30b51ebe10a01c
1 parent 9a43556 commit 5d7779c

File tree

45 files changed

+7329
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+7329
-0
lines changed

sdk/chaos/xxxx/LICENSE

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

sdk/chaos/xxxx/README.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Azure ChaosManagement client library for JavaScript
2+
3+
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ChaosManagement client.
4+
5+
Chaos Management Client
6+
7+
Key links:
8+
9+
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/chaos/xxxx)
10+
- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-chaos)
11+
- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-chaos?view=azure-node-preview)
12+
13+
## Getting started
14+
15+
### Currently supported environments
16+
17+
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
18+
- Latest versions of Safari, Chrome, Edge and Firefox.
19+
20+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
21+
22+
### Prerequisites
23+
24+
- An [Azure subscription][azure_sub].
25+
26+
### Install the `@azure/arm-chaos` package
27+
28+
Install the Azure ChaosManagement client library for JavaScript with `npm`:
29+
30+
```bash
31+
npm install @azure/arm-chaos
32+
```
33+
34+
### Create and authenticate a `ChaosClient`
35+
36+
To create a client object to access the Azure ChaosManagement API, you will need the `endpoint` of your Azure ChaosManagement resource and a `credential`. The Azure ChaosManagement client can use Azure Active Directory credentials to authenticate.
37+
You can find the endpoint for your Azure ChaosManagement resource in the [Azure Portal][azure_portal].
38+
39+
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).
40+
41+
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
42+
43+
```bash
44+
npm install @azure/identity
45+
```
46+
47+
You will also need to **register a new AAD application and grant access to Azure ChaosManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
48+
49+
For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
50+
51+
```javascript
52+
const { ChaosClient } = require("@azure/arm-chaos");
53+
const { DefaultAzureCredential } = require("@azure/identity");
54+
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
55+
56+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
57+
const client = new ChaosClient(new DefaultAzureCredential(), subscriptionId);
58+
59+
// For client-side applications running in the browser, use this code instead:
60+
// const credential = new InteractiveBrowserCredential({
61+
// tenantId: "<YOUR_TENANT_ID>",
62+
// clientId: "<YOUR_CLIENT_ID>"
63+
// });
64+
// const client = new ChaosClient(credential, subscriptionId);
65+
```
66+
67+
68+
### JavaScript Bundle
69+
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).
70+
71+
## Key concepts
72+
73+
### ChaosClient
74+
75+
`ChaosClient` is the primary interface for developers using the Azure ChaosManagement client library. Explore the methods on this client object to understand the different features of the Azure ChaosManagement service that you can access.
76+
77+
## Troubleshooting
78+
79+
### Logging
80+
81+
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`:
82+
83+
```javascript
84+
const { setLogLevel } = require("@azure/logger");
85+
setLogLevel("info");
86+
```
87+
88+
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).
89+
90+
91+
## Contributing
92+
93+
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.
94+
95+
## Related projects
96+
97+
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
98+
99+
[azure_sub]: https://azure.microsoft.com/free/
100+
[azure_portal]: https://portal.azure.com
101+
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
102+
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

sdk/chaos/xxxx/api-extractor.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
4+
"docModel": { "enabled": true },
5+
"apiReport": { "enabled": true, "reportFolder": "./review" },
6+
"dtsRollup": {
7+
"enabled": true,
8+
"untrimmedFilePath": "",
9+
"publicTrimmedFilePath": "./types/arm-chaos.d.ts"
10+
},
11+
"messages": {
12+
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
13+
"extractorMessageReporting": {
14+
"ae-missing-release-tag": { "logLevel": "none" },
15+
"ae-unresolved-link": { "logLevel": "none" }
16+
}
17+
}
18+
}

sdk/chaos/xxxx/eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
2+
3+
export default azsdkEslint.config([
4+
{
5+
rules: {
6+
"@azure/azure-sdk/ts-modules-only-named": "warn",
7+
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
8+
"@azure/azure-sdk/ts-package-json-types": "warn",
9+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
10+
"@azure/azure-sdk/ts-package-json-module": "off",
11+
"@azure/azure-sdk/ts-package-json-files-required": "off",
12+
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
13+
"tsdoc/syntax": "warn"
14+
}
15+
}
16+
]);

sdk/chaos/xxxx/package.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"name": "@azure/arm-chaos",
3+
"version": "1.0.0-beta.1",
4+
"description": "A generated SDK for ChaosClient.",
5+
"engines": {
6+
"node": ">=18.0.0"
7+
},
8+
"sideEffects": false,
9+
"autoPublish": false,
10+
"tshy": {
11+
"exports": {
12+
"./package.json": "./package.json",
13+
".": "./src/index.ts",
14+
"./models": "./src/models/index.ts"
15+
},
16+
"dialects": ["esm", "commonjs"],
17+
"esmDialects": ["browser", "react-native"],
18+
"selfLink": false
19+
},
20+
"type": "module",
21+
"keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"],
22+
"author": "Microsoft Corporation",
23+
"license": "MIT",
24+
"files": ["dist", "README.md", "LICENSE", "review/*", "CHANGELOG.md"],
25+
"sdk-type": "mgmt",
26+
"repository": "github:Azure/azure-sdk-for-js",
27+
"bugs": {
28+
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
29+
},
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/chaos/xxxx/README.md",
31+
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
32+
"//metadata": {
33+
"constantPaths": [
34+
{
35+
"path": "src/api/chaosManagementContext.ts",
36+
"prefix": "userAgentInfo"
37+
}
38+
]
39+
},
40+
"dependencies": {
41+
"@azure/core-util": "^1.9.2",
42+
"@azure-rest/core-client": "^2.3.1",
43+
"@azure/core-auth": "^1.6.0",
44+
"@azure/core-rest-pipeline": "^1.5.0",
45+
"@azure/logger": "^1.0.0",
46+
"tslib": "^2.6.2",
47+
"@azure/core-lro": "^3.1.0",
48+
"@azure/abort-controller": "^2.1.2"
49+
},
50+
"devDependencies": {
51+
"dotenv": "^16.0.0",
52+
"@microsoft/api-extractor": "^7.40.3",
53+
"@types/node": "^18.0.0",
54+
"eslint": "^9.9.0",
55+
"typescript": "~5.6.2",
56+
"@azure/identity": "^4.2.1",
57+
"@vitest/browser": "^2.0.5",
58+
"@vitest/coverage-istanbul": "^2.0.5",
59+
"playwright": "^1.41.2",
60+
"vitest": "^2.0.5",
61+
"@azure-tools/test-credential": "^2.0.0",
62+
"@azure-tools/test-recorder": "^4.0.0",
63+
"@azure/dev-tool": "^1.0.0",
64+
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
65+
},
66+
"scripts": {
67+
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
68+
"extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
69+
"pack": "npm pack 2>&1",
70+
"lint": "eslint package.json api-extractor.json src test",
71+
"lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
72+
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
73+
"unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser",
74+
"unit-test:node": "dev-tool run test:vitest",
75+
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
76+
"integration-test:browser": "echo skipped",
77+
"integration-test:node": "echo skipped",
78+
"build:samples": "echo skipped",
79+
"check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
80+
"execute:samples": "echo skipped",
81+
"format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ",
82+
"generate:client": "echo skipped",
83+
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
84+
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
85+
"build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test",
86+
"build": "npm run clean && dev-tool run build-package && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
87+
"test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node",
88+
"test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
89+
"update-snippets": "echo skipped"
90+
}
91+
}

sdk/chaos/xxxx/sample.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Feel free to add your own environment variables.

0 commit comments

Comments
 (0)