1 package storsimple
2
3
4
5
6
7
8
9 import (
10 "context"
11 "github.com/Azure/go-autorest/autorest"
12 "github.com/Azure/go-autorest/autorest/azure"
13 "github.com/Azure/go-autorest/autorest/validation"
14 "github.com/Azure/go-autorest/tracing"
15 "net/http"
16 )
17
18
19 type VolumesClient struct {
20 BaseClient
21 }
22
23
24 func NewVolumesClient(subscriptionID string) VolumesClient {
25 return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID)
26 }
27
28
29
30 func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient {
31 return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)}
32 }
33
34
35
36
37
38
39
40
41
42 func (client VolumesClient) CreateOrUpdate(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, parameters Volume, resourceGroupName string, managerName string) (result VolumesCreateOrUpdateFuture, err error) {
43 if tracing.IsEnabled() {
44 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate")
45 defer func() {
46 sc := -1
47 if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
48 sc = result.FutureAPI.Response().StatusCode
49 }
50 tracing.EndSpan(ctx, sc, err)
51 }()
52 }
53 if err := validation.Validate([]validation.Validation{
54 {TargetValue: parameters,
55 Constraints: []validation.Constraint{{Target: "parameters.VolumeProperties", Name: validation.Null, Rule: true,
56 Chain: []validation.Constraint{{Target: "parameters.VolumeProperties.SizeInBytes", Name: validation.Null, Rule: true, Chain: nil},
57 {Target: "parameters.VolumeProperties.AccessControlRecordIds", Name: validation.Null, Rule: true, Chain: nil},
58 }}}},
59 {TargetValue: managerName,
60 Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil},
61 {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil {
62 return result, validation.NewError("storsimple.VolumesClient", "CreateOrUpdate", err.Error())
63 }
64
65 req, err := client.CreateOrUpdatePreparer(ctx, deviceName, volumeContainerName, volumeName, parameters, resourceGroupName, managerName)
66 if err != nil {
67 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request")
68 return
69 }
70
71 result, err = client.CreateOrUpdateSender(req)
72 if err != nil {
73 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
74 return
75 }
76
77 return
78 }
79
80
81 func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, parameters Volume, resourceGroupName string, managerName string) (*http.Request, error) {
82 pathParameters := map[string]interface{}{
83 "deviceName": deviceName,
84 "managerName": managerName,
85 "resourceGroupName": resourceGroupName,
86 "subscriptionId": client.SubscriptionID,
87 "volumeContainerName": volumeContainerName,
88 "volumeName": volumeName,
89 }
90
91 const APIVersion = "2017-06-01"
92 queryParameters := map[string]interface{}{
93 "api-version": APIVersion,
94 }
95
96 preparer := autorest.CreatePreparer(
97 autorest.AsContentType("application/json; charset=utf-8"),
98 autorest.AsPut(),
99 autorest.WithBaseURL(client.BaseURI),
100 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", pathParameters),
101 autorest.WithJSON(parameters),
102 autorest.WithQueryParameters(queryParameters))
103 return preparer.Prepare((&http.Request{}).WithContext(ctx))
104 }
105
106
107
108 func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) {
109 var resp *http.Response
110 future.FutureAPI = &azure.Future{}
111 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
112 if err != nil {
113 return
114 }
115 var azf azure.Future
116 azf, err = azure.NewFutureFromResponse(resp)
117 future.FutureAPI = &azf
118 future.Result = future.result
119 return
120 }
121
122
123
124 func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) {
125 err = autorest.Respond(
126 resp,
127 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
128 autorest.ByUnmarshallingJSON(&result),
129 autorest.ByClosing())
130 result.Response = autorest.Response{Response: resp}
131 return
132 }
133
134
135
136
137
138
139
140
141 func (client VolumesClient) Delete(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string) (result VolumesDeleteFuture, err error) {
142 if tracing.IsEnabled() {
143 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete")
144 defer func() {
145 sc := -1
146 if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
147 sc = result.FutureAPI.Response().StatusCode
148 }
149 tracing.EndSpan(ctx, sc, err)
150 }()
151 }
152 if err := validation.Validate([]validation.Validation{
153 {TargetValue: managerName,
154 Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil},
155 {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil {
156 return result, validation.NewError("storsimple.VolumesClient", "Delete", err.Error())
157 }
158
159 req, err := client.DeletePreparer(ctx, deviceName, volumeContainerName, volumeName, resourceGroupName, managerName)
160 if err != nil {
161 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "Delete", nil, "Failure preparing request")
162 return
163 }
164
165 result, err = client.DeleteSender(req)
166 if err != nil {
167 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "Delete", result.Response(), "Failure sending request")
168 return
169 }
170
171 return
172 }
173
174
175 func (client VolumesClient) DeletePreparer(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string) (*http.Request, error) {
176 pathParameters := map[string]interface{}{
177 "deviceName": deviceName,
178 "managerName": managerName,
179 "resourceGroupName": resourceGroupName,
180 "subscriptionId": client.SubscriptionID,
181 "volumeContainerName": volumeContainerName,
182 "volumeName": volumeName,
183 }
184
185 const APIVersion = "2017-06-01"
186 queryParameters := map[string]interface{}{
187 "api-version": APIVersion,
188 }
189
190 preparer := autorest.CreatePreparer(
191 autorest.AsDelete(),
192 autorest.WithBaseURL(client.BaseURI),
193 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", pathParameters),
194 autorest.WithQueryParameters(queryParameters))
195 return preparer.Prepare((&http.Request{}).WithContext(ctx))
196 }
197
198
199
200 func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) {
201 var resp *http.Response
202 future.FutureAPI = &azure.Future{}
203 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
204 if err != nil {
205 return
206 }
207 var azf azure.Future
208 azf, err = azure.NewFutureFromResponse(resp)
209 future.FutureAPI = &azf
210 future.Result = future.result
211 return
212 }
213
214
215
216 func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
217 err = autorest.Respond(
218 resp,
219 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
220 autorest.ByClosing())
221 result.Response = resp
222 return
223 }
224
225
226
227
228
229
230
231
232 func (client VolumesClient) Get(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string) (result Volume, err error) {
233 if tracing.IsEnabled() {
234 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get")
235 defer func() {
236 sc := -1
237 if result.Response.Response != nil {
238 sc = result.Response.Response.StatusCode
239 }
240 tracing.EndSpan(ctx, sc, err)
241 }()
242 }
243 if err := validation.Validate([]validation.Validation{
244 {TargetValue: managerName,
245 Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil},
246 {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil {
247 return result, validation.NewError("storsimple.VolumesClient", "Get", err.Error())
248 }
249
250 req, err := client.GetPreparer(ctx, deviceName, volumeContainerName, volumeName, resourceGroupName, managerName)
251 if err != nil {
252 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "Get", nil, "Failure preparing request")
253 return
254 }
255
256 resp, err := client.GetSender(req)
257 if err != nil {
258 result.Response = autorest.Response{Response: resp}
259 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "Get", resp, "Failure sending request")
260 return
261 }
262
263 result, err = client.GetResponder(resp)
264 if err != nil {
265 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "Get", resp, "Failure responding to request")
266 return
267 }
268
269 return
270 }
271
272
273 func (client VolumesClient) GetPreparer(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string) (*http.Request, error) {
274 pathParameters := map[string]interface{}{
275 "deviceName": deviceName,
276 "managerName": managerName,
277 "resourceGroupName": resourceGroupName,
278 "subscriptionId": client.SubscriptionID,
279 "volumeContainerName": volumeContainerName,
280 "volumeName": volumeName,
281 }
282
283 const APIVersion = "2017-06-01"
284 queryParameters := map[string]interface{}{
285 "api-version": APIVersion,
286 }
287
288 preparer := autorest.CreatePreparer(
289 autorest.AsGet(),
290 autorest.WithBaseURL(client.BaseURI),
291 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}", pathParameters),
292 autorest.WithQueryParameters(queryParameters))
293 return preparer.Prepare((&http.Request{}).WithContext(ctx))
294 }
295
296
297
298 func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) {
299 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
300 }
301
302
303
304 func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) {
305 err = autorest.Respond(
306 resp,
307 azure.WithErrorUnlessStatusCode(http.StatusOK),
308 autorest.ByUnmarshallingJSON(&result),
309 autorest.ByClosing())
310 result.Response = autorest.Response{Response: resp}
311 return
312 }
313
314
315
316
317
318
319 func (client VolumesClient) ListByDevice(ctx context.Context, deviceName string, resourceGroupName string, managerName string) (result VolumeList, err error) {
320 if tracing.IsEnabled() {
321 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ListByDevice")
322 defer func() {
323 sc := -1
324 if result.Response.Response != nil {
325 sc = result.Response.Response.StatusCode
326 }
327 tracing.EndSpan(ctx, sc, err)
328 }()
329 }
330 if err := validation.Validate([]validation.Validation{
331 {TargetValue: managerName,
332 Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil},
333 {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil {
334 return result, validation.NewError("storsimple.VolumesClient", "ListByDevice", err.Error())
335 }
336
337 req, err := client.ListByDevicePreparer(ctx, deviceName, resourceGroupName, managerName)
338 if err != nil {
339 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListByDevice", nil, "Failure preparing request")
340 return
341 }
342
343 resp, err := client.ListByDeviceSender(req)
344 if err != nil {
345 result.Response = autorest.Response{Response: resp}
346 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListByDevice", resp, "Failure sending request")
347 return
348 }
349
350 result, err = client.ListByDeviceResponder(resp)
351 if err != nil {
352 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListByDevice", resp, "Failure responding to request")
353 return
354 }
355
356 return
357 }
358
359
360 func (client VolumesClient) ListByDevicePreparer(ctx context.Context, deviceName string, resourceGroupName string, managerName string) (*http.Request, error) {
361 pathParameters := map[string]interface{}{
362 "deviceName": deviceName,
363 "managerName": managerName,
364 "resourceGroupName": resourceGroupName,
365 "subscriptionId": client.SubscriptionID,
366 }
367
368 const APIVersion = "2017-06-01"
369 queryParameters := map[string]interface{}{
370 "api-version": APIVersion,
371 }
372
373 preparer := autorest.CreatePreparer(
374 autorest.AsGet(),
375 autorest.WithBaseURL(client.BaseURI),
376 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumes", pathParameters),
377 autorest.WithQueryParameters(queryParameters))
378 return preparer.Prepare((&http.Request{}).WithContext(ctx))
379 }
380
381
382
383 func (client VolumesClient) ListByDeviceSender(req *http.Request) (*http.Response, error) {
384 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
385 }
386
387
388
389 func (client VolumesClient) ListByDeviceResponder(resp *http.Response) (result VolumeList, err error) {
390 err = autorest.Respond(
391 resp,
392 azure.WithErrorUnlessStatusCode(http.StatusOK),
393 autorest.ByUnmarshallingJSON(&result),
394 autorest.ByClosing())
395 result.Response = autorest.Response{Response: resp}
396 return
397 }
398
399
400
401
402
403
404
405 func (client VolumesClient) ListByVolumeContainer(ctx context.Context, deviceName string, volumeContainerName string, resourceGroupName string, managerName string) (result VolumeList, err error) {
406 if tracing.IsEnabled() {
407 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ListByVolumeContainer")
408 defer func() {
409 sc := -1
410 if result.Response.Response != nil {
411 sc = result.Response.Response.StatusCode
412 }
413 tracing.EndSpan(ctx, sc, err)
414 }()
415 }
416 if err := validation.Validate([]validation.Validation{
417 {TargetValue: managerName,
418 Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil},
419 {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil {
420 return result, validation.NewError("storsimple.VolumesClient", "ListByVolumeContainer", err.Error())
421 }
422
423 req, err := client.ListByVolumeContainerPreparer(ctx, deviceName, volumeContainerName, resourceGroupName, managerName)
424 if err != nil {
425 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListByVolumeContainer", nil, "Failure preparing request")
426 return
427 }
428
429 resp, err := client.ListByVolumeContainerSender(req)
430 if err != nil {
431 result.Response = autorest.Response{Response: resp}
432 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListByVolumeContainer", resp, "Failure sending request")
433 return
434 }
435
436 result, err = client.ListByVolumeContainerResponder(resp)
437 if err != nil {
438 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListByVolumeContainer", resp, "Failure responding to request")
439 return
440 }
441
442 return
443 }
444
445
446 func (client VolumesClient) ListByVolumeContainerPreparer(ctx context.Context, deviceName string, volumeContainerName string, resourceGroupName string, managerName string) (*http.Request, error) {
447 pathParameters := map[string]interface{}{
448 "deviceName": deviceName,
449 "managerName": managerName,
450 "resourceGroupName": resourceGroupName,
451 "subscriptionId": client.SubscriptionID,
452 "volumeContainerName": volumeContainerName,
453 }
454
455 const APIVersion = "2017-06-01"
456 queryParameters := map[string]interface{}{
457 "api-version": APIVersion,
458 }
459
460 preparer := autorest.CreatePreparer(
461 autorest.AsGet(),
462 autorest.WithBaseURL(client.BaseURI),
463 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes", pathParameters),
464 autorest.WithQueryParameters(queryParameters))
465 return preparer.Prepare((&http.Request{}).WithContext(ctx))
466 }
467
468
469
470 func (client VolumesClient) ListByVolumeContainerSender(req *http.Request) (*http.Response, error) {
471 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
472 }
473
474
475
476 func (client VolumesClient) ListByVolumeContainerResponder(resp *http.Response) (result VolumeList, err error) {
477 err = autorest.Respond(
478 resp,
479 azure.WithErrorUnlessStatusCode(http.StatusOK),
480 autorest.ByUnmarshallingJSON(&result),
481 autorest.ByClosing())
482 result.Response = autorest.Response{Response: resp}
483 return
484 }
485
486
487
488
489
490
491
492
493 func (client VolumesClient) ListMetricDefinition(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string) (result MetricDefinitionList, err error) {
494 if tracing.IsEnabled() {
495 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ListMetricDefinition")
496 defer func() {
497 sc := -1
498 if result.Response.Response != nil {
499 sc = result.Response.Response.StatusCode
500 }
501 tracing.EndSpan(ctx, sc, err)
502 }()
503 }
504 if err := validation.Validate([]validation.Validation{
505 {TargetValue: managerName,
506 Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil},
507 {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil {
508 return result, validation.NewError("storsimple.VolumesClient", "ListMetricDefinition", err.Error())
509 }
510
511 req, err := client.ListMetricDefinitionPreparer(ctx, deviceName, volumeContainerName, volumeName, resourceGroupName, managerName)
512 if err != nil {
513 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListMetricDefinition", nil, "Failure preparing request")
514 return
515 }
516
517 resp, err := client.ListMetricDefinitionSender(req)
518 if err != nil {
519 result.Response = autorest.Response{Response: resp}
520 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListMetricDefinition", resp, "Failure sending request")
521 return
522 }
523
524 result, err = client.ListMetricDefinitionResponder(resp)
525 if err != nil {
526 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListMetricDefinition", resp, "Failure responding to request")
527 return
528 }
529
530 return
531 }
532
533
534 func (client VolumesClient) ListMetricDefinitionPreparer(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string) (*http.Request, error) {
535 pathParameters := map[string]interface{}{
536 "deviceName": deviceName,
537 "managerName": managerName,
538 "resourceGroupName": resourceGroupName,
539 "subscriptionId": client.SubscriptionID,
540 "volumeContainerName": volumeContainerName,
541 "volumeName": volumeName,
542 }
543
544 const APIVersion = "2017-06-01"
545 queryParameters := map[string]interface{}{
546 "api-version": APIVersion,
547 }
548
549 preparer := autorest.CreatePreparer(
550 autorest.AsGet(),
551 autorest.WithBaseURL(client.BaseURI),
552 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}/metricsDefinitions", pathParameters),
553 autorest.WithQueryParameters(queryParameters))
554 return preparer.Prepare((&http.Request{}).WithContext(ctx))
555 }
556
557
558
559 func (client VolumesClient) ListMetricDefinitionSender(req *http.Request) (*http.Response, error) {
560 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
561 }
562
563
564
565 func (client VolumesClient) ListMetricDefinitionResponder(resp *http.Response) (result MetricDefinitionList, err error) {
566 err = autorest.Respond(
567 resp,
568 azure.WithErrorUnlessStatusCode(http.StatusOK),
569 autorest.ByUnmarshallingJSON(&result),
570 autorest.ByClosing())
571 result.Response = autorest.Response{Response: resp}
572 return
573 }
574
575
576
577
578
579
580
581
582
583 func (client VolumesClient) ListMetrics(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string, filter string) (result MetricList, err error) {
584 if tracing.IsEnabled() {
585 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ListMetrics")
586 defer func() {
587 sc := -1
588 if result.Response.Response != nil {
589 sc = result.Response.Response.StatusCode
590 }
591 tracing.EndSpan(ctx, sc, err)
592 }()
593 }
594 if err := validation.Validate([]validation.Validation{
595 {TargetValue: managerName,
596 Constraints: []validation.Constraint{{Target: "managerName", Name: validation.MaxLength, Rule: 50, Chain: nil},
597 {Target: "managerName", Name: validation.MinLength, Rule: 2, Chain: nil}}}}); err != nil {
598 return result, validation.NewError("storsimple.VolumesClient", "ListMetrics", err.Error())
599 }
600
601 req, err := client.ListMetricsPreparer(ctx, deviceName, volumeContainerName, volumeName, resourceGroupName, managerName, filter)
602 if err != nil {
603 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListMetrics", nil, "Failure preparing request")
604 return
605 }
606
607 resp, err := client.ListMetricsSender(req)
608 if err != nil {
609 result.Response = autorest.Response{Response: resp}
610 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListMetrics", resp, "Failure sending request")
611 return
612 }
613
614 result, err = client.ListMetricsResponder(resp)
615 if err != nil {
616 err = autorest.NewErrorWithError(err, "storsimple.VolumesClient", "ListMetrics", resp, "Failure responding to request")
617 return
618 }
619
620 return
621 }
622
623
624 func (client VolumesClient) ListMetricsPreparer(ctx context.Context, deviceName string, volumeContainerName string, volumeName string, resourceGroupName string, managerName string, filter string) (*http.Request, error) {
625 pathParameters := map[string]interface{}{
626 "deviceName": deviceName,
627 "managerName": managerName,
628 "resourceGroupName": resourceGroupName,
629 "subscriptionId": client.SubscriptionID,
630 "volumeContainerName": volumeContainerName,
631 "volumeName": volumeName,
632 }
633
634 const APIVersion = "2017-06-01"
635 queryParameters := map[string]interface{}{
636 "$filter": autorest.Encode("query", filter),
637 "api-version": APIVersion,
638 }
639
640 preparer := autorest.CreatePreparer(
641 autorest.AsGet(),
642 autorest.WithBaseURL(client.BaseURI),
643 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/volumeContainers/{volumeContainerName}/volumes/{volumeName}/metrics", pathParameters),
644 autorest.WithQueryParameters(queryParameters))
645 return preparer.Prepare((&http.Request{}).WithContext(ctx))
646 }
647
648
649
650 func (client VolumesClient) ListMetricsSender(req *http.Request) (*http.Response, error) {
651 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
652 }
653
654
655
656 func (client VolumesClient) ListMetricsResponder(resp *http.Response) (result MetricList, err error) {
657 err = autorest.Respond(
658 resp,
659 azure.WithErrorUnlessStatusCode(http.StatusOK),
660 autorest.ByUnmarshallingJSON(&result),
661 autorest.ByClosing())
662 result.Response = autorest.Response{Response: resp}
663 return
664 }
665
View as plain text