diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 8709b02b670a..8fc0b1a317e5 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1777,6 +1777,16 @@ packages: lodash: 4.17.21 dev: false + /@microsoft/api-extractor-model@7.28.2(@types/node@14.18.63): + resolution: {integrity: sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + '@rushstack/node-core-library': 3.61.0(@types/node@14.18.63) + transitivePeerDependencies: + - '@types/node' + dev: false + /@microsoft/api-extractor-model@7.28.2(@types/node@16.18.58): resolution: {integrity: sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==} dependencies: @@ -1787,6 +1797,26 @@ packages: - '@types/node' dev: false + /@microsoft/api-extractor@7.38.0(@types/node@14.18.63): + resolution: {integrity: sha512-e1LhZYnfw+JEebuY2bzhw0imDCl1nwjSThTrQqBXl40hrVo6xm3j/1EpUr89QyzgjqmAwek2ZkIVZbrhaR+cqg==} + hasBin: true + dependencies: + '@microsoft/api-extractor-model': 7.28.2(@types/node@14.18.63) + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + '@rushstack/node-core-library': 3.61.0(@types/node@14.18.63) + '@rushstack/rig-package': 0.5.1 + '@rushstack/ts-command-line': 4.16.1 + colors: 1.2.5 + lodash: 4.17.21 + resolve: 1.22.6 + semver: 7.5.4 + source-map: 0.6.1 + typescript: 5.0.4 + transitivePeerDependencies: + - '@types/node' + dev: false + /@microsoft/api-extractor@7.38.0(@types/node@16.18.58): resolution: {integrity: sha512-e1LhZYnfw+JEebuY2bzhw0imDCl1nwjSThTrQqBXl40hrVo6xm3j/1EpUr89QyzgjqmAwek2ZkIVZbrhaR+cqg==} hasBin: true @@ -2435,6 +2465,24 @@ packages: rollup: 3.29.4 dev: false + /@rushstack/node-core-library@3.61.0(@types/node@14.18.63): + resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@types/node': 14.18.63 + colors: 1.2.5 + fs-extra: 7.0.1 + import-lazy: 4.0.0 + jju: 1.4.0 + resolve: 1.22.6 + semver: 7.5.4 + z-schema: 5.0.5 + dev: false + /@rushstack/node-core-library@3.61.0(@types/node@16.18.58): resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} peerDependencies: @@ -2742,6 +2790,10 @@ packages: form-data: 4.0.0 dev: false + /@types/node@14.18.63: + resolution: {integrity: sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==} + dev: false + /@types/node@16.18.58: resolution: {integrity: sha512-YGncyA25/MaVtQkjWW9r0EFBukZ+JulsLcVZBlGUfIb96OBMjkoRWwQo5IEWJ8Fj06Go3GHw+bjYDitv6BaGsA==} dev: false @@ -3963,7 +4015,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug@3.2.7: @@ -4215,7 +4267,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20231010 + typescript: 5.3.0-dev.20231011 dev: false /eastasianwidth@0.2.0: @@ -5227,7 +5279,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.4 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: false @@ -8035,6 +8087,22 @@ packages: resolution: {integrity: sha512-rZqFD43y4U9nSqVq3iyWBiDwmBQJY8Txi04yI9jTKD3xcl7CbFjh1qRpQshUB3sONLubDzm7vJiwB+1MEGv67w==} dev: false + /rollup-plugin-sourcemaps@0.6.3(@types/node@14.18.63)(rollup@2.79.1): + resolution: {integrity: sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==} + engines: {node: '>=10.0.0'} + peerDependencies: + '@types/node': '>=10.0.0' + rollup: '>=0.31.2' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@rollup/pluginutils': 3.1.0(rollup@2.79.1) + '@types/node': 14.18.63 + rollup: 2.79.1 + source-map-resolve: 0.6.0 + dev: false + /rollup-plugin-sourcemaps@0.6.3(@types/node@16.18.58)(rollup@2.79.1): resolution: {integrity: sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==} engines: {node: '>=10.0.0'} @@ -8768,6 +8836,37 @@ packages: code-block-writer: 12.0.0 dev: false + /ts-node@10.9.1(@types/node@14.18.63)(typescript@5.0.4): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 14.18.63 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.0.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: false + /ts-node@10.9.1(@types/node@16.18.58)(typescript@5.0.4): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -8941,8 +9040,8 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20231010: - resolution: {integrity: sha512-oSO2cE/D2+ju7rRavL4A/j6tP/s3Y4W7lDK81PaW3MEi1HpeXbRLObHcxA7Y9s2QuES/1P/81i/YKdB0kssg6w==} + /typescript@5.3.0-dev.20231011: + resolution: {integrity: sha512-qpyUI7J37X3Xj7/bPWSNPUvmJ8yDGVnkQ8665xD4+LVWKUX7vwO7n2E1CUuQzeQIF4y369iPaz1d396rTW5LfA==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -11077,32 +11176,34 @@ packages: dev: false file:projects/arm-chaos.tgz: - resolution: {integrity: sha512-n4aV6Bmzk6OTrt78wmhkZGEdNXOW/umqZ0XiYWgg4r7USXaJXmHmZMR31XjduPW/8WFI8WsgZFyMpAM4Y/CHNg==, tarball: file:projects/arm-chaos.tgz} + resolution: {integrity: sha512-a+o/NRfCWQBtbg0BRBl3tm+eppeOTcTfP7fv2NvwnwlDQpjEsUEztSA1GMpj5jPOxKS/GZPbOHCsZ/MlS25tVQ==, tarball: file:projects/arm-chaos.tgz} name: '@rush-temp/arm-chaos' version: 0.0.0 dependencies: - '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) + '@azure/identity': 2.1.0 + '@microsoft/api-extractor': 7.38.0(@types/node@14.18.63) '@rollup/plugin-commonjs': 24.1.0(rollup@2.79.1) '@rollup/plugin-json': 6.0.1(rollup@2.79.1) '@rollup/plugin-multi-entry': 6.0.1(rollup@2.79.1) '@rollup/plugin-node-resolve': 13.3.0(rollup@2.79.1) '@types/chai': 4.3.6 - '@types/node': 16.18.58 + '@types/node': 14.18.63 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 mkdirp: 2.1.6 - mocha: 10.2.0 - rimraf: 3.0.2 + mocha: 7.2.0 + rimraf: 5.0.5 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3(@types/node@16.18.58)(rollup@2.79.1) - ts-node: 10.9.1(@types/node@16.18.58)(typescript@5.0.4) + rollup-plugin-sourcemaps: 0.6.3(@types/node@14.18.63)(rollup@2.79.1) + ts-node: 10.9.1(@types/node@14.18.63)(typescript@5.0.4) 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-cognitiveservices.tgz: @@ -19677,7 +19778,7 @@ packages: dev: false file:projects/openai.tgz: - resolution: {integrity: sha512-l/34Wloiu8roZtoyebZ1oEKeokMG7uLdapSul+yhevUWud88fNI4EgQDb2uLdnlU5Q9P6mYTgyQ3hXHM1SLX4g==, tarball: file:projects/openai.tgz} + resolution: {integrity: sha512-wjbm7oMD2myPUF+erSHL5AWkxeouEKi1dLMOKrp9XULKbLZNHBzQ4OEEoQsFBXqgufvwoMOVm8hLkvVqPWbrFg==, tarball: file:projects/openai.tgz} name: '@rush-temp/openai' version: 0.0.0 dependencies: diff --git a/sdk/chaos/arm-chaos/CHANGELOG.md b/sdk/chaos/arm-chaos/CHANGELOG.md index 206a97c69f89..296adba4c7be 100644 --- a/sdk/chaos/arm-chaos/CHANGELOG.md +++ b/sdk/chaos/arm-chaos/CHANGELOG.md @@ -1,15 +1,104 @@ # Release History + +## 1.0.0-beta.5 (2023-10-11) + +**Features** -## 1.0.0-beta.5 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group OperationStatuses + - Added operation group PrivateAccesses + - Added operation Experiments.beginCancel + - Added operation Experiments.beginCancelAndWait + - Added operation Experiments.beginCreateOrUpdate + - Added operation Experiments.beginCreateOrUpdateAndWait + - Added operation Experiments.beginDelete + - Added operation Experiments.beginDeleteAndWait + - Added operation Experiments.beginStart + - Added operation Experiments.beginStartAndWait + - Added operation Experiments.beginUpdate + - Added operation Experiments.beginUpdateAndWait + - Added Interface ChaosExperimentAction + - Added Interface ChaosExperimentBranch + - Added Interface ChaosExperimentStep + - Added Interface ChaosTargetFilter + - Added Interface ChaosTargetListSelector + - Added Interface ChaosTargetQuerySelector + - Added Interface ChaosTargetSelector + - Added Interface ChaosTargetSimpleFilter + - Added Interface ChaosTargetSimpleFilterParameters + - Added Interface CustomerDataStorageProperties + - Added Interface ErrorDetailAutoGenerated + - Added Interface ErrorResponseAutoGenerated + - Added Interface OperationStatus + - Added Interface OperationStatusesGetOptionalParams + - Added Interface PrivateAccess + - Added Interface PrivateAccessesCreateOrUpdateOptionalParams + - Added Interface PrivateAccessesDeleteAPrivateEndpointConnectionHeaders + - Added Interface PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams + - Added Interface PrivateAccessesDeleteOptionalParams + - Added Interface PrivateAccessesGetAPrivateEndpointConnectionOptionalParams + - Added Interface PrivateAccessesGetOptionalParams + - Added Interface PrivateAccessesGetPrivateLinkResourcesOptionalParams + - Added Interface PrivateAccessesListAllNextOptionalParams + - Added Interface PrivateAccessesListAllOptionalParams + - Added Interface PrivateAccessesListNextOptionalParams + - Added Interface PrivateAccessesListOptionalParams + - Added Interface PrivateAccessesListPrivateEndpointConnectionsNextOptionalParams + - Added Interface PrivateAccessesListPrivateEndpointConnectionsOptionalParams + - Added Interface PrivateAccessListResult + - Added Interface PrivateEndpoint + - Added Interface PrivateEndpointConnection + - Added Interface PrivateEndpointConnectionListResult + - Added Interface PrivateLinkResource + - Added Interface PrivateLinkResourceListResult + - Added Interface PrivateLinkServiceConnectionState + - Added Interface ResourceAutoGenerated + - Added Interface TrackedResourceAutoGenerated + - Added Type Alias ChaosExperimentActionUnion + - Added Type Alias ChaosTargetFilterUnion + - Added Type Alias ChaosTargetSelectorUnion + - Added Type Alias OperationStatusesGetResponse + - Added Type Alias PrivateAccessesCreateOrUpdateResponse + - Added Type Alias PrivateAccessesDeleteAPrivateEndpointConnectionResponse + - Added Type Alias PrivateAccessesGetAPrivateEndpointConnectionResponse + - Added Type Alias PrivateAccessesGetPrivateLinkResourcesResponse + - Added Type Alias PrivateAccessesGetResponse + - Added Type Alias PrivateAccessesListAllNextResponse + - Added Type Alias PrivateAccessesListAllResponse + - Added Type Alias PrivateAccessesListNextResponse + - Added Type Alias PrivateAccessesListPrivateEndpointConnectionsNextResponse + - Added Type Alias PrivateAccessesListPrivateEndpointConnectionsResponse + - Added Type Alias PrivateAccessesListResponse + - Added Type Alias PrivateEndpointConnectionProvisioningState + - Added Type Alias PrivateEndpointServiceConnectionStatus + - Added Type Alias ProvisioningState + - Interface Experiment has a new optional parameter customerDataStorage + - Interface Experiment has a new optional parameter provisioningState + - Interface ExperimentsCancelOptionalParams has a new optional parameter resumeFrom + - Interface ExperimentsCancelOptionalParams has a new optional parameter updateIntervalInMs + - Interface ExperimentsCreateOrUpdateOptionalParams has a new optional parameter resumeFrom + - Interface ExperimentsCreateOrUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface ExperimentsDeleteOptionalParams has a new optional parameter resumeFrom + - Interface ExperimentsDeleteOptionalParams has a new optional parameter updateIntervalInMs + - Interface ExperimentsStartOptionalParams has a new optional parameter resumeFrom + - Interface ExperimentsStartOptionalParams has a new optional parameter updateIntervalInMs + - Interface ExperimentsUpdateOptionalParams has a new optional parameter resumeFrom + - Interface ExperimentsUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Added Enum KnownPrivateEndpointConnectionProvisioningState + - Added Enum KnownPrivateEndpointServiceConnectionStatus + - Added Enum KnownProvisioningState -### Other Changes +**Breaking Changes** + - Removed operation Experiments.cancel + - Removed operation Experiments.createOrUpdate + - Removed operation Experiments.delete + - Removed operation Experiments.start + - Removed operation Experiments.update + - Interface Experiment no longer has parameter startOnCreation + - Type of parameter selectors of interface Experiment is changed from SelectorUnion[] to ChaosTargetSelectorUnion[] + - Type of parameter steps of interface Experiment is changed from Step[] to ChaosExperimentStep[] + + ## 1.0.0-beta.4 (2023-08-04) **Features** @@ -67,4 +156,4 @@ ## 1.0.0-beta.1 (2022-09-13) -The package of @azure/arm-chaos is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-chaos is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/chaos/arm-chaos/_meta.json b/sdk/chaos/arm-chaos/_meta.json index 7977e5f4ef8d..18065a83bc7d 100644 --- a/sdk/chaos/arm-chaos/_meta.json +++ b/sdk/chaos/arm-chaos/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8a56aa33078dad6012aa59653cbfa643fa985f15", + "commit": "f2ffb87b9ca7057f129b0becac935e03e290da40", "readme": "specification/chaos/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\\chaos\\resource-manager\\readme.md --use=@autorest/typescript@6.0.5 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/chaos/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "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.5" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/chaos/arm-chaos/package.json b/sdk/chaos/arm-chaos/package.json index 2bdb18a212ce..7dd01f8e3fc6 100644 --- a/sdk/chaos/arm-chaos/package.json +++ b/sdk/chaos/arm-chaos/package.json @@ -5,13 +5,15 @@ "description": "A generated SDK for ChaosManagementClient.", "version": "1.0.0-beta.5", "engines": { - "node": ">=16.0.0" + "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.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -36,19 +38,18 @@ "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", - "@azure/identity": "^3.3.0", + "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", - "mocha": "^10.0.0", + "mocha": "^7.1.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@types/node": "^16.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-cosmosdb": "16.0.0-beta.7", - "ts-node": "^10.0.0" + "@types/node": "^14.0.0", + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -83,7 +84,7 @@ "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", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -111,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/chaos/arm-chaos", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-chaos?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/chaos/arm-chaos" +} \ No newline at end of file diff --git a/sdk/chaos/arm-chaos/review/arm-chaos.api.md b/sdk/chaos/arm-chaos/review/arm-chaos.api.md index 63f95f3d1726..7f0f3de0c04b 100644 --- a/sdk/chaos/arm-chaos/review/arm-chaos.api.md +++ b/sdk/chaos/arm-chaos/review/arm-chaos.api.md @@ -6,13 +6,9 @@ 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'; - -// @public -export interface Action { - name: string; - type: "delay" | "discrete" | "continuous"; -} +import { SimplePollerLike } from '@azure/core-lro'; // @public export interface ActionStatus { @@ -27,15 +23,6 @@ export interface ActionStatus { // @public export type ActionType = string; -// @public (undocumented) -export type ActionUnion = Action | DelayAction | DiscreteAction | ContinuousAction; - -// @public -export interface Branch { - actions: ActionUnion[]; - name: string; -} - // @public export interface BranchStatus { readonly actions?: ActionStatus[]; @@ -156,6 +143,27 @@ export interface CapabilityTypesListOptionalParams extends coreClient.OperationO // @public export type CapabilityTypesListResponse = CapabilityTypeListResult; +// @public +export interface ChaosExperimentAction { + name: string; + type: "delay" | "discrete" | "continuous"; +} + +// @public (undocumented) +export type ChaosExperimentActionUnion = ChaosExperimentAction | DelayAction | DiscreteAction | ContinuousAction; + +// @public +export interface ChaosExperimentBranch { + actions: ChaosExperimentActionUnion[]; + name: string; +} + +// @public +export interface ChaosExperimentStep { + branches: ChaosExperimentBranch[]; + name: string; +} + // @public (undocumented) export class ChaosManagementClient extends coreClient.ServiceClient { // (undocumented) @@ -173,6 +181,10 @@ export class ChaosManagementClient extends coreClient.ServiceClient { // (undocumented) operations: Operations; // (undocumented) + operationStatuses: OperationStatuses; + // (undocumented) + privateAccesses: PrivateAccesses; + // (undocumented) subscriptionId?: string; // (undocumented) targets: Targets; @@ -188,7 +200,50 @@ export interface ChaosManagementClientOptionalParams extends coreClient.ServiceC } // @public -export interface ContinuousAction extends Action { +export interface ChaosTargetFilter { + type: "Simple"; +} + +// @public (undocumented) +export type ChaosTargetFilterUnion = ChaosTargetFilter | ChaosTargetSimpleFilter; + +// @public +export interface ChaosTargetListSelector extends ChaosTargetSelector { + targets: TargetReference[]; + type: "List"; +} + +// @public +export interface ChaosTargetQuerySelector extends ChaosTargetSelector { + queryString: string; + subscriptionIds: string[]; + type: "Query"; +} + +// @public +export interface ChaosTargetSelector { + [property: string]: any; + filter?: ChaosTargetFilterUnion; + id: string; + type: "List" | "Query"; +} + +// @public (undocumented) +export type ChaosTargetSelectorUnion = ChaosTargetSelector | ChaosTargetListSelector | ChaosTargetQuerySelector; + +// @public +export interface ChaosTargetSimpleFilter extends ChaosTargetFilter { + parameters?: ChaosTargetSimpleFilterParameters; + type: "Simple"; +} + +// @public +export interface ChaosTargetSimpleFilterParameters { + zones?: string[]; +} + +// @public +export interface ContinuousAction extends ChaosExperimentAction { duration: string; parameters: KeyValuePair[]; selectorId: string; @@ -199,13 +254,19 @@ export interface ContinuousAction extends Action { export type CreatedByType = string; // @public -export interface DelayAction extends Action { +export interface CustomerDataStorageProperties { + blobContainerName?: string; + storageAccountResourceId?: string; +} + +// @public +export interface DelayAction extends ChaosExperimentAction { duration: string; type: "delay"; } // @public -export interface DiscreteAction extends Action { +export interface DiscreteAction extends ChaosExperimentAction { parameters: KeyValuePair[]; selectorId: string; type: "discrete"; @@ -226,24 +287,33 @@ export interface ErrorDetail { readonly target?: string; } +// @public +export interface ErrorDetailAutoGenerated { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetailAutoGenerated[]; + readonly message?: string; + readonly target?: string; +} + // @public export interface ErrorResponse { error?: ErrorDetail; } // @public -export interface Experiment extends TrackedResource { - identity?: ResourceIdentity; - selectors: SelectorUnion[]; - startOnCreation?: boolean; - steps: Step[]; - readonly systemData?: SystemData; +export interface ErrorResponseAutoGenerated { + error?: ErrorDetailAutoGenerated; } // @public -export interface ExperimentCancelOperationResult { - readonly name?: string; - readonly statusUrl?: string; +export interface Experiment extends TrackedResource { + customerDataStorage?: CustomerDataStorageProperties; + identity?: ResourceIdentity; + readonly provisioningState?: ProvisioningState; + selectors: ChaosTargetSelectorUnion[]; + steps: ChaosExperimentStep[]; + readonly systemData?: SystemData; } // @public @@ -295,9 +365,16 @@ export interface ExperimentListResult { // @public export interface Experiments { - cancel(resourceGroupName: string, experimentName: string, options?: ExperimentsCancelOptionalParams): Promise; - createOrUpdate(resourceGroupName: string, experimentName: string, experiment: Experiment, options?: ExperimentsCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, experimentName: string, options?: ExperimentsDeleteOptionalParams): Promise; + beginCancel(resourceGroupName: string, experimentName: string, options?: ExperimentsCancelOptionalParams): Promise, void>>; + beginCancelAndWait(resourceGroupName: string, experimentName: string, options?: ExperimentsCancelOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, experimentName: string, experiment: Experiment, options?: ExperimentsCreateOrUpdateOptionalParams): Promise, ExperimentsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, experimentName: string, experiment: Experiment, options?: ExperimentsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, experimentName: string, options?: ExperimentsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, experimentName: string, options?: ExperimentsDeleteOptionalParams): Promise; + beginStart(resourceGroupName: string, experimentName: string, options?: ExperimentsStartOptionalParams): Promise, void>>; + beginStartAndWait(resourceGroupName: string, experimentName: string, options?: ExperimentsStartOptionalParams): Promise; + beginUpdate(resourceGroupName: string, experimentName: string, experiment: ExperimentUpdate, options?: ExperimentsUpdateOptionalParams): Promise, ExperimentsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, experimentName: string, experiment: ExperimentUpdate, options?: ExperimentsUpdateOptionalParams): Promise; get(resourceGroupName: string, experimentName: string, options?: ExperimentsGetOptionalParams): Promise; getExecutionDetails(resourceGroupName: string, experimentName: string, executionDetailsId: string, options?: ExperimentsGetExecutionDetailsOptionalParams): Promise; getStatus(resourceGroupName: string, experimentName: string, statusId: string, options?: ExperimentsGetStatusOptionalParams): Promise; @@ -305,19 +382,18 @@ export interface Experiments { listAll(options?: ExperimentsListAllOptionalParams): PagedAsyncIterableIterator; listAllStatuses(resourceGroupName: string, experimentName: string, options?: ExperimentsListAllStatusesOptionalParams): PagedAsyncIterableIterator; listExecutionDetails(resourceGroupName: string, experimentName: string, options?: ExperimentsListExecutionDetailsOptionalParams): PagedAsyncIterableIterator; - start(resourceGroupName: string, experimentName: string, options?: ExperimentsStartOptionalParams): Promise; - update(resourceGroupName: string, experimentName: string, experiment: ExperimentUpdate, options?: ExperimentsUpdateOptionalParams): Promise; } // @public export interface ExperimentsCancelOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } -// @public -export type ExperimentsCancelResponse = ExperimentCancelOperationResult; - // @public export interface ExperimentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -325,6 +401,8 @@ export type ExperimentsCreateOrUpdateResponse = Experiment; // @public export interface ExperimentsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -410,15 +488,8 @@ export type ExperimentsListResponse = ExperimentListResult; // @public export interface ExperimentsStartOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ExperimentsStartResponse = ExperimentStartOperationResult; - -// @public -export interface ExperimentStartOperationResult { - readonly name?: string; - readonly statusUrl?: string; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -439,6 +510,8 @@ export interface ExperimentStatusListResult { // @public export interface ExperimentsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -449,17 +522,9 @@ export interface ExperimentUpdate { identity?: ResourceIdentity; } -// @public -export interface Filter { - type: "Simple"; -} - // @public export type FilterType = string; -// @public (undocumented) -export type FilterUnion = Filter | SimpleFilter; - // @public export function getContinuationToken(page: unknown): string | undefined; @@ -494,6 +559,31 @@ export enum KnownOrigin { UserSystem = "user,system" } +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + // @public export enum KnownSelectorType { List = "List", @@ -505,12 +595,6 @@ export enum KnownTargetReferenceType { ChaosTarget = "ChaosTarget" } -// @public -export interface ListSelector extends Selector { - targets: TargetReference[]; - type: "List"; -} - // @public export interface Operation { readonly actionType?: ActionType; @@ -553,67 +637,226 @@ export interface OperationsListAllOptionalParams extends coreClient.OperationOpt // @public export type OperationsListAllResponse = OperationListResult; +// @public +export interface OperationStatus { + endTime?: string; + error?: ErrorResponse; + id?: string; + name?: string; + startTime?: string; + status?: string; +} + +// @public +export interface OperationStatuses { + get(location: string, asyncOperationId: string, options?: OperationStatusesGetOptionalParams): Promise; +} + +// @public +export interface OperationStatusesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationStatusesGetResponse = OperationStatus; + // @public export type Origin = string; // @public -export interface QuerySelector extends Selector { - queryString: string; - subscriptionIds: string[]; - type: "Query"; +export interface PrivateAccess extends TrackedResourceAutoGenerated { + readonly privateEndpointConnections?: PrivateEndpointConnection[]; } // @public -export interface Resource { +export interface PrivateAccesses { + beginDeleteAPrivateEndpointConnection(resourceGroupName: string, privateAccessName: string, privateEndpointConnectionName: string, options?: PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams): Promise, PrivateAccessesDeleteAPrivateEndpointConnectionResponse>>; + beginDeleteAPrivateEndpointConnectionAndWait(resourceGroupName: string, privateAccessName: string, privateEndpointConnectionName: string, options?: PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams): Promise; + createOrUpdate(resourceGroupName: string, privateAccessName: string, privateAccess: PrivateAccess, options?: PrivateAccessesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, privateAccessName: string, options?: PrivateAccessesDeleteOptionalParams): Promise; + get(resourceGroupName: string, privateAccessName: string, options?: PrivateAccessesGetOptionalParams): Promise; + getAPrivateEndpointConnection(resourceGroupName: string, privateAccessName: string, privateEndpointConnectionName: string, options?: PrivateAccessesGetAPrivateEndpointConnectionOptionalParams): Promise; + getPrivateLinkResources(resourceGroupName: string, privateAccessName: string, options?: PrivateAccessesGetPrivateLinkResourcesOptionalParams): Promise; + list(resourceGroupName: string, options?: PrivateAccessesListOptionalParams): PagedAsyncIterableIterator; + listAll(options?: PrivateAccessesListAllOptionalParams): PagedAsyncIterableIterator; + listPrivateEndpointConnections(resourceGroupName: string, privateAccessName: string, options?: PrivateAccessesListPrivateEndpointConnectionsOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface PrivateAccessesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateAccessesCreateOrUpdateResponse = PrivateAccess; + +// @public +export interface PrivateAccessesDeleteAPrivateEndpointConnectionHeaders { + // (undocumented) + location?: string; +} + +// @public +export interface PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type PrivateAccessesDeleteAPrivateEndpointConnectionResponse = PrivateAccessesDeleteAPrivateEndpointConnectionHeaders; + +// @public +export interface PrivateAccessesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PrivateAccessesGetAPrivateEndpointConnectionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateAccessesGetAPrivateEndpointConnectionResponse = PrivateEndpointConnection; + +// @public +export interface PrivateAccessesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface PrivateAccessesGetPrivateLinkResourcesOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateAccessesGetPrivateLinkResourcesResponse = PrivateLinkResourceListResult; + +// @public +export type PrivateAccessesGetResponse = PrivateAccess; + +// @public +export interface PrivateAccessesListAllNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateAccessesListAllNextResponse = PrivateAccessListResult; + +// @public +export interface PrivateAccessesListAllOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export type PrivateAccessesListAllResponse = PrivateAccessListResult; + +// @public +export interface PrivateAccessesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateAccessesListNextResponse = PrivateAccessListResult; + +// @public +export interface PrivateAccessesListOptionalParams extends coreClient.OperationOptions { + continuationToken?: string; +} + +// @public +export interface PrivateAccessesListPrivateEndpointConnectionsNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateAccessesListPrivateEndpointConnectionsNextResponse = PrivateEndpointConnectionListResult; + +// @public +export interface PrivateAccessesListPrivateEndpointConnectionsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type PrivateAccessesListPrivateEndpointConnectionsResponse = PrivateEndpointConnectionListResult; + +// @public +export type PrivateAccessesListResponse = PrivateAccessListResult; + +// @public +export interface PrivateAccessListResult { + readonly nextLink?: string; + readonly value?: PrivateAccess[]; +} + +// @public +export interface PrivateEndpoint { readonly id?: string; - readonly name?: string; - readonly type?: string; } // @public -export interface ResourceIdentity { - readonly principalId?: string; - readonly tenantId?: string; - type: ResourceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentity; - }; +export interface PrivateEndpointConnection extends ResourceAutoGenerated { + readonly groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; } // @public -export type ResourceIdentityType = "None" | "SystemAssigned" | "UserAssigned"; +export interface PrivateEndpointConnectionListResult { + readonly nextLink?: string; + value?: PrivateEndpointConnection[]; +} // @public -export interface Selector { - [property: string]: any; - filter?: FilterUnion; - id: string; - type: "List" | "Query"; +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends ResourceAutoGenerated { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; } // @public -export type SelectorType = string; +export interface PrivateLinkResourceListResult { + readonly nextLink?: string; + value?: PrivateLinkResource[]; +} -// @public (undocumented) -export type SelectorUnion = Selector | ListSelector | QuerySelector; +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} // @public -export interface SimpleFilter extends Filter { - parameters?: SimpleFilterParameters; - type: "Simple"; +export type ProvisioningState = string; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly type?: string; } // @public -export interface SimpleFilterParameters { - zones?: string[]; +export interface ResourceAutoGenerated { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; } // @public -export interface Step { - branches: Branch[]; - name: string; +export interface ResourceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ResourceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; } +// @public +export type ResourceIdentityType = "None" | "SystemAssigned" | "UserAssigned"; + +// @public +export type SelectorType = string; + // @public export interface StepStatus { readonly branches?: BranchStatus[]; @@ -749,6 +992,14 @@ export interface TrackedResource extends Resource { }; } +// @public +export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + // @public export interface UserAssignedIdentity { readonly clientId?: string; diff --git a/sdk/chaos/arm-chaos/src/chaosManagementClient.ts b/sdk/chaos/arm-chaos/src/chaosManagementClient.ts index 5e3161917640..b329ff69ef26 100644 --- a/sdk/chaos/arm-chaos/src/chaosManagementClient.ts +++ b/sdk/chaos/arm-chaos/src/chaosManagementClient.ts @@ -18,7 +18,9 @@ import { CapabilitiesImpl, CapabilityTypesImpl, ExperimentsImpl, + OperationStatusesImpl, OperationsImpl, + PrivateAccessesImpl, TargetTypesImpl, TargetsImpl } from "./operations"; @@ -26,7 +28,9 @@ import { Capabilities, CapabilityTypes, Experiments, + OperationStatuses, Operations, + PrivateAccesses, TargetTypes, Targets } from "./operationsInterfaces"; @@ -131,11 +135,13 @@ export class ChaosManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-04-15-preview"; + this.apiVersion = options.apiVersion || "2023-10-27-preview"; this.capabilities = new CapabilitiesImpl(this); this.capabilityTypes = new CapabilityTypesImpl(this); this.experiments = new ExperimentsImpl(this); + this.operationStatuses = new OperationStatusesImpl(this); this.operations = new OperationsImpl(this); + this.privateAccesses = new PrivateAccessesImpl(this); this.targetTypes = new TargetTypesImpl(this); this.targets = new TargetsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); @@ -172,7 +178,9 @@ export class ChaosManagementClient extends coreClient.ServiceClient { capabilities: Capabilities; capabilityTypes: CapabilityTypes; experiments: Experiments; + operationStatuses: OperationStatuses; operations: Operations; + privateAccesses: PrivateAccesses; targetTypes: TargetTypes; targets: Targets; } diff --git a/sdk/chaos/arm-chaos/src/lroImpl.ts b/sdk/chaos/arm-chaos/src/lroImpl.ts new file mode 100644 index 000000000000..dd803cd5e28c --- /dev/null +++ b/sdk/chaos/arm-chaos/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + 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 + }); + } + }; +} diff --git a/sdk/chaos/arm-chaos/src/models/index.ts b/sdk/chaos/arm-chaos/src/models/index.ts index 3709a0232221..5f7b2184f8e9 100644 --- a/sdk/chaos/arm-chaos/src/models/index.ts +++ b/sdk/chaos/arm-chaos/src/models/index.ts @@ -8,13 +8,18 @@ import * as coreClient from "@azure/core-client"; -export type ActionUnion = - | Action +export type ChaosExperimentActionUnion = + | ChaosExperimentAction | DelayAction | DiscreteAction | ContinuousAction; -export type SelectorUnion = Selector | ListSelector | QuerySelector; -export type FilterUnion = Filter | SimpleFilter; +export type ChaosTargetSelectorUnion = + | ChaosTargetSelector + | ChaosTargetListSelector + | ChaosTargetQuerySelector; +export type ChaosTargetFilterUnion = + | ChaosTargetFilter + | ChaosTargetSimpleFilter; /** Model that represents a list of Capability resources and a link for pagination. */ export interface CapabilityListResult { @@ -184,23 +189,23 @@ export interface UserAssignedIdentity { } /** Model that represents a step in the Experiment resource. */ -export interface Step { +export interface ChaosExperimentStep { /** String of the step name. */ name: string; /** List of branches. */ - branches: Branch[]; + branches: ChaosExperimentBranch[]; } /** Model that represents a branch in the step. */ -export interface Branch { +export interface ChaosExperimentBranch { /** String of the branch name. */ name: string; /** List of actions. */ - actions: ActionUnion[]; + actions: ChaosExperimentActionUnion[]; } /** Model that represents the base action model. */ -export interface Action { +export interface ChaosExperimentAction { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "delay" | "discrete" | "continuous"; /** String that represents a Capability URN. */ @@ -208,7 +213,7 @@ export interface Action { } /** Model that represents a selector in the Experiment resource. */ -export interface Selector { +export interface ChaosTargetSelector { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "List" | "Query"; /** Describes unknown properties. The value of an unknown property can be of "any" type. */ @@ -216,49 +221,29 @@ export interface Selector { /** String of the selector ID. */ id: string; /** Model that represents available filter types that can be applied to a targets list. */ - filter?: FilterUnion; + filter?: ChaosTargetFilterUnion; } /** Model that represents available filter types that can be applied to a targets list. */ -export interface Filter { +export interface ChaosTargetFilter { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Simple"; } +/** Model that represents the Customer Managed Storage for an Experiment. */ +export interface CustomerDataStorageProperties { + /** ARM Resource ID of the Storage account to use for Customer Data storage. */ + storageAccountResourceId?: string; + /** Name of the Azure Blob Storage container to use or create. */ + blobContainerName?: string; +} + /** Describes an experiment update. */ export interface ExperimentUpdate { /** The identity of the experiment resource. */ identity?: ResourceIdentity; } -/** Model that represents the result of a cancel Experiment operation. */ -export interface ExperimentCancelOperationResult { - /** - * String of the Experiment name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * URL to retrieve the Experiment status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusUrl?: string; -} - -/** Model that represents the result of a start Experiment operation. */ -export interface ExperimentStartOperationResult { - /** - * String of the Experiment name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * URL to retrieve the Experiment status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly statusUrl?: string; -} - /** Model that represents a list of Experiment statuses and a link for pagination. */ export interface ExperimentStatusListResult { /** @@ -514,6 +499,22 @@ export interface ExperimentExecutionActionTargetDetailsError { readonly message?: string; } +/** The status of operation. */ +export interface OperationStatus { + /** The operation Id. */ + id?: string; + /** The operation name. */ + name?: string; + /** The start time of the operation. */ + startTime?: string; + /** The end time of the operation. */ + endTime?: string; + /** The status of the operation. */ + status?: string; + /** The error detail of the operation if any. */ + error?: ErrorResponse; +} + /** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ export interface OperationListResult { /** @@ -578,6 +579,120 @@ export interface OperationDisplay { readonly description?: string; } +/** Model that represents a list of private access resources and a link for pagination. */ +export interface PrivateAccessListResult { + /** + * List of private access resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: PrivateAccess[]; + /** + * URL to retrieve the next page of private access resources. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** The private endpoint resource. */ +export interface PrivateEndpoint { + /** + * The ARM identifier for private endpoint. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface ResourceAutoGenerated { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * 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; +} + +/** 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 ErrorResponseAutoGenerated { + /** The error object. */ + error?: ErrorDetailAutoGenerated; +} + +/** The error detail. */ +export interface ErrorDetailAutoGenerated { + /** + * 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?: ErrorDetailAutoGenerated[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** A list of private link resources */ +export interface PrivateLinkResourceListResult { + /** Array of private link resources */ + value?: PrivateLinkResource[]; + /** + * The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** A list of private link resources */ +export interface PrivateEndpointConnectionListResult { + /** Array of private endpoint connections */ + value?: PrivateEndpointConnection[]; + /** + * The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + /** Model that represents a list of Target Type resources and a link for pagination. */ export interface TargetTypeListResult { /** @@ -623,7 +738,7 @@ export interface TargetReference { } /** Model that represents the Simple filter parameters. */ -export interface SimpleFilterParameters { +export interface ChaosTargetSimpleFilterParameters { /** List of Azure availability zones to filter targets by. */ zones?: string[]; } @@ -767,7 +882,7 @@ export interface Target extends Resource { } /** Model that represents a delay action. */ -export interface DelayAction extends Action { +export interface DelayAction extends ChaosExperimentAction { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "delay"; /** ISO8601 formatted string that represents a duration. */ @@ -775,7 +890,7 @@ export interface DelayAction extends Action { } /** Model that represents a discrete action. */ -export interface DiscreteAction extends Action { +export interface DiscreteAction extends ChaosExperimentAction { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "discrete"; /** List of key value pairs. */ @@ -785,7 +900,7 @@ export interface DiscreteAction extends Action { } /** Model that represents a continuous action. */ -export interface ContinuousAction extends Action { +export interface ContinuousAction extends ChaosExperimentAction { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "continuous"; /** ISO8601 formatted string that represents a duration. */ @@ -797,7 +912,7 @@ export interface ContinuousAction extends Action { } /** Model that represents a list selector. */ -export interface ListSelector extends Selector { +export interface ChaosTargetListSelector extends ChaosTargetSelector { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "List"; /** List of Target references. */ @@ -805,7 +920,7 @@ export interface ListSelector extends Selector { } /** Model that represents a query selector. */ -export interface QuerySelector extends Selector { +export interface ChaosTargetQuerySelector extends ChaosTargetSelector { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Query"; /** Azure Resource Graph (ARG) Query Language query for target resources. */ @@ -815,11 +930,53 @@ export interface QuerySelector extends Selector { } /** Model that represents a simple target filter. */ -export interface SimpleFilter extends Filter { +export interface ChaosTargetSimpleFilter extends ChaosTargetFilter { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Simple"; /** Model that represents the Simple filter parameters. */ - parameters?: SimpleFilterParameters; + parameters?: ChaosTargetSimpleFilterParameters; +} + +/** The private endpoint connection resource. */ +export interface PrivateEndpointConnection extends ResourceAutoGenerated { + /** + * The group ids for the private endpoint resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupIds?: string[]; + /** The private endpoint resource. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** + * The provisioning state of the private endpoint connection resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResourceAutoGenerated extends ResourceAutoGenerated { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** A private link resource. */ +export interface PrivateLinkResource extends ResourceAutoGenerated { + /** + * The private link resource group id. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupId?: string; + /** + * The private link resource required member names. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requiredMembers?: string[]; + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; } /** Model that represents a Experiment resource. */ @@ -831,12 +988,31 @@ export interface Experiment extends TrackedResource { readonly systemData?: SystemData; /** The identity of the experiment resource. */ identity?: ResourceIdentity; + /** + * Most recent provisioning state for the given experiment resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; /** List of steps. */ - steps: Step[]; + steps: ChaosExperimentStep[]; /** List of selectors. */ - selectors: SelectorUnion[]; - /** A boolean value that indicates if experiment should be started on creation or not. */ - startOnCreation?: boolean; + selectors: ChaosTargetSelectorUnion[]; + /** Optional customer-managed Storage account where Experiment schema will be stored. */ + customerDataStorage?: CustomerDataStorageProperties; +} + +/** PrivateAccesses tracked resource. */ +export interface PrivateAccess extends TrackedResourceAutoGenerated { + /** + * A readonly collection of private endpoint connection. Currently only one endpoint connection is supported. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +} + +/** Defines headers for PrivateAccesses_deleteAPrivateEndpointConnection operation. */ +export interface PrivateAccessesDeleteAPrivateEndpointConnectionHeaders { + location?: string; } /** Known values of {@link CreatedByType} that the service accepts. */ @@ -863,6 +1039,36 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Failed** \ + * **Canceled** \ + * **Creating** \ + * **Updating** \ + * **Deleting** + */ +export type ProvisioningState = string; + /** Known values of {@link SelectorType} that the service accepts. */ export enum KnownSelectorType { /** List */ @@ -932,6 +1138,51 @@ export enum KnownActionType { */ export type ActionType = string; +/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Pending */ + Pending = "Pending", + /** Approved */ + Approved = "Approved", + /** Rejected */ + Rejected = "Rejected" +} + +/** + * Defines values for PrivateEndpointServiceConnectionStatus. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending** \ + * **Approved** \ + * **Rejected** + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Deleting */ + Deleting = "Deleting", + /** Failed */ + Failed = "Failed" +} + +/** + * Defines values for PrivateEndpointConnectionProvisioningState. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Deleting** \ + * **Failed** + */ +export type PrivateEndpointConnectionProvisioningState = string; + /** Known values of {@link TargetReferenceType} that the service accepts. */ export enum KnownTargetReferenceType { /** ChaosTarget */ @@ -1034,7 +1285,12 @@ export type ExperimentsListResponse = ExperimentListResult; /** Optional parameters. */ export interface ExperimentsDeleteOptionalParams - extends coreClient.OperationOptions {} + 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; +} /** Optional parameters. */ export interface ExperimentsGetOptionalParams @@ -1045,31 +1301,45 @@ export type ExperimentsGetResponse = Experiment; /** Optional parameters. */ export interface ExperimentsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} + 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 createOrUpdate operation. */ export type ExperimentsCreateOrUpdateResponse = Experiment; /** Optional parameters. */ export interface ExperimentsUpdateOptionalParams - extends coreClient.OperationOptions {} + 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 update operation. */ export type ExperimentsUpdateResponse = Experiment; /** Optional parameters. */ export interface ExperimentsCancelOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the cancel operation. */ -export type ExperimentsCancelResponse = ExperimentCancelOperationResult; + 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; +} /** Optional parameters. */ export interface ExperimentsStartOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the start operation. */ -export type ExperimentsStartResponse = ExperimentStartOperationResult; + 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; +} /** Optional parameters. */ export interface ExperimentsListAllStatusesOptionalParams @@ -1127,6 +1397,13 @@ export interface ExperimentsListExecutionDetailsNextOptionalParams /** Contains response data for the listExecutionDetailsNext operation. */ export type ExperimentsListExecutionDetailsNextResponse = ExperimentExecutionDetailsListResult; +/** Optional parameters. */ +export interface OperationStatusesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type OperationStatusesGetResponse = OperationStatus; + /** Optional parameters. */ export interface OperationsListAllOptionalParams extends coreClient.OperationOptions {} @@ -1141,6 +1418,98 @@ export interface OperationsListAllNextOptionalParams /** Contains response data for the listAllNext operation. */ export type OperationsListAllNextResponse = OperationListResult; +/** Optional parameters. */ +export interface PrivateAccessesListAllOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the listAll operation. */ +export type PrivateAccessesListAllResponse = PrivateAccessListResult; + +/** Optional parameters. */ +export interface PrivateAccessesListOptionalParams + extends coreClient.OperationOptions { + /** String that sets the continuation token. */ + continuationToken?: string; +} + +/** Contains response data for the list operation. */ +export type PrivateAccessesListResponse = PrivateAccessListResult; + +/** Optional parameters. */ +export interface PrivateAccessesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type PrivateAccessesGetResponse = PrivateAccess; + +/** Optional parameters. */ +export interface PrivateAccessesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type PrivateAccessesCreateOrUpdateResponse = PrivateAccess; + +/** Optional parameters. */ +export interface PrivateAccessesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface PrivateAccessesGetPrivateLinkResourcesOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getPrivateLinkResources operation. */ +export type PrivateAccessesGetPrivateLinkResourcesResponse = PrivateLinkResourceListResult; + +/** Optional parameters. */ +export interface PrivateAccessesGetAPrivateEndpointConnectionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the getAPrivateEndpointConnection operation. */ +export type PrivateAccessesGetAPrivateEndpointConnectionResponse = PrivateEndpointConnection; + +/** Optional parameters. */ +export interface PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams + 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 deleteAPrivateEndpointConnection operation. */ +export type PrivateAccessesDeleteAPrivateEndpointConnectionResponse = PrivateAccessesDeleteAPrivateEndpointConnectionHeaders; + +/** Optional parameters. */ +export interface PrivateAccessesListPrivateEndpointConnectionsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listPrivateEndpointConnections operation. */ +export type PrivateAccessesListPrivateEndpointConnectionsResponse = PrivateEndpointConnectionListResult; + +/** Optional parameters. */ +export interface PrivateAccessesListAllNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listAllNext operation. */ +export type PrivateAccessesListAllNextResponse = PrivateAccessListResult; + +/** Optional parameters. */ +export interface PrivateAccessesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type PrivateAccessesListNextResponse = PrivateAccessListResult; + +/** Optional parameters. */ +export interface PrivateAccessesListPrivateEndpointConnectionsNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listPrivateEndpointConnectionsNext operation. */ +export type PrivateAccessesListPrivateEndpointConnectionsNextResponse = PrivateEndpointConnectionListResult; + /** Optional parameters. */ export interface TargetTypesListOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/chaos/arm-chaos/src/models/mappers.ts b/sdk/chaos/arm-chaos/src/models/mappers.ts index 6f5aca130306..2b426e521b5d 100644 --- a/sdk/chaos/arm-chaos/src/models/mappers.ts +++ b/sdk/chaos/arm-chaos/src/models/mappers.ts @@ -367,10 +367,10 @@ export const UserAssignedIdentity: coreClient.CompositeMapper = { } }; -export const Step: coreClient.CompositeMapper = { +export const ChaosExperimentStep: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Step", + className: "ChaosExperimentStep", modelProperties: { name: { constraints: { @@ -393,7 +393,7 @@ export const Step: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Branch" + className: "ChaosExperimentBranch" } } } @@ -402,10 +402,10 @@ export const Step: coreClient.CompositeMapper = { } }; -export const Branch: coreClient.CompositeMapper = { +export const ChaosExperimentBranch: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Branch", + className: "ChaosExperimentBranch", modelProperties: { name: { constraints: { @@ -428,7 +428,7 @@ export const Branch: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Action" + className: "ChaosExperimentAction" } } } @@ -437,11 +437,11 @@ export const Branch: coreClient.CompositeMapper = { } }; -export const Action: coreClient.CompositeMapper = { +export const ChaosExperimentAction: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Action", - uberParent: "Action", + className: "ChaosExperimentAction", + uberParent: "ChaosExperimentAction", polymorphicDiscriminator: { serializedName: "type", clientName: "type" @@ -468,12 +468,12 @@ export const Action: coreClient.CompositeMapper = { } }; -export const Selector: coreClient.CompositeMapper = { - serializedName: "Selector", +export const ChaosTargetSelector: coreClient.CompositeMapper = { + serializedName: "ChaosTargetSelector", type: { name: "Composite", - className: "Selector", - uberParent: "Selector", + className: "ChaosTargetSelector", + uberParent: "ChaosTargetSelector", additionalProperties: { type: { name: "Object" } }, polymorphicDiscriminator: { serializedName: "type", @@ -501,18 +501,18 @@ export const Selector: coreClient.CompositeMapper = { serializedName: "filter", type: { name: "Composite", - className: "Filter" + className: "ChaosTargetFilter" } } } } }; -export const Filter: coreClient.CompositeMapper = { +export const ChaosTargetFilter: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Filter", - uberParent: "Filter", + className: "ChaosTargetFilter", + uberParent: "ChaosTargetFilter", polymorphicDiscriminator: { serializedName: "type", clientName: "type" @@ -529,40 +529,25 @@ export const Filter: coreClient.CompositeMapper = { } }; -export const ExperimentUpdate: coreClient.CompositeMapper = { +export const CustomerDataStorageProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExperimentUpdate", + className: "CustomerDataStorageProperties", modelProperties: { - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ResourceIdentity" - } - } - } - } -}; - -export const ExperimentCancelOperationResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExperimentCancelOperationResult", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, + storageAccountResourceId: { + serializedName: "storageAccountResourceId", type: { name: "String" } }, - statusUrl: { + blobContainerName: { constraints: { - MaxLength: 2048 + Pattern: new RegExp("^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$"), + MaxLength: 63, + MinLength: 3 }, - serializedName: "statusUrl", - readOnly: true, + serializedName: "blobContainerName", + nullable: true, type: { name: "String" } @@ -571,26 +556,16 @@ export const ExperimentCancelOperationResult: coreClient.CompositeMapper = { } }; -export const ExperimentStartOperationResult: coreClient.CompositeMapper = { +export const ExperimentUpdate: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ExperimentStartOperationResult", + className: "ExperimentUpdate", modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String" - } - }, - statusUrl: { - constraints: { - MaxLength: 2048 - }, - serializedName: "statusUrl", - readOnly: true, + identity: { + serializedName: "identity", type: { - name: "String" + name: "Composite", + className: "ResourceIdentity" } } } @@ -1035,6 +1010,52 @@ export const ExperimentExecutionActionTargetDetailsError: coreClient.CompositeMa } }; +export const OperationStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationStatus", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + startTime: { + serializedName: "startTime", + type: { + name: "String" + } + }, + endTime: { + serializedName: "endTime", + type: { + name: "String" + } + }, + status: { + serializedName: "status", + type: { + name: "String" + } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorResponse" + } + } + } + } +}; + export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1145,6 +1166,255 @@ export const OperationDisplay: coreClient.CompositeMapper = { } }; +export const PrivateAccessListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateAccessListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateAccess" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + +export const ResourceAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceAutoGenerated", + 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 ErrorResponseAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponseAutoGenerated", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetailAutoGenerated" + } + } + } + } +}; + +export const ErrorDetailAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetailAutoGenerated", + 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: "ErrorDetailAutoGenerated" + } + } + } + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo" + } + } + } + } + } + } +}; + +export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResourceListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateLinkResource" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, + nextLink: { + constraints: { + MaxLength: 2048 + }, + serializedName: "nextLink", + readOnly: true, + nullable: true, + type: { + name: "String" + } + } + } + } +}; + export const TargetTypeListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1268,10 +1538,10 @@ export const TargetReference: coreClient.CompositeMapper = { } }; -export const SimpleFilterParameters: coreClient.CompositeMapper = { +export const ChaosTargetSimpleFilterParameters: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SimpleFilterParameters", + className: "ChaosTargetSimpleFilterParameters", modelProperties: { zones: { serializedName: "zones", @@ -1572,10 +1842,11 @@ export const DelayAction: coreClient.CompositeMapper = { type: { name: "Composite", className: "DelayAction", - uberParent: "Action", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + uberParent: "ChaosExperimentAction", + polymorphicDiscriminator: + ChaosExperimentAction.type.polymorphicDiscriminator, modelProperties: { - ...Action.type.modelProperties, + ...ChaosExperimentAction.type.modelProperties, duration: { serializedName: "duration", required: true, @@ -1592,10 +1863,11 @@ export const DiscreteAction: coreClient.CompositeMapper = { type: { name: "Composite", className: "DiscreteAction", - uberParent: "Action", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + uberParent: "ChaosExperimentAction", + polymorphicDiscriminator: + ChaosExperimentAction.type.polymorphicDiscriminator, modelProperties: { - ...Action.type.modelProperties, + ...ChaosExperimentAction.type.modelProperties, parameters: { serializedName: "parameters", required: true, @@ -1628,10 +1900,11 @@ export const ContinuousAction: coreClient.CompositeMapper = { type: { name: "Composite", className: "ContinuousAction", - uberParent: "Action", - polymorphicDiscriminator: Action.type.polymorphicDiscriminator, + uberParent: "ChaosExperimentAction", + polymorphicDiscriminator: + ChaosExperimentAction.type.polymorphicDiscriminator, modelProperties: { - ...Action.type.modelProperties, + ...ChaosExperimentAction.type.modelProperties, duration: { serializedName: "duration", required: true, @@ -1666,16 +1939,16 @@ export const ContinuousAction: coreClient.CompositeMapper = { } }; -export const ListSelector: coreClient.CompositeMapper = { +export const ChaosTargetListSelector: coreClient.CompositeMapper = { serializedName: "List", type: { name: "Composite", - className: "ListSelector", - uberParent: "Selector", + className: "ChaosTargetListSelector", + uberParent: "ChaosTargetSelector", additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: Selector.type.polymorphicDiscriminator, + polymorphicDiscriminator: ChaosTargetSelector.type.polymorphicDiscriminator, modelProperties: { - ...Selector.type.modelProperties, + ...ChaosTargetSelector.type.modelProperties, targets: { constraints: { MinItems: 1 @@ -1696,16 +1969,16 @@ export const ListSelector: coreClient.CompositeMapper = { } }; -export const QuerySelector: coreClient.CompositeMapper = { +export const ChaosTargetQuerySelector: coreClient.CompositeMapper = { serializedName: "Query", type: { name: "Composite", - className: "QuerySelector", - uberParent: "Selector", + className: "ChaosTargetQuerySelector", + uberParent: "ChaosTargetSelector", additionalProperties: { type: { name: "Object" } }, - polymorphicDiscriminator: Selector.type.polymorphicDiscriminator, + polymorphicDiscriminator: ChaosTargetSelector.type.polymorphicDiscriminator, modelProperties: { - ...Selector.type.modelProperties, + ...ChaosTargetSelector.type.modelProperties, queryString: { serializedName: "queryString", required: true, @@ -1732,20 +2005,127 @@ export const QuerySelector: coreClient.CompositeMapper = { } }; -export const SimpleFilter: coreClient.CompositeMapper = { +export const ChaosTargetSimpleFilter: coreClient.CompositeMapper = { serializedName: "Simple", type: { name: "Composite", - className: "SimpleFilter", - uberParent: "Filter", - polymorphicDiscriminator: Filter.type.polymorphicDiscriminator, + className: "ChaosTargetSimpleFilter", + uberParent: "ChaosTargetFilter", + polymorphicDiscriminator: ChaosTargetFilter.type.polymorphicDiscriminator, modelProperties: { - ...Filter.type.modelProperties, + ...ChaosTargetFilter.type.modelProperties, parameters: { serializedName: "parameters", type: { name: "Composite", - className: "SimpleFilterParameters" + className: "ChaosTargetSimpleFilterParameters" + } + } + } + } +}; + +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...ResourceAutoGenerated.type.modelProperties, + groupIds: { + serializedName: "properties.groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TrackedResourceAutoGenerated: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResourceAutoGenerated", + modelProperties: { + ...ResourceAutoGenerated.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkResource", + modelProperties: { + ...ResourceAutoGenerated.type.modelProperties, + groupId: { + serializedName: "properties.groupId", + readOnly: true, + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "properties.requiredMembers", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "properties.requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } @@ -1772,6 +2152,13 @@ export const Experiment: coreClient.CompositeMapper = { className: "ResourceIdentity" } }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, steps: { constraints: { MinItems: 1 @@ -1783,7 +2170,7 @@ export const Experiment: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Step" + className: "ChaosExperimentStep" } } } @@ -1799,16 +2186,54 @@ export const Experiment: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Selector" + className: "ChaosTargetSelector" } } } }, - startOnCreation: { - serializedName: "properties.startOnCreation", - nullable: true, + customerDataStorage: { + serializedName: "properties.customerDataStorage", type: { - name: "Boolean" + name: "Composite", + className: "CustomerDataStorageProperties" + } + } + } + } +}; + +export const PrivateAccess: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateAccess", + modelProperties: { + ...TrackedResourceAutoGenerated.type.modelProperties, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + } + } +}; + +export const PrivateAccessesDeleteAPrivateEndpointConnectionHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateAccessesDeleteAPrivateEndpointConnectionHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" } } } @@ -1816,13 +2241,13 @@ export const Experiment: coreClient.CompositeMapper = { }; export let discriminators = { - Action: Action, - Selector: Selector, - Filter: Filter, - "Action.delay": DelayAction, - "Action.discrete": DiscreteAction, - "Action.continuous": ContinuousAction, - "Selector.List": ListSelector, - "Selector.Query": QuerySelector, - "Filter.Simple": SimpleFilter + ChaosExperimentAction: ChaosExperimentAction, + ChaosTargetSelector: ChaosTargetSelector, + ChaosTargetFilter: ChaosTargetFilter, + "ChaosExperimentAction.delay": DelayAction, + "ChaosExperimentAction.discrete": DiscreteAction, + "ChaosExperimentAction.continuous": ContinuousAction, + "ChaosTargetSelector.List": ChaosTargetListSelector, + "ChaosTargetSelector.Query": ChaosTargetQuerySelector, + "ChaosTargetFilter.Simple": ChaosTargetSimpleFilter }; diff --git a/sdk/chaos/arm-chaos/src/models/parameters.ts b/sdk/chaos/arm-chaos/src/models/parameters.ts index 6075ecf078f5..48ce704617f5 100644 --- a/sdk/chaos/arm-chaos/src/models/parameters.ts +++ b/sdk/chaos/arm-chaos/src/models/parameters.ts @@ -15,6 +15,7 @@ import { Capability as CapabilityMapper, Experiment as ExperimentMapper, ExperimentUpdate as ExperimentUpdateMapper, + PrivateAccess as PrivateAccessMapper, Target as TargetMapper } from "../models/mappers"; @@ -45,7 +46,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-04-15-preview", + defaultValue: "2023-10-27-preview", isConstant: true, serializedName: "api-version", type: { @@ -302,6 +303,62 @@ export const executionDetailsId: OperationURLParameter = { } }; +export const location: OperationURLParameter = { + parameterPath: "location", + mapper: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } +}; + +export const asyncOperationId: OperationURLParameter = { + parameterPath: "asyncOperationId", + mapper: { + serializedName: "asyncOperationId", + required: true, + type: { + name: "String" + } + } +}; + +export const privateAccessName: OperationURLParameter = { + parameterPath: "privateAccessName", + mapper: { + constraints: { + Pattern: new RegExp("^[^<>%&:?#/\\\\]+$"), + MinLength: 1 + }, + serializedName: "privateAccessName", + required: true, + type: { + name: "String" + } + } +}; + +export const privateAccess: OperationParameter = { + parameterPath: "privateAccess", + mapper: PrivateAccessMapper +}; + +export const privateEndpointConnectionName: OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + constraints: { + Pattern: new RegExp("^[^<>%&:?#/\\\\]+$") + }, + serializedName: "privateEndpointConnectionName", + required: true, + type: { + name: "String" + } + } +}; + export const target: OperationParameter = { parameterPath: "target", mapper: TargetMapper diff --git a/sdk/chaos/arm-chaos/src/operations/experiments.ts b/sdk/chaos/arm-chaos/src/operations/experiments.ts index c7de32e6aca2..7724ea5aa447 100644 --- a/sdk/chaos/arm-chaos/src/operations/experiments.ts +++ b/sdk/chaos/arm-chaos/src/operations/experiments.ts @@ -13,6 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { ChaosManagementClient } from "../chaosManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Experiment, ExperimentsListAllNextOptionalParams, @@ -38,9 +44,7 @@ import { ExperimentsUpdateOptionalParams, ExperimentsUpdateResponse, ExperimentsCancelOptionalParams, - ExperimentsCancelResponse, ExperimentsStartOptionalParams, - ExperimentsStartResponse, ExperimentsGetStatusOptionalParams, ExperimentsGetStatusResponse, ExperimentsGetExecutionDetailsOptionalParams, @@ -379,15 +383,81 @@ export class ExperimentsImpl implements Experiments { * @param experimentName String that represents a Experiment resource name. * @param options The options parameters. */ - delete( + async beginDelete( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsDeleteOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, experimentName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + async beginDeleteAndWait( resourceGroupName: string, experimentName: string, options?: ExperimentsDeleteOptionalParams ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, experimentName, options }, - deleteOperationSpec + const poller = await this.beginDelete( + resourceGroupName, + experimentName, + options ); + return poller.pollUntilDone(); } /** @@ -414,16 +484,93 @@ export class ExperimentsImpl implements Experiments { * @param experiment Experiment resource to be created or updated. * @param options The options parameters. */ - createOrUpdate( + async beginCreateOrUpdate( + resourceGroupName: string, + experimentName: string, + experiment: Experiment, + options?: ExperimentsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ExperimentsCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, experimentName, experiment, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + ExperimentsCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( resourceGroupName: string, experimentName: string, experiment: Experiment, options?: ExperimentsCreateOrUpdateOptionalParams ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, experimentName, experiment, options }, - createOrUpdateOperationSpec + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + experimentName, + experiment, + options ); + return poller.pollUntilDone(); } /** @@ -433,16 +580,93 @@ export class ExperimentsImpl implements Experiments { * @param experiment Parameters supplied to the Update experiment operation. * @param options The options parameters. */ - update( + async beginUpdate( + resourceGroupName: string, + experimentName: string, + experiment: ExperimentUpdate, + options?: ExperimentsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ExperimentsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, experimentName, experiment, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + ExperimentsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * The operation to update an experiment. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Parameters supplied to the Update experiment operation. + * @param options The options parameters. + */ + async beginUpdateAndWait( resourceGroupName: string, experimentName: string, experiment: ExperimentUpdate, options?: ExperimentsUpdateOptionalParams ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, experimentName, experiment, options }, - updateOperationSpec + const poller = await this.beginUpdate( + resourceGroupName, + experimentName, + experiment, + options ); + return poller.pollUntilDone(); } /** @@ -451,15 +675,81 @@ export class ExperimentsImpl implements Experiments { * @param experimentName String that represents a Experiment resource name. * @param options The options parameters. */ - cancel( + async beginCancel( resourceGroupName: string, experimentName: string, options?: ExperimentsCancelOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, experimentName, options }, - cancelOperationSpec + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, experimentName, options }, + spec: cancelOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + async beginCancelAndWait( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsCancelOptionalParams + ): Promise { + const poller = await this.beginCancel( + resourceGroupName, + experimentName, + options ); + return poller.pollUntilDone(); } /** @@ -468,15 +758,81 @@ export class ExperimentsImpl implements Experiments { * @param experimentName String that represents a Experiment resource name. * @param options The options parameters. */ - start( + async beginStart( resourceGroupName: string, experimentName: string, options?: ExperimentsStartOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, experimentName, options }, - startOperationSpec + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, experimentName, options }, + spec: startOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Start a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + async beginStartAndWait( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsStartOptionalParams + ): Promise { + const poller = await this.beginStart( + resourceGroupName, + experimentName, + options ); + return poller.pollUntilDone(); } /** @@ -675,6 +1031,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse @@ -720,6 +1078,15 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.Experiment }, + 201: { + bodyMapper: Mappers.Experiment + }, + 202: { + bodyMapper: Mappers.Experiment + }, + 204: { + bodyMapper: Mappers.Experiment + }, default: { bodyMapper: Mappers.ErrorResponse } @@ -744,6 +1111,15 @@ const updateOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.Experiment }, + 201: { + bodyMapper: Mappers.Experiment + }, + 202: { + bodyMapper: Mappers.Experiment + }, + 204: { + bodyMapper: Mappers.Experiment + }, default: { bodyMapper: Mappers.ErrorResponse } @@ -765,9 +1141,10 @@ const cancelOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel", httpMethod: "POST", responses: { - 202: { - bodyMapper: Mappers.ExperimentCancelOperationResult - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } @@ -787,9 +1164,10 @@ const startOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start", httpMethod: "POST", responses: { - 202: { - bodyMapper: Mappers.ExperimentStartOperationResult - }, + 200: {}, + 201: {}, + 202: {}, + 204: {}, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/chaos/arm-chaos/src/operations/index.ts b/sdk/chaos/arm-chaos/src/operations/index.ts index 200980df3f09..b4568925bcf8 100644 --- a/sdk/chaos/arm-chaos/src/operations/index.ts +++ b/sdk/chaos/arm-chaos/src/operations/index.ts @@ -9,6 +9,8 @@ export * from "./capabilities"; export * from "./capabilityTypes"; export * from "./experiments"; +export * from "./operationStatuses"; export * from "./operations"; +export * from "./privateAccesses"; export * from "./targetTypes"; export * from "./targets"; diff --git a/sdk/chaos/arm-chaos/src/operations/operationStatuses.ts b/sdk/chaos/arm-chaos/src/operations/operationStatuses.ts new file mode 100644 index 000000000000..7398bcdd3cf1 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/operationStatuses.ts @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { OperationStatuses } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClient } from "../chaosManagementClient"; +import { + OperationStatusesGetOptionalParams, + OperationStatusesGetResponse +} from "../models"; + +/** Class containing OperationStatuses operations. */ +export class OperationStatusesImpl implements OperationStatuses { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class OperationStatuses class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get the status of a long running azure asynchronous operation. + * @param location The region name of operation. + * @param asyncOperationId The operation Id. + * @param options The options parameters. + */ + get( + location: string, + asyncOperationId: string, + options?: OperationStatusesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, asyncOperationId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/operationsStatuses/{asyncOperationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.location, + Parameters.asyncOperationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operations/privateAccesses.ts b/sdk/chaos/arm-chaos/src/operations/privateAccesses.ts new file mode 100644 index 000000000000..a3ab550481fa --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operations/privateAccesses.ts @@ -0,0 +1,835 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { PrivateAccesses } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ChaosManagementClient } from "../chaosManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + PrivateAccess, + PrivateAccessesListAllNextOptionalParams, + PrivateAccessesListAllOptionalParams, + PrivateAccessesListAllResponse, + PrivateAccessesListNextOptionalParams, + PrivateAccessesListOptionalParams, + PrivateAccessesListResponse, + PrivateEndpointConnection, + PrivateAccessesListPrivateEndpointConnectionsNextOptionalParams, + PrivateAccessesListPrivateEndpointConnectionsOptionalParams, + PrivateAccessesListPrivateEndpointConnectionsResponse, + PrivateAccessesGetOptionalParams, + PrivateAccessesGetResponse, + PrivateAccessesCreateOrUpdateOptionalParams, + PrivateAccessesCreateOrUpdateResponse, + PrivateAccessesDeleteOptionalParams, + PrivateAccessesGetPrivateLinkResourcesOptionalParams, + PrivateAccessesGetPrivateLinkResourcesResponse, + PrivateAccessesGetAPrivateEndpointConnectionOptionalParams, + PrivateAccessesGetAPrivateEndpointConnectionResponse, + PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams, + PrivateAccessesDeleteAPrivateEndpointConnectionResponse, + PrivateAccessesListAllNextResponse, + PrivateAccessesListNextResponse, + PrivateAccessesListPrivateEndpointConnectionsNextResponse +} from "../models"; + +/// +/** Class containing PrivateAccesses operations. */ +export class PrivateAccessesImpl implements PrivateAccesses { + private readonly client: ChaosManagementClient; + + /** + * Initialize a new instance of the class PrivateAccesses class. + * @param client Reference to the service client + */ + constructor(client: ChaosManagementClient) { + this.client = client; + } + + /** + * Get a list of private access resources in a subscription. + * @param options The options parameters. + */ + public listAll( + options?: PrivateAccessesListAllOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAllPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAllPagingPage(options, settings); + } + }; + } + + private async *listAllPagingPage( + options?: PrivateAccessesListAllOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: PrivateAccessesListAllResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAll(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listAllNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listAllPagingAll( + options?: PrivateAccessesListAllOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAllPagingPage(options)) { + yield* page; + } + } + + /** + * Get a list of private access resources in a resource group. + * @param resourceGroupName String that represents an Azure resource group. + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + options?: PrivateAccessesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + options?: PrivateAccessesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: PrivateAccessesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + options?: PrivateAccessesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(resourceGroupName, options)) { + yield* page; + } + } + + /** + * List information about private endpoint connections under a private access resource + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + public listPrivateEndpointConnections( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesListPrivateEndpointConnectionsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPrivateEndpointConnectionsPagingAll( + resourceGroupName, + privateAccessName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPrivateEndpointConnectionsPagingPage( + resourceGroupName, + privateAccessName, + options, + settings + ); + } + }; + } + + private async *listPrivateEndpointConnectionsPagingPage( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesListPrivateEndpointConnectionsOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: PrivateAccessesListPrivateEndpointConnectionsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listPrivateEndpointConnections( + resourceGroupName, + privateAccessName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listPrivateEndpointConnectionsNext( + resourceGroupName, + privateAccessName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPrivateEndpointConnectionsPagingAll( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesListPrivateEndpointConnectionsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPrivateEndpointConnectionsPagingPage( + resourceGroupName, + privateAccessName, + options + )) { + yield* page; + } + } + + /** + * Get a list of private access resources in a subscription. + * @param options The options parameters. + */ + private _listAll( + options?: PrivateAccessesListAllOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listAllOperationSpec); + } + + /** + * Get a list of private access resources in a resource group. + * @param resourceGroupName String that represents an Azure resource group. + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + options?: PrivateAccessesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listOperationSpec + ); + } + + /** + * Get a private access resource + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, privateAccessName, options }, + getOperationSpec + ); + } + + /** + * Create or update a private access + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateAccess private access resource to be created or updated. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + privateAccessName: string, + privateAccess: PrivateAccess, + options?: PrivateAccessesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, privateAccessName, privateAccess, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Delete a private access + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, privateAccessName, options }, + deleteOperationSpec + ); + } + + /** + * Gets the private link resources possible under private access resource + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + getPrivateLinkResources( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesGetPrivateLinkResourcesOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, privateAccessName, options }, + getPrivateLinkResourcesOperationSpec + ); + } + + /** + * Gets information about a private endpoint connection under a private access resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + getAPrivateEndpointConnection( + resourceGroupName: string, + privateAccessName: string, + privateEndpointConnectionName: string, + options?: PrivateAccessesGetAPrivateEndpointConnectionOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + privateAccessName, + privateEndpointConnectionName, + options + }, + getAPrivateEndpointConnectionOperationSpec + ); + } + + /** + * Deletes a private endpoint connection under a private access resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAPrivateEndpointConnection( + resourceGroupName: string, + privateAccessName: string, + privateEndpointConnectionName: string, + options?: PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PrivateAccessesDeleteAPrivateEndpointConnectionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + privateAccessName, + privateEndpointConnectionName, + options + }, + spec: deleteAPrivateEndpointConnectionOperationSpec + }); + const poller = await createHttpPoller< + PrivateAccessesDeleteAPrivateEndpointConnectionResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes a private endpoint connection under a private access resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + async beginDeleteAPrivateEndpointConnectionAndWait( + resourceGroupName: string, + privateAccessName: string, + privateEndpointConnectionName: string, + options?: PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams + ): Promise { + const poller = await this.beginDeleteAPrivateEndpointConnection( + resourceGroupName, + privateAccessName, + privateEndpointConnectionName, + options + ); + return poller.pollUntilDone(); + } + + /** + * List information about private endpoint connections under a private access resource + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + private _listPrivateEndpointConnections( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesListPrivateEndpointConnectionsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, privateAccessName, options }, + listPrivateEndpointConnectionsOperationSpec + ); + } + + /** + * ListAllNext + * @param nextLink The nextLink from the previous successful call to the ListAll method. + * @param options The options parameters. + */ + private _listAllNext( + nextLink: string, + options?: PrivateAccessesListAllNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listAllNextOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName String that represents an Azure resource group. + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + nextLink: string, + options?: PrivateAccessesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListPrivateEndpointConnectionsNext + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param nextLink The nextLink from the previous successful call to the ListPrivateEndpointConnections + * method. + * @param options The options parameters. + */ + private _listPrivateEndpointConnectionsNext( + resourceGroupName: string, + privateAccessName: string, + nextLink: string, + options?: PrivateAccessesListPrivateEndpointConnectionsNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, privateAccessName, nextLink, options }, + listPrivateEndpointConnectionsNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listAllOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/privateAccesses", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateAccessListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateAccessListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion, Parameters.continuationToken], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateAccess + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.privateAccessName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.PrivateAccess + }, + 201: { + bodyMapper: Mappers.PrivateAccess + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + requestBody: Parameters.privateAccess, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.privateAccessName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.privateAccessName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getPrivateLinkResourcesOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateLinkResources", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResourceListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.privateAccessName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.privateAccessName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteAPrivateEndpointConnectionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: + Mappers.PrivateAccessesDeleteAPrivateEndpointConnectionHeaders + }, + 201: { + headersMapper: + Mappers.PrivateAccessesDeleteAPrivateEndpointConnectionHeaders + }, + 202: { + headersMapper: + Mappers.PrivateAccessesDeleteAPrivateEndpointConnectionHeaders + }, + 204: { + headersMapper: + Mappers.PrivateAccessesDeleteAPrivateEndpointConnectionHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.privateAccessName, + Parameters.privateEndpointConnectionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listPrivateEndpointConnectionsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/privateAccesses/{privateAccessName}/privateEndpointConnections", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.privateAccessName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listAllNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateAccessListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateAccessListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listPrivateEndpointConnectionsNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnectionListResult + }, + default: { + bodyMapper: Mappers.ErrorResponseAutoGenerated + } + }, + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink, + Parameters.privateAccessName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts index 8ef06c0de026..a62a9cad8448 100644 --- a/sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/experiments.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Experiment, ExperimentsListAllOptionalParams, @@ -24,9 +25,7 @@ import { ExperimentsUpdateOptionalParams, ExperimentsUpdateResponse, ExperimentsCancelOptionalParams, - ExperimentsCancelResponse, ExperimentsStartOptionalParams, - ExperimentsStartResponse, ExperimentsGetStatusOptionalParams, ExperimentsGetStatusResponse, ExperimentsGetExecutionDetailsOptionalParams, @@ -80,7 +79,18 @@ export interface Experiments { * @param experimentName String that represents a Experiment resource name. * @param options The options parameters. */ - delete( + beginDelete( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + beginDeleteAndWait( resourceGroupName: string, experimentName: string, options?: ExperimentsDeleteOptionalParams @@ -103,7 +113,25 @@ export interface Experiments { * @param experiment Experiment resource to be created or updated. * @param options The options parameters. */ - createOrUpdate( + beginCreateOrUpdate( + resourceGroupName: string, + experimentName: string, + experiment: Experiment, + options?: ExperimentsCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ExperimentsCreateOrUpdateResponse + > + >; + /** + * Create or update a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Experiment resource to be created or updated. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( resourceGroupName: string, experimentName: string, experiment: Experiment, @@ -116,7 +144,25 @@ export interface Experiments { * @param experiment Parameters supplied to the Update experiment operation. * @param options The options parameters. */ - update( + beginUpdate( + resourceGroupName: string, + experimentName: string, + experiment: ExperimentUpdate, + options?: ExperimentsUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + ExperimentsUpdateResponse + > + >; + /** + * The operation to update an experiment. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param experiment Parameters supplied to the Update experiment operation. + * @param options The options parameters. + */ + beginUpdateAndWait( resourceGroupName: string, experimentName: string, experiment: ExperimentUpdate, @@ -128,22 +174,44 @@ export interface Experiments { * @param experimentName String that represents a Experiment resource name. * @param options The options parameters. */ - cancel( + beginCancel( resourceGroupName: string, experimentName: string, options?: ExperimentsCancelOptionalParams - ): Promise; + ): Promise, void>>; + /** + * Cancel a running Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + beginCancelAndWait( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsCancelOptionalParams + ): Promise; + /** + * Start a Experiment resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param experimentName String that represents a Experiment resource name. + * @param options The options parameters. + */ + beginStart( + resourceGroupName: string, + experimentName: string, + options?: ExperimentsStartOptionalParams + ): Promise, void>>; /** * Start a Experiment resource. * @param resourceGroupName String that represents an Azure resource group. * @param experimentName String that represents a Experiment resource name. * @param options The options parameters. */ - start( + beginStartAndWait( resourceGroupName: string, experimentName: string, options?: ExperimentsStartOptionalParams - ): Promise; + ): Promise; /** * Get a status of a Experiment resource. * @param resourceGroupName String that represents an Azure resource group. diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts index 200980df3f09..b4568925bcf8 100644 --- a/sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/index.ts @@ -9,6 +9,8 @@ export * from "./capabilities"; export * from "./capabilityTypes"; export * from "./experiments"; +export * from "./operationStatuses"; export * from "./operations"; +export * from "./privateAccesses"; export * from "./targetTypes"; export * from "./targets"; diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/operationStatuses.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/operationStatuses.ts new file mode 100644 index 000000000000..10c482497419 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/operationStatuses.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + OperationStatusesGetOptionalParams, + OperationStatusesGetResponse +} from "../models"; + +/** Interface representing a OperationStatuses. */ +export interface OperationStatuses { + /** + * Get the status of a long running azure asynchronous operation. + * @param location The region name of operation. + * @param asyncOperationId The operation Id. + * @param options The options parameters. + */ + get( + location: string, + asyncOperationId: string, + options?: OperationStatusesGetOptionalParams + ): Promise; +} diff --git a/sdk/chaos/arm-chaos/src/operationsInterfaces/privateAccesses.ts b/sdk/chaos/arm-chaos/src/operationsInterfaces/privateAccesses.ts new file mode 100644 index 000000000000..025a2b7dcb26 --- /dev/null +++ b/sdk/chaos/arm-chaos/src/operationsInterfaces/privateAccesses.ts @@ -0,0 +1,158 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + PrivateAccess, + PrivateAccessesListAllOptionalParams, + PrivateAccessesListOptionalParams, + PrivateEndpointConnection, + PrivateAccessesListPrivateEndpointConnectionsOptionalParams, + PrivateAccessesGetOptionalParams, + PrivateAccessesGetResponse, + PrivateAccessesCreateOrUpdateOptionalParams, + PrivateAccessesCreateOrUpdateResponse, + PrivateAccessesDeleteOptionalParams, + PrivateAccessesGetPrivateLinkResourcesOptionalParams, + PrivateAccessesGetPrivateLinkResourcesResponse, + PrivateAccessesGetAPrivateEndpointConnectionOptionalParams, + PrivateAccessesGetAPrivateEndpointConnectionResponse, + PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams, + PrivateAccessesDeleteAPrivateEndpointConnectionResponse +} from "../models"; + +/// +/** Interface representing a PrivateAccesses. */ +export interface PrivateAccesses { + /** + * Get a list of private access resources in a subscription. + * @param options The options parameters. + */ + listAll( + options?: PrivateAccessesListAllOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a list of private access resources in a resource group. + * @param resourceGroupName String that represents an Azure resource group. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + options?: PrivateAccessesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * List information about private endpoint connections under a private access resource + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + listPrivateEndpointConnections( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesListPrivateEndpointConnectionsOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a private access resource + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesGetOptionalParams + ): Promise; + /** + * Create or update a private access + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateAccess private access resource to be created or updated. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + privateAccessName: string, + privateAccess: PrivateAccess, + options?: PrivateAccessesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a private access + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesDeleteOptionalParams + ): Promise; + /** + * Gets the private link resources possible under private access resource + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param options The options parameters. + */ + getPrivateLinkResources( + resourceGroupName: string, + privateAccessName: string, + options?: PrivateAccessesGetPrivateLinkResourcesOptionalParams + ): Promise; + /** + * Gets information about a private endpoint connection under a private access resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + getAPrivateEndpointConnection( + resourceGroupName: string, + privateAccessName: string, + privateEndpointConnectionName: string, + options?: PrivateAccessesGetAPrivateEndpointConnectionOptionalParams + ): Promise; + /** + * Deletes a private endpoint connection under a private access resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDeleteAPrivateEndpointConnection( + resourceGroupName: string, + privateAccessName: string, + privateEndpointConnectionName: string, + options?: PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + PrivateAccessesDeleteAPrivateEndpointConnectionResponse + > + >; + /** + * Deletes a private endpoint connection under a private access resource. + * @param resourceGroupName String that represents an Azure resource group. + * @param privateAccessName The name of the private access resource that is being created. Supported + * characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param options The options parameters. + */ + beginDeleteAPrivateEndpointConnectionAndWait( + resourceGroupName: string, + privateAccessName: string, + privateEndpointConnectionName: string, + options?: PrivateAccessesDeleteAPrivateEndpointConnectionOptionalParams + ): Promise; +} diff --git a/sdk/chaos/arm-chaos/test/sampleTest.ts b/sdk/chaos/arm-chaos/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/chaos/arm-chaos/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/chaos/arm-chaos/tsconfig.json b/sdk/chaos/arm-chaos/tsconfig.json index cb248642ee7c..3e6ae96443f3 100644 --- a/sdk/chaos/arm-chaos/tsconfig.json +++ b/sdk/chaos/arm-chaos/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-chaos": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"