@azure/arm-networkfunction 1.0.0-alpha.20220714.3
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 +1809 -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/azureTrafficCollectorsByResourceGroupListSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsByResourceGroupListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsByResourceGroupListSample.js +44 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsByResourceGroupListSample.js.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.js +43 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsBySubscriptionListSample.js.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.js +37 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.js +31 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.js +31 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsGetSample.js.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.d.ts +2 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.js +32 -0
- package/dist-esm/samples-dev/azureTrafficCollectorsUpdateTagsSample.js.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.d.ts +2 -0
- package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.js +32 -0
- package/dist-esm/samples-dev/collectorPoliciesCreateOrUpdateSample.js.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesDeleteSample.d.ts +2 -0
- package/dist-esm/samples-dev/collectorPoliciesDeleteSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesDeleteSample.js +32 -0
- package/dist-esm/samples-dev/collectorPoliciesDeleteSample.js.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesGetSample.d.ts +2 -0
- package/dist-esm/samples-dev/collectorPoliciesGetSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesGetSample.js +32 -0
- package/dist-esm/samples-dev/collectorPoliciesGetSample.js.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesListSample.d.ts +2 -0
- package/dist-esm/samples-dev/collectorPoliciesListSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/collectorPoliciesListSample.js +45 -0
- package/dist-esm/samples-dev/collectorPoliciesListSample.js.map +1 -0
- package/dist-esm/samples-dev/networkFunctionListOperationsSample.d.ts +2 -0
- package/dist-esm/samples-dev/networkFunctionListOperationsSample.d.ts.map +1 -0
- package/dist-esm/samples-dev/networkFunctionListOperationsSample.js +43 -0
- package/dist-esm/samples-dev/networkFunctionListOperationsSample.js.map +1 -0
- package/dist-esm/src/azureTrafficCollectorClient.d.ts +24 -0
- package/dist-esm/src/azureTrafficCollectorClient.d.ts.map +1 -0
- package/dist-esm/src/azureTrafficCollectorClient.js +102 -0
- package/dist-esm/src/azureTrafficCollectorClient.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/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +414 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +56 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +22 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +531 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +18 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +132 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/azureTrafficCollectors.d.ts +57 -0
- package/dist-esm/src/operations/azureTrafficCollectors.d.ts.map +1 -0
- package/dist-esm/src/operations/azureTrafficCollectors.js +255 -0
- package/dist-esm/src/operations/azureTrafficCollectors.js.map +1 -0
- package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.d.ts +35 -0
- package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.d.ts.map +1 -0
- package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.js +132 -0
- package/dist-esm/src/operations/azureTrafficCollectorsByResourceGroup.js.map +1 -0
- package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.d.ts +32 -0
- package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.d.ts.map +1 -0
- package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.js +124 -0
- package/dist-esm/src/operations/azureTrafficCollectorsBySubscription.js.map +1 -0
- package/dist-esm/src/operations/collectorPolicies.d.ts +79 -0
- package/dist-esm/src/operations/collectorPolicies.d.ts.map +1 -0
- package/dist-esm/src/operations/collectorPolicies.js +356 -0
- package/dist-esm/src/operations/collectorPolicies.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +6 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +13 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/networkFunction.d.ts +26 -0
- package/dist-esm/src/operations/networkFunction.d.ts.map +1 -0
- package/dist-esm/src/operations/networkFunction.js +90 -0
- package/dist-esm/src/operations/networkFunction.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.d.ts +49 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.js +9 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectors.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.d.ts +12 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.js +9 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.js +9 -0
- package/dist-esm/src/operationsInterfaces/azureTrafficCollectorsBySubscription.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/collectorPolicies.d.ts +54 -0
- package/dist-esm/src/operationsInterfaces/collectorPolicies.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/collectorPolicies.js +9 -0
- package/dist-esm/src/operationsInterfaces/collectorPolicies.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +13 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/networkFunction.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/networkFunction.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/networkFunction.js +9 -0
- package/dist-esm/src/operationsInterfaces/networkFunction.js.map +1 -0
- package/dist-esm/test/sampleTest.d.ts +2 -0
- package/dist-esm/test/sampleTest.d.ts.map +1 -0
- package/dist-esm/test/sampleTest.js +38 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +121 -0
- package/review/arm-networkfunction.api.md +375 -0
- package/rollup.config.js +122 -0
- package/src/azureTrafficCollectorClient.ts +158 -0
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +477 -0
- package/src/models/mappers.ts +569 -0
- package/src/models/parameters.ts +157 -0
- package/src/operations/azureTrafficCollectors.ts +358 -0
- package/src/operations/azureTrafficCollectorsByResourceGroup.ts +163 -0
- package/src/operations/azureTrafficCollectorsBySubscription.ts +143 -0
- package/src/operations/collectorPolicies.ts +498 -0
- package/src/operations/index.ts +13 -0
- package/src/operations/networkFunction.ts +101 -0
- package/src/operationsInterfaces/azureTrafficCollectors.ts +96 -0
- package/src/operationsInterfaces/azureTrafficCollectorsByResourceGroup.ts +27 -0
- package/src/operationsInterfaces/azureTrafficCollectorsBySubscription.ts +25 -0
- package/src/operationsInterfaces/collectorPolicies.ts +105 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/networkFunction.ts +25 -0
- package/tsconfig.json +33 -0
- package/types/arm-networkfunction.d.ts +624 -0
- package/types/tsdoc-metadata.json +11 -0
|
@@ -0,0 +1,358 @@
|
|
|
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 { AzureTrafficCollectors } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
12
|
+
import * as Parameters from "../models/parameters";
|
|
13
|
+
import { AzureTrafficCollectorClient } from "../azureTrafficCollectorClient";
|
|
14
|
+
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
|
15
|
+
import { LroImpl } from "../lroImpl";
|
|
16
|
+
import {
|
|
17
|
+
AzureTrafficCollectorsGetOptionalParams,
|
|
18
|
+
AzureTrafficCollectorsGetResponse,
|
|
19
|
+
AzureTrafficCollectorsCreateOrUpdateOptionalParams,
|
|
20
|
+
AzureTrafficCollectorsCreateOrUpdateResponse,
|
|
21
|
+
AzureTrafficCollectorsDeleteOptionalParams,
|
|
22
|
+
TagsObject,
|
|
23
|
+
AzureTrafficCollectorsUpdateTagsOptionalParams,
|
|
24
|
+
AzureTrafficCollectorsUpdateTagsResponse
|
|
25
|
+
} from "../models";
|
|
26
|
+
|
|
27
|
+
/** Class containing AzureTrafficCollectors operations. */
|
|
28
|
+
export class AzureTrafficCollectorsImpl implements AzureTrafficCollectors {
|
|
29
|
+
private readonly client: AzureTrafficCollectorClient;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Initialize a new instance of the class AzureTrafficCollectors class.
|
|
33
|
+
* @param client Reference to the service client
|
|
34
|
+
*/
|
|
35
|
+
constructor(client: AzureTrafficCollectorClient) {
|
|
36
|
+
this.client = client;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Gets the specified Azure Traffic Collector in a specified resource group
|
|
41
|
+
* @param resourceGroupName The name of the resource group.
|
|
42
|
+
* @param azureTrafficCollectorName Azure Traffic Collector name
|
|
43
|
+
* @param options The options parameters.
|
|
44
|
+
*/
|
|
45
|
+
get(
|
|
46
|
+
resourceGroupName: string,
|
|
47
|
+
azureTrafficCollectorName: string,
|
|
48
|
+
options?: AzureTrafficCollectorsGetOptionalParams
|
|
49
|
+
): Promise<AzureTrafficCollectorsGetResponse> {
|
|
50
|
+
return this.client.sendOperationRequest(
|
|
51
|
+
{ resourceGroupName, azureTrafficCollectorName, options },
|
|
52
|
+
getOperationSpec
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Creates or updates a Azure Traffic Collector resource
|
|
58
|
+
* @param resourceGroupName The name of the resource group.
|
|
59
|
+
* @param azureTrafficCollectorName Azure Traffic Collector name
|
|
60
|
+
* @param options The options parameters.
|
|
61
|
+
*/
|
|
62
|
+
async beginCreateOrUpdate(
|
|
63
|
+
resourceGroupName: string,
|
|
64
|
+
azureTrafficCollectorName: string,
|
|
65
|
+
options?: AzureTrafficCollectorsCreateOrUpdateOptionalParams
|
|
66
|
+
): Promise<
|
|
67
|
+
PollerLike<
|
|
68
|
+
PollOperationState<AzureTrafficCollectorsCreateOrUpdateResponse>,
|
|
69
|
+
AzureTrafficCollectorsCreateOrUpdateResponse
|
|
70
|
+
>
|
|
71
|
+
> {
|
|
72
|
+
const directSendOperation = async (
|
|
73
|
+
args: coreClient.OperationArguments,
|
|
74
|
+
spec: coreClient.OperationSpec
|
|
75
|
+
): Promise<AzureTrafficCollectorsCreateOrUpdateResponse> => {
|
|
76
|
+
return this.client.sendOperationRequest(args, spec);
|
|
77
|
+
};
|
|
78
|
+
const sendOperation = async (
|
|
79
|
+
args: coreClient.OperationArguments,
|
|
80
|
+
spec: coreClient.OperationSpec
|
|
81
|
+
) => {
|
|
82
|
+
let currentRawResponse:
|
|
83
|
+
| coreClient.FullOperationResponse
|
|
84
|
+
| undefined = undefined;
|
|
85
|
+
const providedCallback = args.options?.onResponse;
|
|
86
|
+
const callback: coreClient.RawResponseCallback = (
|
|
87
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
88
|
+
flatResponse: unknown
|
|
89
|
+
) => {
|
|
90
|
+
currentRawResponse = rawResponse;
|
|
91
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
92
|
+
};
|
|
93
|
+
const updatedArgs = {
|
|
94
|
+
...args,
|
|
95
|
+
options: {
|
|
96
|
+
...args.options,
|
|
97
|
+
onResponse: callback
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
101
|
+
return {
|
|
102
|
+
flatResponse,
|
|
103
|
+
rawResponse: {
|
|
104
|
+
statusCode: currentRawResponse!.status,
|
|
105
|
+
body: currentRawResponse!.parsedBody,
|
|
106
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const lro = new LroImpl(
|
|
112
|
+
sendOperation,
|
|
113
|
+
{ resourceGroupName, azureTrafficCollectorName, options },
|
|
114
|
+
createOrUpdateOperationSpec
|
|
115
|
+
);
|
|
116
|
+
const poller = new LroEngine(lro, {
|
|
117
|
+
resumeFrom: options?.resumeFrom,
|
|
118
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
119
|
+
lroResourceLocationConfig: "azure-async-operation"
|
|
120
|
+
});
|
|
121
|
+
await poller.poll();
|
|
122
|
+
return poller;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Creates or updates a Azure Traffic Collector resource
|
|
127
|
+
* @param resourceGroupName The name of the resource group.
|
|
128
|
+
* @param azureTrafficCollectorName Azure Traffic Collector name
|
|
129
|
+
* @param options The options parameters.
|
|
130
|
+
*/
|
|
131
|
+
async beginCreateOrUpdateAndWait(
|
|
132
|
+
resourceGroupName: string,
|
|
133
|
+
azureTrafficCollectorName: string,
|
|
134
|
+
options?: AzureTrafficCollectorsCreateOrUpdateOptionalParams
|
|
135
|
+
): Promise<AzureTrafficCollectorsCreateOrUpdateResponse> {
|
|
136
|
+
const poller = await this.beginCreateOrUpdate(
|
|
137
|
+
resourceGroupName,
|
|
138
|
+
azureTrafficCollectorName,
|
|
139
|
+
options
|
|
140
|
+
);
|
|
141
|
+
return poller.pollUntilDone();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Deletes a specified Azure Traffic Collector resource.
|
|
146
|
+
* @param resourceGroupName The name of the resource group.
|
|
147
|
+
* @param azureTrafficCollectorName Azure Traffic Collector name
|
|
148
|
+
* @param options The options parameters.
|
|
149
|
+
*/
|
|
150
|
+
async beginDelete(
|
|
151
|
+
resourceGroupName: string,
|
|
152
|
+
azureTrafficCollectorName: string,
|
|
153
|
+
options?: AzureTrafficCollectorsDeleteOptionalParams
|
|
154
|
+
): Promise<PollerLike<PollOperationState<void>, void>> {
|
|
155
|
+
const directSendOperation = async (
|
|
156
|
+
args: coreClient.OperationArguments,
|
|
157
|
+
spec: coreClient.OperationSpec
|
|
158
|
+
): Promise<void> => {
|
|
159
|
+
return this.client.sendOperationRequest(args, spec);
|
|
160
|
+
};
|
|
161
|
+
const sendOperation = async (
|
|
162
|
+
args: coreClient.OperationArguments,
|
|
163
|
+
spec: coreClient.OperationSpec
|
|
164
|
+
) => {
|
|
165
|
+
let currentRawResponse:
|
|
166
|
+
| coreClient.FullOperationResponse
|
|
167
|
+
| undefined = undefined;
|
|
168
|
+
const providedCallback = args.options?.onResponse;
|
|
169
|
+
const callback: coreClient.RawResponseCallback = (
|
|
170
|
+
rawResponse: coreClient.FullOperationResponse,
|
|
171
|
+
flatResponse: unknown
|
|
172
|
+
) => {
|
|
173
|
+
currentRawResponse = rawResponse;
|
|
174
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
175
|
+
};
|
|
176
|
+
const updatedArgs = {
|
|
177
|
+
...args,
|
|
178
|
+
options: {
|
|
179
|
+
...args.options,
|
|
180
|
+
onResponse: callback
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
184
|
+
return {
|
|
185
|
+
flatResponse,
|
|
186
|
+
rawResponse: {
|
|
187
|
+
statusCode: currentRawResponse!.status,
|
|
188
|
+
body: currentRawResponse!.parsedBody,
|
|
189
|
+
headers: currentRawResponse!.headers.toJSON()
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const lro = new LroImpl(
|
|
195
|
+
sendOperation,
|
|
196
|
+
{ resourceGroupName, azureTrafficCollectorName, options },
|
|
197
|
+
deleteOperationSpec
|
|
198
|
+
);
|
|
199
|
+
const poller = new LroEngine(lro, {
|
|
200
|
+
resumeFrom: options?.resumeFrom,
|
|
201
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
202
|
+
lroResourceLocationConfig: "location"
|
|
203
|
+
});
|
|
204
|
+
await poller.poll();
|
|
205
|
+
return poller;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Deletes a specified Azure Traffic Collector resource.
|
|
210
|
+
* @param resourceGroupName The name of the resource group.
|
|
211
|
+
* @param azureTrafficCollectorName Azure Traffic Collector name
|
|
212
|
+
* @param options The options parameters.
|
|
213
|
+
*/
|
|
214
|
+
async beginDeleteAndWait(
|
|
215
|
+
resourceGroupName: string,
|
|
216
|
+
azureTrafficCollectorName: string,
|
|
217
|
+
options?: AzureTrafficCollectorsDeleteOptionalParams
|
|
218
|
+
): Promise<void> {
|
|
219
|
+
const poller = await this.beginDelete(
|
|
220
|
+
resourceGroupName,
|
|
221
|
+
azureTrafficCollectorName,
|
|
222
|
+
options
|
|
223
|
+
);
|
|
224
|
+
return poller.pollUntilDone();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Updates the specified Azure Traffic Collector tags.
|
|
229
|
+
* @param resourceGroupName The name of the resource group.
|
|
230
|
+
* @param azureTrafficCollectorName Azure Traffic Collector name
|
|
231
|
+
* @param parameters Parameters supplied to update Azure Traffic Collector tags.
|
|
232
|
+
* @param options The options parameters.
|
|
233
|
+
*/
|
|
234
|
+
updateTags(
|
|
235
|
+
resourceGroupName: string,
|
|
236
|
+
azureTrafficCollectorName: string,
|
|
237
|
+
parameters: TagsObject,
|
|
238
|
+
options?: AzureTrafficCollectorsUpdateTagsOptionalParams
|
|
239
|
+
): Promise<AzureTrafficCollectorsUpdateTagsResponse> {
|
|
240
|
+
return this.client.sendOperationRequest(
|
|
241
|
+
{ resourceGroupName, azureTrafficCollectorName, parameters, options },
|
|
242
|
+
updateTagsOperationSpec
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// Operation Specifications
|
|
247
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
248
|
+
|
|
249
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
250
|
+
path:
|
|
251
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}",
|
|
252
|
+
httpMethod: "GET",
|
|
253
|
+
responses: {
|
|
254
|
+
200: {
|
|
255
|
+
bodyMapper: Mappers.AzureTrafficCollector
|
|
256
|
+
},
|
|
257
|
+
default: {
|
|
258
|
+
bodyMapper: Mappers.CloudError
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
queryParameters: [Parameters.apiVersion],
|
|
262
|
+
urlParameters: [
|
|
263
|
+
Parameters.$host,
|
|
264
|
+
Parameters.subscriptionId,
|
|
265
|
+
Parameters.resourceGroupName,
|
|
266
|
+
Parameters.azureTrafficCollectorName
|
|
267
|
+
],
|
|
268
|
+
headerParameters: [Parameters.accept],
|
|
269
|
+
serializer
|
|
270
|
+
};
|
|
271
|
+
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|
272
|
+
path:
|
|
273
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}",
|
|
274
|
+
httpMethod: "PUT",
|
|
275
|
+
responses: {
|
|
276
|
+
200: {
|
|
277
|
+
bodyMapper: Mappers.AzureTrafficCollector
|
|
278
|
+
},
|
|
279
|
+
201: {
|
|
280
|
+
bodyMapper: Mappers.AzureTrafficCollector
|
|
281
|
+
},
|
|
282
|
+
202: {
|
|
283
|
+
bodyMapper: Mappers.AzureTrafficCollector
|
|
284
|
+
},
|
|
285
|
+
204: {
|
|
286
|
+
bodyMapper: Mappers.AzureTrafficCollector
|
|
287
|
+
},
|
|
288
|
+
default: {
|
|
289
|
+
bodyMapper: Mappers.CloudError
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
requestBody: {
|
|
293
|
+
parameterPath: {
|
|
294
|
+
location: ["options", "location"],
|
|
295
|
+
tags: ["options", "tags"],
|
|
296
|
+
collectorPolicies: ["options", "collectorPolicies"],
|
|
297
|
+
virtualHub: ["options", "virtualHub"]
|
|
298
|
+
},
|
|
299
|
+
mapper: { ...Mappers.AzureTrafficCollector, required: true }
|
|
300
|
+
},
|
|
301
|
+
queryParameters: [Parameters.apiVersion],
|
|
302
|
+
urlParameters: [
|
|
303
|
+
Parameters.$host,
|
|
304
|
+
Parameters.subscriptionId,
|
|
305
|
+
Parameters.resourceGroupName,
|
|
306
|
+
Parameters.azureTrafficCollectorName
|
|
307
|
+
],
|
|
308
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
309
|
+
mediaType: "json",
|
|
310
|
+
serializer
|
|
311
|
+
};
|
|
312
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
313
|
+
path:
|
|
314
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}",
|
|
315
|
+
httpMethod: "DELETE",
|
|
316
|
+
responses: {
|
|
317
|
+
200: {},
|
|
318
|
+
201: {},
|
|
319
|
+
202: {},
|
|
320
|
+
204: {},
|
|
321
|
+
default: {
|
|
322
|
+
bodyMapper: Mappers.CloudError
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
queryParameters: [Parameters.apiVersion],
|
|
326
|
+
urlParameters: [
|
|
327
|
+
Parameters.$host,
|
|
328
|
+
Parameters.subscriptionId,
|
|
329
|
+
Parameters.resourceGroupName,
|
|
330
|
+
Parameters.azureTrafficCollectorName
|
|
331
|
+
],
|
|
332
|
+
headerParameters: [Parameters.accept],
|
|
333
|
+
serializer
|
|
334
|
+
};
|
|
335
|
+
const updateTagsOperationSpec: coreClient.OperationSpec = {
|
|
336
|
+
path:
|
|
337
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors/{azureTrafficCollectorName}",
|
|
338
|
+
httpMethod: "PATCH",
|
|
339
|
+
responses: {
|
|
340
|
+
200: {
|
|
341
|
+
bodyMapper: Mappers.AzureTrafficCollector
|
|
342
|
+
},
|
|
343
|
+
default: {
|
|
344
|
+
bodyMapper: Mappers.CloudError
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
requestBody: Parameters.parameters1,
|
|
348
|
+
queryParameters: [Parameters.apiVersion],
|
|
349
|
+
urlParameters: [
|
|
350
|
+
Parameters.$host,
|
|
351
|
+
Parameters.subscriptionId,
|
|
352
|
+
Parameters.resourceGroupName,
|
|
353
|
+
Parameters.azureTrafficCollectorName
|
|
354
|
+
],
|
|
355
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
356
|
+
mediaType: "json",
|
|
357
|
+
serializer
|
|
358
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
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 { AzureTrafficCollectorsByResourceGroup } 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 { AzureTrafficCollectorClient } from "../azureTrafficCollectorClient";
|
|
15
|
+
import {
|
|
16
|
+
AzureTrafficCollector,
|
|
17
|
+
AzureTrafficCollectorsByResourceGroupListNextOptionalParams,
|
|
18
|
+
AzureTrafficCollectorsByResourceGroupListOptionalParams,
|
|
19
|
+
AzureTrafficCollectorsByResourceGroupListResponse,
|
|
20
|
+
AzureTrafficCollectorsByResourceGroupListNextResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing AzureTrafficCollectorsByResourceGroup operations. */
|
|
25
|
+
export class AzureTrafficCollectorsByResourceGroupImpl
|
|
26
|
+
implements AzureTrafficCollectorsByResourceGroup {
|
|
27
|
+
private readonly client: AzureTrafficCollectorClient;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Initialize a new instance of the class AzureTrafficCollectorsByResourceGroup class.
|
|
31
|
+
* @param client Reference to the service client
|
|
32
|
+
*/
|
|
33
|
+
constructor(client: AzureTrafficCollectorClient) {
|
|
34
|
+
this.client = client;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Return list of Azure Traffic Collectors in a Resource Group
|
|
39
|
+
* @param resourceGroupName The name of the resource group.
|
|
40
|
+
* @param options The options parameters.
|
|
41
|
+
*/
|
|
42
|
+
public list(
|
|
43
|
+
resourceGroupName: string,
|
|
44
|
+
options?: AzureTrafficCollectorsByResourceGroupListOptionalParams
|
|
45
|
+
): PagedAsyncIterableIterator<AzureTrafficCollector> {
|
|
46
|
+
const iter = this.listPagingAll(resourceGroupName, options);
|
|
47
|
+
return {
|
|
48
|
+
next() {
|
|
49
|
+
return iter.next();
|
|
50
|
+
},
|
|
51
|
+
[Symbol.asyncIterator]() {
|
|
52
|
+
return this;
|
|
53
|
+
},
|
|
54
|
+
byPage: () => {
|
|
55
|
+
return this.listPagingPage(resourceGroupName, options);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private async *listPagingPage(
|
|
61
|
+
resourceGroupName: string,
|
|
62
|
+
options?: AzureTrafficCollectorsByResourceGroupListOptionalParams
|
|
63
|
+
): AsyncIterableIterator<AzureTrafficCollector[]> {
|
|
64
|
+
let result = await this._list(resourceGroupName, options);
|
|
65
|
+
yield result.value || [];
|
|
66
|
+
let continuationToken = result.nextLink;
|
|
67
|
+
while (continuationToken) {
|
|
68
|
+
result = await this._listNext(
|
|
69
|
+
resourceGroupName,
|
|
70
|
+
continuationToken,
|
|
71
|
+
options
|
|
72
|
+
);
|
|
73
|
+
continuationToken = result.nextLink;
|
|
74
|
+
yield result.value || [];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private async *listPagingAll(
|
|
79
|
+
resourceGroupName: string,
|
|
80
|
+
options?: AzureTrafficCollectorsByResourceGroupListOptionalParams
|
|
81
|
+
): AsyncIterableIterator<AzureTrafficCollector> {
|
|
82
|
+
for await (const page of this.listPagingPage(resourceGroupName, options)) {
|
|
83
|
+
yield* page;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Return list of Azure Traffic Collectors in a Resource Group
|
|
89
|
+
* @param resourceGroupName The name of the resource group.
|
|
90
|
+
* @param options The options parameters.
|
|
91
|
+
*/
|
|
92
|
+
private _list(
|
|
93
|
+
resourceGroupName: string,
|
|
94
|
+
options?: AzureTrafficCollectorsByResourceGroupListOptionalParams
|
|
95
|
+
): Promise<AzureTrafficCollectorsByResourceGroupListResponse> {
|
|
96
|
+
return this.client.sendOperationRequest(
|
|
97
|
+
{ resourceGroupName, options },
|
|
98
|
+
listOperationSpec
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* ListNext
|
|
104
|
+
* @param resourceGroupName The name of the resource group.
|
|
105
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
106
|
+
* @param options The options parameters.
|
|
107
|
+
*/
|
|
108
|
+
private _listNext(
|
|
109
|
+
resourceGroupName: string,
|
|
110
|
+
nextLink: string,
|
|
111
|
+
options?: AzureTrafficCollectorsByResourceGroupListNextOptionalParams
|
|
112
|
+
): Promise<AzureTrafficCollectorsByResourceGroupListNextResponse> {
|
|
113
|
+
return this.client.sendOperationRequest(
|
|
114
|
+
{ resourceGroupName, nextLink, options },
|
|
115
|
+
listNextOperationSpec
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Operation Specifications
|
|
120
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
121
|
+
|
|
122
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
123
|
+
path:
|
|
124
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkFunction/azureTrafficCollectors",
|
|
125
|
+
httpMethod: "GET",
|
|
126
|
+
responses: {
|
|
127
|
+
200: {
|
|
128
|
+
bodyMapper: Mappers.AzureTrafficCollectorListResult
|
|
129
|
+
},
|
|
130
|
+
default: {
|
|
131
|
+
bodyMapper: Mappers.CloudError
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
queryParameters: [Parameters.apiVersion],
|
|
135
|
+
urlParameters: [
|
|
136
|
+
Parameters.$host,
|
|
137
|
+
Parameters.subscriptionId,
|
|
138
|
+
Parameters.resourceGroupName
|
|
139
|
+
],
|
|
140
|
+
headerParameters: [Parameters.accept],
|
|
141
|
+
serializer
|
|
142
|
+
};
|
|
143
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
144
|
+
path: "{nextLink}",
|
|
145
|
+
httpMethod: "GET",
|
|
146
|
+
responses: {
|
|
147
|
+
200: {
|
|
148
|
+
bodyMapper: Mappers.AzureTrafficCollectorListResult
|
|
149
|
+
},
|
|
150
|
+
default: {
|
|
151
|
+
bodyMapper: Mappers.CloudError
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
queryParameters: [Parameters.apiVersion],
|
|
155
|
+
urlParameters: [
|
|
156
|
+
Parameters.$host,
|
|
157
|
+
Parameters.subscriptionId,
|
|
158
|
+
Parameters.nextLink,
|
|
159
|
+
Parameters.resourceGroupName
|
|
160
|
+
],
|
|
161
|
+
headerParameters: [Parameters.accept],
|
|
162
|
+
serializer
|
|
163
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { AzureTrafficCollectorsBySubscription } 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 { AzureTrafficCollectorClient } from "../azureTrafficCollectorClient";
|
|
15
|
+
import {
|
|
16
|
+
AzureTrafficCollector,
|
|
17
|
+
AzureTrafficCollectorsBySubscriptionListNextOptionalParams,
|
|
18
|
+
AzureTrafficCollectorsBySubscriptionListOptionalParams,
|
|
19
|
+
AzureTrafficCollectorsBySubscriptionListResponse,
|
|
20
|
+
AzureTrafficCollectorsBySubscriptionListNextResponse
|
|
21
|
+
} from "../models";
|
|
22
|
+
|
|
23
|
+
/// <reference lib="esnext.asynciterable" />
|
|
24
|
+
/** Class containing AzureTrafficCollectorsBySubscription operations. */
|
|
25
|
+
export class AzureTrafficCollectorsBySubscriptionImpl
|
|
26
|
+
implements AzureTrafficCollectorsBySubscription {
|
|
27
|
+
private readonly client: AzureTrafficCollectorClient;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Initialize a new instance of the class AzureTrafficCollectorsBySubscription class.
|
|
31
|
+
* @param client Reference to the service client
|
|
32
|
+
*/
|
|
33
|
+
constructor(client: AzureTrafficCollectorClient) {
|
|
34
|
+
this.client = client;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Return list of Azure Traffic Collectors in a subscription
|
|
39
|
+
* @param options The options parameters.
|
|
40
|
+
*/
|
|
41
|
+
public list(
|
|
42
|
+
options?: AzureTrafficCollectorsBySubscriptionListOptionalParams
|
|
43
|
+
): PagedAsyncIterableIterator<AzureTrafficCollector> {
|
|
44
|
+
const iter = this.listPagingAll(options);
|
|
45
|
+
return {
|
|
46
|
+
next() {
|
|
47
|
+
return iter.next();
|
|
48
|
+
},
|
|
49
|
+
[Symbol.asyncIterator]() {
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
byPage: () => {
|
|
53
|
+
return this.listPagingPage(options);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
private async *listPagingPage(
|
|
59
|
+
options?: AzureTrafficCollectorsBySubscriptionListOptionalParams
|
|
60
|
+
): AsyncIterableIterator<AzureTrafficCollector[]> {
|
|
61
|
+
let result = await this._list(options);
|
|
62
|
+
yield result.value || [];
|
|
63
|
+
let continuationToken = result.nextLink;
|
|
64
|
+
while (continuationToken) {
|
|
65
|
+
result = await this._listNext(continuationToken, options);
|
|
66
|
+
continuationToken = result.nextLink;
|
|
67
|
+
yield result.value || [];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private async *listPagingAll(
|
|
72
|
+
options?: AzureTrafficCollectorsBySubscriptionListOptionalParams
|
|
73
|
+
): AsyncIterableIterator<AzureTrafficCollector> {
|
|
74
|
+
for await (const page of this.listPagingPage(options)) {
|
|
75
|
+
yield* page;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Return list of Azure Traffic Collectors in a subscription
|
|
81
|
+
* @param options The options parameters.
|
|
82
|
+
*/
|
|
83
|
+
private _list(
|
|
84
|
+
options?: AzureTrafficCollectorsBySubscriptionListOptionalParams
|
|
85
|
+
): Promise<AzureTrafficCollectorsBySubscriptionListResponse> {
|
|
86
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* ListNext
|
|
91
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
92
|
+
* @param options The options parameters.
|
|
93
|
+
*/
|
|
94
|
+
private _listNext(
|
|
95
|
+
nextLink: string,
|
|
96
|
+
options?: AzureTrafficCollectorsBySubscriptionListNextOptionalParams
|
|
97
|
+
): Promise<AzureTrafficCollectorsBySubscriptionListNextResponse> {
|
|
98
|
+
return this.client.sendOperationRequest(
|
|
99
|
+
{ nextLink, options },
|
|
100
|
+
listNextOperationSpec
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Operation Specifications
|
|
105
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
106
|
+
|
|
107
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
108
|
+
path:
|
|
109
|
+
"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkFunction/azureTrafficCollectors",
|
|
110
|
+
httpMethod: "GET",
|
|
111
|
+
responses: {
|
|
112
|
+
200: {
|
|
113
|
+
bodyMapper: Mappers.AzureTrafficCollectorListResult
|
|
114
|
+
},
|
|
115
|
+
default: {
|
|
116
|
+
bodyMapper: Mappers.CloudError
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
queryParameters: [Parameters.apiVersion],
|
|
120
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
121
|
+
headerParameters: [Parameters.accept],
|
|
122
|
+
serializer
|
|
123
|
+
};
|
|
124
|
+
const listNextOperationSpec: coreClient.OperationSpec = {
|
|
125
|
+
path: "{nextLink}",
|
|
126
|
+
httpMethod: "GET",
|
|
127
|
+
responses: {
|
|
128
|
+
200: {
|
|
129
|
+
bodyMapper: Mappers.AzureTrafficCollectorListResult
|
|
130
|
+
},
|
|
131
|
+
default: {
|
|
132
|
+
bodyMapper: Mappers.CloudError
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
queryParameters: [Parameters.apiVersion],
|
|
136
|
+
urlParameters: [
|
|
137
|
+
Parameters.$host,
|
|
138
|
+
Parameters.subscriptionId,
|
|
139
|
+
Parameters.nextLink
|
|
140
|
+
],
|
|
141
|
+
headerParameters: [Parameters.accept],
|
|
142
|
+
serializer
|
|
143
|
+
};
|