@azure/arm-chaos 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/index.js +3725 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/samples-dev/capabilitiesCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/capabilitiesCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/capabilitiesCreateOrUpdateSample.js +36 -0
- package/dist-esm/samples-dev/capabilitiesCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/capabilitiesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/capabilitiesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/capabilitiesDeleteSample.js +35 -0
- package/dist-esm/samples-dev/capabilitiesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/capabilitiesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/capabilitiesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/capabilitiesGetSample.js +35 -0
- package/dist-esm/samples-dev/capabilitiesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/capabilitiesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/capabilitiesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/capabilitiesListSample.js +48 -0
- package/dist-esm/samples-dev/capabilitiesListSample.js.map +1 -0
- package/dist-esm/samples-dev/capabilityTypesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/capabilityTypesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/capabilityTypesGetSample.js +32 -0
- package/dist-esm/samples-dev/capabilityTypesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/capabilityTypesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/capabilityTypesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/capabilityTypesListSample.js +45 -0
- package/dist-esm/samples-dev/capabilityTypesListSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsCancelSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsCancelSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsCancelSample.js +31 -0
- package/dist-esm/samples-dev/experimentsCancelSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsCreateOrUpdateSample.js +66 -0
- package/dist-esm/samples-dev/experimentsCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsDeleteSample.js +31 -0
- package/dist-esm/samples-dev/experimentsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsGetExecutionDetailsSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsGetExecutionDetailsSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsGetExecutionDetailsSample.js +32 -0
- package/dist-esm/samples-dev/experimentsGetExecutionDetailsSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsGetSample.js +31 -0
- package/dist-esm/samples-dev/experimentsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsGetStatusSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsGetStatusSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsGetStatusSample.js +32 -0
- package/dist-esm/samples-dev/experimentsGetStatusSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsListAllSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsListAllSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsListAllSample.js +45 -0
- package/dist-esm/samples-dev/experimentsListAllSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsListAllStatusesSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsListAllStatusesSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsListAllStatusesSample.js +45 -0
- package/dist-esm/samples-dev/experimentsListAllStatusesSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsListExecutionDetailsSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsListExecutionDetailsSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsListExecutionDetailsSample.js +45 -0
- package/dist-esm/samples-dev/experimentsListExecutionDetailsSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsListSample.js +46 -0
- package/dist-esm/samples-dev/experimentsListSample.js.map +1 -0
- package/dist-esm/samples-dev/experimentsStartSample.d.ts +2 -0
- package/dist-esm/samples-dev/experimentsStartSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/experimentsStartSample.js +31 -0
- package/dist-esm/samples-dev/experimentsStartSample.js.map +1 -0
- package/dist-esm/samples-dev/targetTypesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/targetTypesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/targetTypesGetSample.js +31 -0
- package/dist-esm/samples-dev/targetTypesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/targetTypesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/targetTypesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/targetTypesListSample.js +46 -0
- package/dist-esm/samples-dev/targetTypesListSample.js.map +1 -0
- package/dist-esm/samples-dev/targetsCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/targetsCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/targetsCreateOrUpdateSample.js +41 -0
- package/dist-esm/samples-dev/targetsCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/targetsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/targetsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/targetsDeleteSample.js +34 -0
- package/dist-esm/samples-dev/targetsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/targetsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/targetsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/targetsGetSample.js +34 -0
- package/dist-esm/samples-dev/targetsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/targetsListSample.d.ts +2 -0
- package/dist-esm/samples-dev/targetsListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/targetsListSample.js +49 -0
- package/dist-esm/samples-dev/targetsListSample.js.map +1 -0
- package/dist-esm/src/chaosManagementClient.d.ts +25 -0
- package/dist-esm/src/chaosManagementClient.d.ts.map +1 -0
- package/dist-esm/src/chaosManagementClient.js +108 -0
- package/dist-esm/src/chaosManagementClient.js.map +1 -0
- package/dist-esm/src/index.d.ts +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +980 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +36 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +50 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +1530 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +25 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +264 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/capabilities.d.ts +81 -0
- package/dist-esm/src/operations/capabilities.d.ts.map +1 -0
- package/dist-esm/src/operations/capabilities.js +308 -0
- package/dist-esm/src/operations/capabilities.js.map +1 -0
- package/dist-esm/src/operations/capabilityTypes.d.ts +46 -0
- package/dist-esm/src/operations/capabilityTypes.d.ts.map +1 -0
- package/dist-esm/src/operations/capabilityTypes.js +169 -0
- package/dist-esm/src/operations/capabilityTypes.js.map +1 -0
- package/dist-esm/src/operations/experiments.d.ts +153 -0
- package/dist-esm/src/operations/experiments.d.ts.map +1 -0
- package/dist-esm/src/operations/experiments.js +687 -0
- package/dist-esm/src/operations/experiments.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +7 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +14 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +32 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +120 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/targetTypes.d.ts +42 -0
- package/dist-esm/src/operations/targetTypes.d.ts.map +1 -0
- package/dist-esm/src/operations/targetTypes.js +162 -0
- package/dist-esm/src/operations/targetTypes.js.map +1 -0
- package/dist-esm/src/operations/targets.d.ts +75 -0
- package/dist-esm/src/operations/targets.d.ts.map +1 -0
- package/dist-esm/src/operations/targets.js +292 -0
- package/dist-esm/src/operations/targets.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/capabilities.d.ts +50 -0
- package/dist-esm/src/operationsInterfaces/capabilities.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/capabilities.js +9 -0
- package/dist-esm/src/operationsInterfaces/capabilities.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/capabilityTypes.d.ts +21 -0
- package/dist-esm/src/operationsInterfaces/capabilityTypes.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/capabilityTypes.js +9 -0
- package/dist-esm/src/operationsInterfaces/capabilityTypes.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/experiments.d.ts +83 -0
- package/dist-esm/src/operationsInterfaces/experiments.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/experiments.js +9 -0
- package/dist-esm/src/operationsInterfaces/experiments.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +7 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +14 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/targetTypes.d.ts +19 -0
- package/dist-esm/src/operationsInterfaces/targetTypes.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/targetTypes.js +9 -0
- package/dist-esm/src/operationsInterfaces/targetTypes.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/targets.d.ts +46 -0
- package/dist-esm/src/operationsInterfaces/targets.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/targets.js +9 -0
- package/dist-esm/src/operationsInterfaces/targets.js.map +1 -0
- package/dist-esm/test/chaos_examples.spec.d.ts +4 -0
- package/dist-esm/test/chaos_examples.spec.d.ts.map +1 -0
- package/dist-esm/test/chaos_examples.spec.js +261 -0
- package/dist-esm/test/chaos_examples.spec.js.map +1 -0
- package/package.json +120 -0
- package/review/arm-chaos.api.md +682 -0
- package/rollup.config.js +122 -0
- package/src/chaosManagementClient.ts +165 -0
- package/src/index.ts +12 -0
- package/src/models/index.ts +1111 -0
- package/src/models/mappers.ts +1640 -0
- package/src/models/parameters.ts +302 -0
- package/src/operations/capabilities.ts +435 -0
- package/src/operations/capabilityTypes.ts +221 -0
- package/src/operations/experiments.ts +892 -0
- package/src/operations/index.ts +14 -0
- package/src/operations/operations.ts +137 -0
- package/src/operations/targetTypes.ts +199 -0
- package/src/operations/targets.ts +406 -0
- package/src/operationsInterfaces/capabilities.ts +99 -0
- package/src/operationsInterfaces/capabilityTypes.ts +44 -0
- package/src/operationsInterfaces/experiments.ts +157 -0
- package/src/operationsInterfaces/index.ts +14 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/targetTypes.ts +40 -0
- package/src/operationsInterfaces/targets.ts +91 -0
- package/tsconfig.json +33 -0
- package/types/arm-chaos.d.ts +1337 -0
- package/types/tsdoc-metadata.json +11 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from "./capabilities";
|
|
10
|
+
export * from "./experiments";
|
|
11
|
+
export * from "./operations";
|
|
12
|
+
export * from "./targets";
|
|
13
|
+
export * from "./targetTypes";
|
|
14
|
+
export * from "./capabilityTypes";
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
+
import { Operations } from "../operationsInterfaces";
|
|
11
|
+
import * as coreClient from "@azure/core-client";
|
|
12
|
+
import * as Mappers from "../models/mappers";
|
|
13
|
+
import * as Parameters from "../models/parameters";
|
|
14
|
+
import { ChaosManagementClient } from "../chaosManagementClient";
|
|
15
|
+
import {
|
|
16
|
+
Operation,
|
|
17
|
+
OperationsListAllNextOptionalParams,
|
|
18
|
+
OperationsListAllOptionalParams,
|
|
19
|
+
OperationsListAllResponse,
|
|
20
|
+
OperationsListAllNextResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing Operations operations. */
|
|
25
|
+
export class OperationsImpl implements Operations {
|
|
26
|
+
private readonly client: ChaosManagementClient;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize a new instance of the class Operations class.
|
|
30
|
+
* @param client Reference to the service client
|
|
31
|
+
*/
|
|
32
|
+
constructor(client: ChaosManagementClient) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get a list all available Operations.
|
|
38
|
+
* @param options The options parameters.
|
|
39
|
+
*/
|
|
40
|
+
public listAll(
|
|
41
|
+
options?: OperationsListAllOptionalParams
|
|
42
|
+
): PagedAsyncIterableIterator<Operation> {
|
|
43
|
+
const iter = this.listAllPagingAll(options);
|
|
44
|
+
return {
|
|
45
|
+
next() {
|
|
46
|
+
return iter.next();
|
|
47
|
+
},
|
|
48
|
+
[Symbol.asyncIterator]() {
|
|
49
|
+
return this;
|
|
50
|
+
},
|
|
51
|
+
byPage: () => {
|
|
52
|
+
return this.listAllPagingPage(options);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private async *listAllPagingPage(
|
|
58
|
+
options?: OperationsListAllOptionalParams
|
|
59
|
+
): AsyncIterableIterator<Operation[]> {
|
|
60
|
+
let result = await this._listAll(options);
|
|
61
|
+
yield result.value || [];
|
|
62
|
+
let continuationToken = result.nextLink;
|
|
63
|
+
while (continuationToken) {
|
|
64
|
+
result = await this._listAllNext(continuationToken, options);
|
|
65
|
+
continuationToken = result.nextLink;
|
|
66
|
+
yield result.value || [];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private async *listAllPagingAll(
|
|
71
|
+
options?: OperationsListAllOptionalParams
|
|
72
|
+
): AsyncIterableIterator<Operation> {
|
|
73
|
+
for await (const page of this.listAllPagingPage(options)) {
|
|
74
|
+
yield* page;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get a list all available Operations.
|
|
80
|
+
* @param options The options parameters.
|
|
81
|
+
*/
|
|
82
|
+
private _listAll(
|
|
83
|
+
options?: OperationsListAllOptionalParams
|
|
84
|
+
): Promise<OperationsListAllResponse> {
|
|
85
|
+
return this.client.sendOperationRequest({ options }, listAllOperationSpec);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* ListAllNext
|
|
90
|
+
* @param nextLink The nextLink from the previous successful call to the ListAll method.
|
|
91
|
+
* @param options The options parameters.
|
|
92
|
+
*/
|
|
93
|
+
private _listAllNext(
|
|
94
|
+
nextLink: string,
|
|
95
|
+
options?: OperationsListAllNextOptionalParams
|
|
96
|
+
): Promise<OperationsListAllNextResponse> {
|
|
97
|
+
return this.client.sendOperationRequest(
|
|
98
|
+
{ nextLink, options },
|
|
99
|
+
listAllNextOperationSpec
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// Operation Specifications
|
|
104
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
105
|
+
|
|
106
|
+
const listAllOperationSpec: coreClient.OperationSpec = {
|
|
107
|
+
path: "/providers/Microsoft.Chaos/operations",
|
|
108
|
+
httpMethod: "GET",
|
|
109
|
+
responses: {
|
|
110
|
+
200: {
|
|
111
|
+
bodyMapper: Mappers.OperationListResult
|
|
112
|
+
},
|
|
113
|
+
default: {
|
|
114
|
+
bodyMapper: Mappers.ErrorResponse
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
queryParameters: [Parameters.apiVersion],
|
|
118
|
+
urlParameters: [Parameters.$host],
|
|
119
|
+
headerParameters: [Parameters.accept],
|
|
120
|
+
serializer
|
|
121
|
+
};
|
|
122
|
+
const listAllNextOperationSpec: coreClient.OperationSpec = {
|
|
123
|
+
path: "{nextLink}",
|
|
124
|
+
httpMethod: "GET",
|
|
125
|
+
responses: {
|
|
126
|
+
200: {
|
|
127
|
+
bodyMapper: Mappers.OperationListResult
|
|
128
|
+
},
|
|
129
|
+
default: {
|
|
130
|
+
bodyMapper: Mappers.ErrorResponse
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
queryParameters: [Parameters.apiVersion],
|
|
134
|
+
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
135
|
+
headerParameters: [Parameters.accept],
|
|
136
|
+
serializer
|
|
137
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
|
10
|
+
import { TargetTypes } from "../operationsInterfaces";
|
|
11
|
+
import * as coreClient from "@azure/core-client";
|
|
12
|
+
import * as Mappers from "../models/mappers";
|
|
13
|
+
import * as Parameters from "../models/parameters";
|
|
14
|
+
import { ChaosManagementClient } from "../chaosManagementClient";
|
|
15
|
+
import {
|
|
16
|
+
TargetType,
|
|
17
|
+
TargetTypesListNextOptionalParams,
|
|
18
|
+
TargetTypesListOptionalParams,
|
|
19
|
+
TargetTypesListResponse,
|
|
20
|
+
TargetTypesGetOptionalParams,
|
|
21
|
+
TargetTypesGetResponse,
|
|
22
|
+
TargetTypesListNextResponse
|
|
23
|
+
} from "../models";
|
|
24
|
+
|
|
25
|
+
/// <reference lib="esnext.asynciterable" />
|
|
26
|
+
/** Class containing TargetTypes operations. */
|
|
27
|
+
export class TargetTypesImpl implements TargetTypes {
|
|
28
|
+
private readonly client: ChaosManagementClient;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Initialize a new instance of the class TargetTypes class.
|
|
32
|
+
* @param client Reference to the service client
|
|
33
|
+
*/
|
|
34
|
+
constructor(client: ChaosManagementClient) {
|
|
35
|
+
this.client = client;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get a list of Target Type resources for given location.
|
|
40
|
+
* @param locationName String that represents a Location resource name.
|
|
41
|
+
* @param options The options parameters.
|
|
42
|
+
*/
|
|
43
|
+
public list(
|
|
44
|
+
locationName: string,
|
|
45
|
+
options?: TargetTypesListOptionalParams
|
|
46
|
+
): PagedAsyncIterableIterator<TargetType> {
|
|
47
|
+
const iter = this.listPagingAll(locationName, options);
|
|
48
|
+
return {
|
|
49
|
+
next() {
|
|
50
|
+
return iter.next();
|
|
51
|
+
},
|
|
52
|
+
[Symbol.asyncIterator]() {
|
|
53
|
+
return this;
|
|
54
|
+
},
|
|
55
|
+
byPage: () => {
|
|
56
|
+
return this.listPagingPage(locationName, options);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private async *listPagingPage(
|
|
62
|
+
locationName: string,
|
|
63
|
+
options?: TargetTypesListOptionalParams
|
|
64
|
+
): AsyncIterableIterator<TargetType[]> {
|
|
65
|
+
let result = await this._list(locationName, options);
|
|
66
|
+
yield result.value || [];
|
|
67
|
+
let continuationToken = result.nextLink;
|
|
68
|
+
while (continuationToken) {
|
|
69
|
+
result = await this._listNext(locationName, continuationToken, options);
|
|
70
|
+
continuationToken = result.nextLink;
|
|
71
|
+
yield result.value || [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
private async *listPagingAll(
|
|
76
|
+
locationName: string,
|
|
77
|
+
options?: TargetTypesListOptionalParams
|
|
78
|
+
): AsyncIterableIterator<TargetType> {
|
|
79
|
+
for await (const page of this.listPagingPage(locationName, options)) {
|
|
80
|
+
yield* page;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Get a list of Target Type resources for given location.
|
|
86
|
+
* @param locationName String that represents a Location resource name.
|
|
87
|
+
* @param options The options parameters.
|
|
88
|
+
*/
|
|
89
|
+
private _list(
|
|
90
|
+
locationName: string,
|
|
91
|
+
options?: TargetTypesListOptionalParams
|
|
92
|
+
): Promise<TargetTypesListResponse> {
|
|
93
|
+
return this.client.sendOperationRequest(
|
|
94
|
+
{ locationName, options },
|
|
95
|
+
listOperationSpec
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Get a Target Type resources for given location.
|
|
101
|
+
* @param locationName String that represents a Location resource name.
|
|
102
|
+
* @param targetTypeName String that represents a Target Type resource name.
|
|
103
|
+
* @param options The options parameters.
|
|
104
|
+
*/
|
|
105
|
+
get(
|
|
106
|
+
locationName: string,
|
|
107
|
+
targetTypeName: string,
|
|
108
|
+
options?: TargetTypesGetOptionalParams
|
|
109
|
+
): Promise<TargetTypesGetResponse> {
|
|
110
|
+
return this.client.sendOperationRequest(
|
|
111
|
+
{ locationName, targetTypeName, options },
|
|
112
|
+
getOperationSpec
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* ListNext
|
|
118
|
+
* @param locationName String that represents a Location resource name.
|
|
119
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
120
|
+
* @param options The options parameters.
|
|
121
|
+
*/
|
|
122
|
+
private _listNext(
|
|
123
|
+
locationName: string,
|
|
124
|
+
nextLink: string,
|
|
125
|
+
options?: TargetTypesListNextOptionalParams
|
|
126
|
+
): Promise<TargetTypesListNextResponse> {
|
|
127
|
+
return this.client.sendOperationRequest(
|
|
128
|
+
{ locationName, nextLink, options },
|
|
129
|
+
listNextOperationSpec
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Operation Specifications
|
|
134
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
135
|
+
|
|
136
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
137
|
+
path:
|
|
138
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes",
|
|
139
|
+
httpMethod: "GET",
|
|
140
|
+
responses: {
|
|
141
|
+
200: {
|
|
142
|
+
bodyMapper: Mappers.TargetTypeListResult
|
|
143
|
+
},
|
|
144
|
+
default: {
|
|
145
|
+
bodyMapper: Mappers.ErrorResponse
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
queryParameters: [Parameters.apiVersion, Parameters.continuationToken],
|
|
149
|
+
urlParameters: [
|
|
150
|
+
Parameters.$host,
|
|
151
|
+
Parameters.subscriptionId,
|
|
152
|
+
Parameters.locationName
|
|
153
|
+
],
|
|
154
|
+
headerParameters: [Parameters.accept],
|
|
155
|
+
serializer
|
|
156
|
+
};
|
|
157
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
158
|
+
path:
|
|
159
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}",
|
|
160
|
+
httpMethod: "GET",
|
|
161
|
+
responses: {
|
|
162
|
+
200: {
|
|
163
|
+
bodyMapper: Mappers.TargetType
|
|
164
|
+
},
|
|
165
|
+
default: {
|
|
166
|
+
bodyMapper: Mappers.ErrorResponse
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
queryParameters: [Parameters.apiVersion],
|
|
170
|
+
urlParameters: [
|
|
171
|
+
Parameters.$host,
|
|
172
|
+
Parameters.subscriptionId,
|
|
173
|
+
Parameters.locationName,
|
|
174
|
+
Parameters.targetTypeName
|
|
175
|
+
],
|
|
176
|
+
headerParameters: [Parameters.accept],
|
|
177
|
+
serializer
|
|
178
|
+
};
|
|
179
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
180
|
+
path: "{nextLink}",
|
|
181
|
+
httpMethod: "GET",
|
|
182
|
+
responses: {
|
|
183
|
+
200: {
|
|
184
|
+
bodyMapper: Mappers.TargetTypeListResult
|
|
185
|
+
},
|
|
186
|
+
default: {
|
|
187
|
+
bodyMapper: Mappers.ErrorResponse
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
queryParameters: [Parameters.apiVersion, Parameters.continuationToken],
|
|
191
|
+
urlParameters: [
|
|
192
|
+
Parameters.$host,
|
|
193
|
+
Parameters.subscriptionId,
|
|
194
|
+
Parameters.nextLink,
|
|
195
|
+
Parameters.locationName
|
|
196
|
+
],
|
|
197
|
+
headerParameters: [Parameters.accept],
|
|
198
|
+
serializer
|
|
199
|
+
};
|