-
Notifications
You must be signed in to change notification settings - Fork 12
/
listOperations.go
352 lines (349 loc) · 14.4 KB
/
listOperations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
package armkeyvault_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-02-01/examples/listOperations.json
func ExampleOperationsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armkeyvault.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.OperationListResult = armkeyvault.OperationListResult{
// Value: []*armkeyvault.Operation{
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("View the properties of a key vault"),
// Operation: to.Ptr("View Key Vault"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/write"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Create a new key vault or update the properties of an existing key vault"),
// Operation: to.Ptr("Update Key Vault"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/delete"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Delete a key vault"),
// Operation: to.Ptr("Delete Key Vault"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/deploy/action"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Enables access to secrets in a key vault when deploying Azure resources"),
// Operation: to.Ptr("Use Vault for Azure Deployments"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/secrets/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("View the properties of a secret, but not its value"),
// Operation: to.Ptr("View Secret Properties"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Secret"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/secrets/write"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Create a new secret or update the value of an existing secret"),
// Operation: to.Ptr("Update Secret"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Secret"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/accessPolicies/write"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Update an existing access policy by merging or replacing, or add a new access policy to a vault."),
// Operation: to.Ptr("Update Access Policy"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Access Policy"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/logDefinitions/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Gets the available logs for a key vault"),
// Operation: to.Ptr("Read log definition"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault Log Definition"),
// },
// IsDataAction: to.Ptr(false),
// Origin: to.Ptr("system"),
// OperationProperties: &armkeyvault.OperationProperties{
// ServiceSpecification: &armkeyvault.ServiceSpecification{
// LogSpecifications: []*armkeyvault.LogSpecification{
// {
// Name: to.Ptr("AuditEvent"),
// BlobDuration: to.Ptr("PT1H"),
// DisplayName: to.Ptr("Audit Logs"),
// }},
// MetricSpecifications: []*armkeyvault.MetricSpecification{
// {
// Name: to.Ptr("ServiceApiHit"),
// AggregationType: to.Ptr(""),
// Dimensions: []*armkeyvault.DimensionProperties{
// {
// Name: to.Ptr("ActivityType"),
// DisplayName: to.Ptr(""),
// ToBeExportedForShoebox: to.Ptr(true),
// },
// {
// Name: to.Ptr("ActivityName"),
// DisplayName: to.Ptr(""),
// ToBeExportedForShoebox: to.Ptr(true),
// }},
// DisplayDescription: to.Ptr(""),
// DisplayName: to.Ptr(""),
// FillGapWithZero: to.Ptr(false),
// InternalMetricName: to.Ptr("AuditEvent"),
// LockAggregationType: to.Ptr(""),
// SupportedAggregationTypes: []*string{
// to.Ptr("")},
// SupportedTimeGrainTypes: []*string{
// to.Ptr("")},
// Unit: to.Ptr(""),
// }},
// },
// },
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/diagnosticSettings/Read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Gets the diagnostic setting for the resource"),
// Operation: to.Ptr("Read diagnostic setting"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault Diagnostic Settings"),
// },
// IsDataAction: to.Ptr(false),
// Origin: to.Ptr("system"),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/diagnosticSettings/Write"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Creates or updates the diagnostic setting for the resource"),
// Operation: to.Ptr("Write diagnostic setting"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault Diagnostic Settings"),
// },
// IsDataAction: to.Ptr(false),
// Origin: to.Ptr("system"),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/register/action"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Registers a subscription"),
// Operation: to.Ptr("Register Subscription"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Subscription"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/unregister/action"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Unregisters a subscription"),
// Operation: to.Ptr("Unregister Subscription"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Subscription"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/operations/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Lists operations available on Microsoft.KeyVault resource provider"),
// Operation: to.Ptr("Available Key Vault Operations"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Operations"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/checkNameAvailability/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Checks that a key vault name is valid and is not in use"),
// Operation: to.Ptr("Check Name Availability"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Name Availability"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/deletedVaults/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("View the properties of soft deleted key vaults"),
// Operation: to.Ptr("View Soft Deleted Vaults"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Soft Deleted Key Vault"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/locations/deletedVaults/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("View the properties of a soft deleted key vault"),
// Operation: to.Ptr("View Soft Deleted Key Vault"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Soft Deleted Key Vault"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/locations/deletedVaults/purge/action"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Purge a soft deleted key vault"),
// Operation: to.Ptr("Purge Soft Deleted Key Vault"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Soft Deleted Key Vault"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/locations/operationResults/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Check the result of a long run operation"),
// Operation: to.Ptr("Check Operation Result"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Long Run Operation Result"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/hsmPools/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("View the properties of an HSM pool"),
// Operation: to.Ptr("View HSM pool"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("HSM pool"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/hsmPools/write"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Create a new HSM pool of update the properties of an existing HSM pool"),
// Operation: to.Ptr("Create or Update HSM pool"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("HSM pool"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/hsmPools/delete"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Delete an HSM pool"),
// Operation: to.Ptr("Delete HSM pool"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("HSM pool"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/hsmPools/joinVault/action"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Join a key vault to an HSM pool"),
// Operation: to.Ptr("Join KeyVault to HSM pool"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("HSM pool"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/managedHSMs/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("View the properties of a Managed HSM"),
// Operation: to.Ptr("View Managed HSM"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Managed HSM"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/managedHSMs/write"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Create a new Managed HSM of update the properties of an existing Managed HSM"),
// Operation: to.Ptr("Create or Update Managed HSM"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Managed HSM"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/managedHSMs/delete"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Delete a Managed HSM"),
// Operation: to.Ptr("Delete Managed HSM"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Managed HSM"),
// },
// IsDataAction: to.Ptr(false),
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/vaults/providers/Microsoft.Insights/metricDefinitions/read"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Gets the available metrics for a key vault"),
// Operation: to.Ptr("Read metric definition"),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Key Vault Metric Definition"),
// },
// IsDataAction: to.Ptr(false),
// Origin: to.Ptr("system"),
// OperationProperties: &armkeyvault.OperationProperties{
// ServiceSpecification: &armkeyvault.ServiceSpecification{
// },
// },
// },
// {
// Name: to.Ptr("Microsoft.KeyVault/locations/deleteVirtualNetworkOrSubnets/action"),
// Display: &armkeyvault.OperationDisplay{
// Description: to.Ptr("Notifies Microsoft.KeyVault that a virtual network or subnet is being deleted"),
// Operation: to.Ptr("Modify Network ACLs containing the deleted Vitual Network or Subnet "),
// Provider: to.Ptr("Microsoft Key Vault"),
// Resource: to.Ptr("Location"),
// },
// IsDataAction: to.Ptr(false),
// Origin: to.Ptr("system"),
// }},
// }
}
}