~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package network
 
2
 
 
3
// Copyright (c) Microsoft and contributors.  All rights reserved.
 
4
//
 
5
// Licensed under the Apache License, Version 2.0 (the "License");
 
6
// you may not use this file except in compliance with the License.
 
7
// You may obtain a copy of the License at
 
8
// http://www.apache.org/licenses/LICENSE-2.0
 
9
//
 
10
// Unless required by applicable law or agreed to in writing, software
 
11
// distributed under the License is distributed on an "AS IS" BASIS,
 
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
//
 
14
// See the License for the specific language governing permissions and
 
15
// limitations under the License.
 
16
//
 
17
// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
 
18
// Changes may cause incorrect behavior and will be lost if the code is
 
19
// regenerated.
 
20
 
 
21
import (
 
22
        "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
 
23
        "net/http"
 
24
        "net/url"
 
25
)
 
26
 
 
27
// InterfacesClient is the the Windows Azure Network management API provides a
 
28
// RESTful set of web services that interact with Windows Azure Networks
 
29
// service to manage your network resrources. The API has entities that
 
30
// capture the relationship between an end user and the Windows Azure
 
31
// Networks service.
 
32
type InterfacesClient struct {
 
33
        ManagementClient
 
34
}
 
35
 
 
36
// NewInterfacesClient creates an instance of the InterfacesClient client.
 
37
func NewInterfacesClient(subscriptionID string) InterfacesClient {
 
38
        return NewInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
 
39
}
 
40
 
 
41
// NewInterfacesClientWithBaseURI creates an instance of the InterfacesClient
 
42
// client.
 
43
func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient {
 
44
        return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)}
 
45
}
 
46
 
 
47
// CreateOrUpdate the Put NetworkInterface operation creates/updates a
 
48
// networkInterface
 
49
//
 
50
// resourceGroupName is the name of the resource group. networkInterfaceName
 
51
// is the name of the network interface. parameters is parameters supplied to
 
52
// the create/update NetworkInterface operation
 
53
func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkInterfaceName string, parameters Interface) (result Interface, ae error) {
 
54
        req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkInterfaceName, parameters)
 
55
        if err != nil {
 
56
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "CreateOrUpdate", "Failure preparing request")
 
57
        }
 
58
 
 
59
        resp, err := client.CreateOrUpdateSender(req)
 
60
        if err != nil {
 
61
                result.Response = autorest.Response{Response: resp}
 
62
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "CreateOrUpdate", "Failure sending request")
 
63
        }
 
64
 
 
65
        result, err = client.CreateOrUpdateResponder(resp)
 
66
        if err != nil {
 
67
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "CreateOrUpdate", "Failure responding to request")
 
68
        }
 
69
 
 
70
        return
 
71
}
 
72
 
 
73
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
 
74
func (client InterfacesClient) CreateOrUpdatePreparer(resourceGroupName string, networkInterfaceName string, parameters Interface) (*http.Request, error) {
 
75
        pathParameters := map[string]interface{}{
 
76
                "networkInterfaceName": url.QueryEscape(networkInterfaceName),
 
77
                "resourceGroupName":    url.QueryEscape(resourceGroupName),
 
78
                "subscriptionId":       url.QueryEscape(client.SubscriptionID),
 
79
        }
 
80
 
 
81
        queryParameters := map[string]interface{}{
 
82
                "api-version": APIVersion,
 
83
        }
 
84
 
 
85
        return autorest.Prepare(&http.Request{},
 
86
                autorest.AsJSON(),
 
87
                autorest.AsPut(),
 
88
                autorest.WithBaseURL(client.BaseURI),
 
89
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
 
90
                autorest.WithJSON(parameters),
 
91
                autorest.WithPathParameters(pathParameters),
 
92
                autorest.WithQueryParameters(queryParameters))
 
93
}
 
94
 
 
95
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
 
96
// http.Response Body if it receives an error.
 
97
func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
 
98
        return client.Send(req, http.StatusCreated, http.StatusOK)
 
99
}
 
100
 
 
101
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
 
102
// closes the http.Response Body.
 
103
func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (result Interface, err error) {
 
104
        err = autorest.Respond(
 
105
                resp,
 
106
                client.ByInspecting(),
 
107
                autorest.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
 
108
                autorest.ByUnmarshallingJSON(&result),
 
109
                autorest.ByClosing())
 
110
        result.Response = autorest.Response{Response: resp}
 
111
        return
 
112
}
 
113
 
 
114
// Delete the delete netwokInterface operation deletes the specified
 
115
// netwokInterface.
 
116
//
 
117
// resourceGroupName is the name of the resource group. networkInterfaceName
 
118
// is the name of the network interface.
 
119
func (client InterfacesClient) Delete(resourceGroupName string, networkInterfaceName string) (result autorest.Response, ae error) {
 
120
        req, err := client.DeletePreparer(resourceGroupName, networkInterfaceName)
 
121
        if err != nil {
 
122
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Delete", "Failure preparing request")
 
123
        }
 
124
 
 
125
        resp, err := client.DeleteSender(req)
 
126
        if err != nil {
 
127
                result.Response = resp
 
128
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Delete", "Failure sending request")
 
129
        }
 
130
 
 
131
        result, err = client.DeleteResponder(resp)
 
132
        if err != nil {
 
133
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "Delete", "Failure responding to request")
 
134
        }
 
135
 
 
136
        return
 
137
}
 
138
 
 
139
// DeletePreparer prepares the Delete request.
 
140
func (client InterfacesClient) DeletePreparer(resourceGroupName string, networkInterfaceName string) (*http.Request, error) {
 
141
        pathParameters := map[string]interface{}{
 
142
                "networkInterfaceName": url.QueryEscape(networkInterfaceName),
 
143
                "resourceGroupName":    url.QueryEscape(resourceGroupName),
 
144
                "subscriptionId":       url.QueryEscape(client.SubscriptionID),
 
145
        }
 
146
 
 
147
        queryParameters := map[string]interface{}{
 
148
                "api-version": APIVersion,
 
149
        }
 
150
 
 
151
        return autorest.Prepare(&http.Request{},
 
152
                autorest.AsJSON(),
 
153
                autorest.AsDelete(),
 
154
                autorest.WithBaseURL(client.BaseURI),
 
155
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
 
156
                autorest.WithPathParameters(pathParameters),
 
157
                autorest.WithQueryParameters(queryParameters))
 
158
}
 
159
 
 
160
// DeleteSender sends the Delete request. The method will close the
 
161
// http.Response Body if it receives an error.
 
162
func (client InterfacesClient) DeleteSender(req *http.Request) (*http.Response, error) {
 
163
        return client.Send(req, http.StatusNoContent, http.StatusAccepted, http.StatusOK)
 
164
}
 
165
 
 
166
// DeleteResponder handles the response to the Delete request. The method always
 
167
// closes the http.Response Body.
 
168
func (client InterfacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
 
169
        err = autorest.Respond(
 
170
                resp,
 
171
                client.ByInspecting(),
 
172
                autorest.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK),
 
173
                autorest.ByClosing())
 
174
        result.Response = resp
 
175
        return
 
176
}
 
177
 
 
178
// Get the Get ntework interface operation retreives information about the
 
179
// specified network interface.
 
180
//
 
181
// resourceGroupName is the name of the resource group. networkInterfaceName
 
182
// is the name of the network interface.
 
183
func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceName string) (result Interface, ae error) {
 
184
        req, err := client.GetPreparer(resourceGroupName, networkInterfaceName)
 
185
        if err != nil {
 
186
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Get", "Failure preparing request")
 
187
        }
 
188
 
 
189
        resp, err := client.GetSender(req)
 
190
        if err != nil {
 
191
                result.Response = autorest.Response{Response: resp}
 
192
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "Get", "Failure sending request")
 
193
        }
 
194
 
 
195
        result, err = client.GetResponder(resp)
 
196
        if err != nil {
 
197
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "Get", "Failure responding to request")
 
198
        }
 
199
 
 
200
        return
 
201
}
 
202
 
 
203
// GetPreparer prepares the Get request.
 
204
func (client InterfacesClient) GetPreparer(resourceGroupName string, networkInterfaceName string) (*http.Request, error) {
 
205
        pathParameters := map[string]interface{}{
 
206
                "networkInterfaceName": url.QueryEscape(networkInterfaceName),
 
207
                "resourceGroupName":    url.QueryEscape(resourceGroupName),
 
208
                "subscriptionId":       url.QueryEscape(client.SubscriptionID),
 
209
        }
 
210
 
 
211
        queryParameters := map[string]interface{}{
 
212
                "api-version": APIVersion,
 
213
        }
 
214
 
 
215
        return autorest.Prepare(&http.Request{},
 
216
                autorest.AsJSON(),
 
217
                autorest.AsGet(),
 
218
                autorest.WithBaseURL(client.BaseURI),
 
219
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
 
220
                autorest.WithPathParameters(pathParameters),
 
221
                autorest.WithQueryParameters(queryParameters))
 
222
}
 
223
 
 
224
// GetSender sends the Get request. The method will close the
 
225
// http.Response Body if it receives an error.
 
226
func (client InterfacesClient) GetSender(req *http.Request) (*http.Response, error) {
 
227
        return client.Send(req, http.StatusOK)
 
228
}
 
229
 
 
230
// GetResponder handles the response to the Get request. The method always
 
231
// closes the http.Response Body.
 
232
func (client InterfacesClient) GetResponder(resp *http.Response) (result Interface, err error) {
 
233
        err = autorest.Respond(
 
234
                resp,
 
235
                client.ByInspecting(),
 
236
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
237
                autorest.ByUnmarshallingJSON(&result),
 
238
                autorest.ByClosing())
 
239
        result.Response = autorest.Response{Response: resp}
 
240
        return
 
241
}
 
242
 
 
243
// GetVirtualMachineScaleSetNetworkInterface the Get ntework interface
 
244
// operation retreives information about the specified network interface in a
 
245
// virtual machine scale set.
 
246
//
 
247
// resourceGroupName is the name of the resource group.
 
248
// virtualMachineScaleSetName is the name of the virtual machine scale set.
 
249
// virtualmachineIndex is the virtual machine index. networkInterfaceName is
 
250
// the name of the network interface.
 
251
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string) (result Interface, ae error) {
 
252
        req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName)
 
253
        if err != nil {
 
254
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", "Failure preparing request")
 
255
        }
 
256
 
 
257
        resp, err := client.GetVirtualMachineScaleSetNetworkInterfaceSender(req)
 
258
        if err != nil {
 
259
                result.Response = autorest.Response{Response: resp}
 
260
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", "Failure sending request")
 
261
        }
 
262
 
 
263
        result, err = client.GetVirtualMachineScaleSetNetworkInterfaceResponder(resp)
 
264
        if err != nil {
 
265
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", "Failure responding to request")
 
266
        }
 
267
 
 
268
        return
 
269
}
 
270
 
 
271
// GetVirtualMachineScaleSetNetworkInterfacePreparer prepares the GetVirtualMachineScaleSetNetworkInterface request.
 
272
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string) (*http.Request, error) {
 
273
        pathParameters := map[string]interface{}{
 
274
                "networkInterfaceName":       url.QueryEscape(networkInterfaceName),
 
275
                "resourceGroupName":          url.QueryEscape(resourceGroupName),
 
276
                "subscriptionId":             url.QueryEscape(client.SubscriptionID),
 
277
                "virtualmachineIndex":        url.QueryEscape(virtualmachineIndex),
 
278
                "virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
 
279
        }
 
280
 
 
281
        queryParameters := map[string]interface{}{
 
282
                "api-version": APIVersion,
 
283
        }
 
284
 
 
285
        return autorest.Prepare(&http.Request{},
 
286
                autorest.AsJSON(),
 
287
                autorest.AsGet(),
 
288
                autorest.WithBaseURL(client.BaseURI),
 
289
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}"),
 
290
                autorest.WithPathParameters(pathParameters),
 
291
                autorest.WithQueryParameters(queryParameters))
 
292
}
 
293
 
 
294
// GetVirtualMachineScaleSetNetworkInterfaceSender sends the GetVirtualMachineScaleSetNetworkInterface request. The method will close the
 
295
// http.Response Body if it receives an error.
 
296
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceSender(req *http.Request) (*http.Response, error) {
 
297
        return client.Send(req, http.StatusOK)
 
298
}
 
299
 
 
300
// GetVirtualMachineScaleSetNetworkInterfaceResponder handles the response to the GetVirtualMachineScaleSetNetworkInterface request. The method always
 
301
// closes the http.Response Body.
 
302
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponder(resp *http.Response) (result Interface, err error) {
 
303
        err = autorest.Respond(
 
304
                resp,
 
305
                client.ByInspecting(),
 
306
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
307
                autorest.ByUnmarshallingJSON(&result),
 
308
                autorest.ByClosing())
 
309
        result.Response = autorest.Response{Response: resp}
 
310
        return
 
311
}
 
312
 
 
313
// List the List networkInterfaces opertion retrieves all the
 
314
// networkInterfaces in a resource group.
 
315
//
 
316
// resourceGroupName is the name of the resource group.
 
317
func (client InterfacesClient) List(resourceGroupName string) (result InterfaceListResult, ae error) {
 
318
        req, err := client.ListPreparer(resourceGroupName)
 
319
        if err != nil {
 
320
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure preparing request")
 
321
        }
 
322
 
 
323
        resp, err := client.ListSender(req)
 
324
        if err != nil {
 
325
                result.Response = autorest.Response{Response: resp}
 
326
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure sending request")
 
327
        }
 
328
 
 
329
        result, err = client.ListResponder(resp)
 
330
        if err != nil {
 
331
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure responding to request")
 
332
        }
 
333
 
 
334
        return
 
335
}
 
336
 
 
337
// ListPreparer prepares the List request.
 
338
func (client InterfacesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
 
339
        pathParameters := map[string]interface{}{
 
340
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
341
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
342
        }
 
343
 
 
344
        queryParameters := map[string]interface{}{
 
345
                "api-version": APIVersion,
 
346
        }
 
347
 
 
348
        return autorest.Prepare(&http.Request{},
 
349
                autorest.AsJSON(),
 
350
                autorest.AsGet(),
 
351
                autorest.WithBaseURL(client.BaseURI),
 
352
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces"),
 
353
                autorest.WithPathParameters(pathParameters),
 
354
                autorest.WithQueryParameters(queryParameters))
 
355
}
 
356
 
 
357
// ListSender sends the List request. The method will close the
 
358
// http.Response Body if it receives an error.
 
359
func (client InterfacesClient) ListSender(req *http.Request) (*http.Response, error) {
 
360
        return client.Send(req, http.StatusOK)
 
361
}
 
362
 
 
363
// ListResponder handles the response to the List request. The method always
 
364
// closes the http.Response Body.
 
365
func (client InterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) {
 
366
        err = autorest.Respond(
 
367
                resp,
 
368
                client.ByInspecting(),
 
369
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
370
                autorest.ByUnmarshallingJSON(&result),
 
371
                autorest.ByClosing())
 
372
        result.Response = autorest.Response{Response: resp}
 
373
        return
 
374
}
 
375
 
 
376
// ListNextResults retrieves the next set of results, if any.
 
377
func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
 
378
        req, err := lastResults.InterfaceListResultPreparer()
 
379
        if err != nil {
 
380
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure preparing next results request request")
 
381
        }
 
382
        if req == nil {
 
383
                return
 
384
        }
 
385
 
 
386
        resp, err := client.ListSender(req)
 
387
        if err != nil {
 
388
                result.Response = autorest.Response{Response: resp}
 
389
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure sending next results request request")
 
390
        }
 
391
 
 
392
        result, err = client.ListResponder(resp)
 
393
        if err != nil {
 
394
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "List", "Failure responding to next results request request")
 
395
        }
 
396
 
 
397
        return
 
398
}
 
399
 
 
400
// ListAll the List networkInterfaces opertion retrieves all the
 
401
// networkInterfaces in a subscription.
 
402
func (client InterfacesClient) ListAll() (result InterfaceListResult, ae error) {
 
403
        req, err := client.ListAllPreparer()
 
404
        if err != nil {
 
405
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure preparing request")
 
406
        }
 
407
 
 
408
        resp, err := client.ListAllSender(req)
 
409
        if err != nil {
 
410
                result.Response = autorest.Response{Response: resp}
 
411
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure sending request")
 
412
        }
 
413
 
 
414
        result, err = client.ListAllResponder(resp)
 
415
        if err != nil {
 
416
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure responding to request")
 
417
        }
 
418
 
 
419
        return
 
420
}
 
421
 
 
422
// ListAllPreparer prepares the ListAll request.
 
423
func (client InterfacesClient) ListAllPreparer() (*http.Request, error) {
 
424
        pathParameters := map[string]interface{}{
 
425
                "subscriptionId": url.QueryEscape(client.SubscriptionID),
 
426
        }
 
427
 
 
428
        queryParameters := map[string]interface{}{
 
429
                "api-version": APIVersion,
 
430
        }
 
431
 
 
432
        return autorest.Prepare(&http.Request{},
 
433
                autorest.AsJSON(),
 
434
                autorest.AsGet(),
 
435
                autorest.WithBaseURL(client.BaseURI),
 
436
                autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces"),
 
437
                autorest.WithPathParameters(pathParameters),
 
438
                autorest.WithQueryParameters(queryParameters))
 
439
}
 
440
 
 
441
// ListAllSender sends the ListAll request. The method will close the
 
442
// http.Response Body if it receives an error.
 
443
func (client InterfacesClient) ListAllSender(req *http.Request) (*http.Response, error) {
 
444
        return client.Send(req, http.StatusOK)
 
445
}
 
446
 
 
447
// ListAllResponder handles the response to the ListAll request. The method always
 
448
// closes the http.Response Body.
 
449
func (client InterfacesClient) ListAllResponder(resp *http.Response) (result InterfaceListResult, err error) {
 
450
        err = autorest.Respond(
 
451
                resp,
 
452
                client.ByInspecting(),
 
453
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
454
                autorest.ByUnmarshallingJSON(&result),
 
455
                autorest.ByClosing())
 
456
        result.Response = autorest.Response{Response: resp}
 
457
        return
 
458
}
 
459
 
 
460
// ListAllNextResults retrieves the next set of results, if any.
 
461
func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
 
462
        req, err := lastResults.InterfaceListResultPreparer()
 
463
        if err != nil {
 
464
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure preparing next results request request")
 
465
        }
 
466
        if req == nil {
 
467
                return
 
468
        }
 
469
 
 
470
        resp, err := client.ListAllSender(req)
 
471
        if err != nil {
 
472
                result.Response = autorest.Response{Response: resp}
 
473
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure sending next results request request")
 
474
        }
 
475
 
 
476
        result, err = client.ListAllResponder(resp)
 
477
        if err != nil {
 
478
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListAll", "Failure responding to next results request request")
 
479
        }
 
480
 
 
481
        return
 
482
}
 
483
 
 
484
// ListVirtualMachineScaleSetNetworkInterfaces the list network interface
 
485
// operation retrieves information about all network interfaces in a virtual
 
486
// machine scale set.
 
487
//
 
488
// resourceGroupName is the name of the resource group.
 
489
// virtualMachineScaleSetName is the name of the virtual machine scale set.
 
490
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResult, ae error) {
 
491
        req, err := client.ListVirtualMachineScaleSetNetworkInterfacesPreparer(resourceGroupName, virtualMachineScaleSetName)
 
492
        if err != nil {
 
493
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure preparing request")
 
494
        }
 
495
 
 
496
        resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req)
 
497
        if err != nil {
 
498
                result.Response = autorest.Response{Response: resp}
 
499
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure sending request")
 
500
        }
 
501
 
 
502
        result, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp)
 
503
        if err != nil {
 
504
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure responding to request")
 
505
        }
 
506
 
 
507
        return
 
508
}
 
509
 
 
510
// ListVirtualMachineScaleSetNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetNetworkInterfaces request.
 
511
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPreparer(resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) {
 
512
        pathParameters := map[string]interface{}{
 
513
                "resourceGroupName":          url.QueryEscape(resourceGroupName),
 
514
                "subscriptionId":             url.QueryEscape(client.SubscriptionID),
 
515
                "virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
 
516
        }
 
517
 
 
518
        queryParameters := map[string]interface{}{
 
519
                "api-version": APIVersion,
 
520
        }
 
521
 
 
522
        return autorest.Prepare(&http.Request{},
 
523
                autorest.AsJSON(),
 
524
                autorest.AsGet(),
 
525
                autorest.WithBaseURL(client.BaseURI),
 
526
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces"),
 
527
                autorest.WithPathParameters(pathParameters),
 
528
                autorest.WithQueryParameters(queryParameters))
 
529
}
 
530
 
 
531
// ListVirtualMachineScaleSetNetworkInterfacesSender sends the ListVirtualMachineScaleSetNetworkInterfaces request. The method will close the
 
532
// http.Response Body if it receives an error.
 
533
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesSender(req *http.Request) (*http.Response, error) {
 
534
        return client.Send(req, http.StatusOK)
 
535
}
 
536
 
 
537
// ListVirtualMachineScaleSetNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetNetworkInterfaces request. The method always
 
538
// closes the http.Response Body.
 
539
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) {
 
540
        err = autorest.Respond(
 
541
                resp,
 
542
                client.ByInspecting(),
 
543
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
544
                autorest.ByUnmarshallingJSON(&result),
 
545
                autorest.ByClosing())
 
546
        result.Response = autorest.Response{Response: resp}
 
547
        return
 
548
}
 
549
 
 
550
// ListVirtualMachineScaleSetNetworkInterfacesNextResults retrieves the next set of results, if any.
 
551
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
 
552
        req, err := lastResults.InterfaceListResultPreparer()
 
553
        if err != nil {
 
554
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure preparing next results request request")
 
555
        }
 
556
        if req == nil {
 
557
                return
 
558
        }
 
559
 
 
560
        resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req)
 
561
        if err != nil {
 
562
                result.Response = autorest.Response{Response: resp}
 
563
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure sending next results request request")
 
564
        }
 
565
 
 
566
        result, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp)
 
567
        if err != nil {
 
568
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", "Failure responding to next results request request")
 
569
        }
 
570
 
 
571
        return
 
572
}
 
573
 
 
574
// ListVirtualMachineScaleSetVMNetworkInterfaces the list network interface
 
575
// operation retrieves information about all network interfaces in a virtual
 
576
// machine from a virtual machine scale set.
 
577
//
 
578
// resourceGroupName is the name of the resource group.
 
579
// virtualMachineScaleSetName is the name of the virtual machine scale set.
 
580
// virtualmachineIndex is the virtual machine index.
 
581
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResult, ae error) {
 
582
        req, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex)
 
583
        if err != nil {
 
584
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure preparing request")
 
585
        }
 
586
 
 
587
        resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req)
 
588
        if err != nil {
 
589
                result.Response = autorest.Response{Response: resp}
 
590
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure sending request")
 
591
        }
 
592
 
 
593
        result, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp)
 
594
        if err != nil {
 
595
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure responding to request")
 
596
        }
 
597
 
 
598
        return
 
599
}
 
600
 
 
601
// ListVirtualMachineScaleSetVMNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetVMNetworkInterfaces request.
 
602
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (*http.Request, error) {
 
603
        pathParameters := map[string]interface{}{
 
604
                "resourceGroupName":          url.QueryEscape(resourceGroupName),
 
605
                "subscriptionId":             url.QueryEscape(client.SubscriptionID),
 
606
                "virtualmachineIndex":        url.QueryEscape(virtualmachineIndex),
 
607
                "virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
 
608
        }
 
609
 
 
610
        queryParameters := map[string]interface{}{
 
611
                "api-version": APIVersion,
 
612
        }
 
613
 
 
614
        return autorest.Prepare(&http.Request{},
 
615
                autorest.AsJSON(),
 
616
                autorest.AsGet(),
 
617
                autorest.WithBaseURL(client.BaseURI),
 
618
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces"),
 
619
                autorest.WithPathParameters(pathParameters),
 
620
                autorest.WithQueryParameters(queryParameters))
 
621
}
 
622
 
 
623
// ListVirtualMachineScaleSetVMNetworkInterfacesSender sends the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method will close the
 
624
// http.Response Body if it receives an error.
 
625
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesSender(req *http.Request) (*http.Response, error) {
 
626
        return client.Send(req, http.StatusOK)
 
627
}
 
628
 
 
629
// ListVirtualMachineScaleSetVMNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method always
 
630
// closes the http.Response Body.
 
631
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) {
 
632
        err = autorest.Respond(
 
633
                resp,
 
634
                client.ByInspecting(),
 
635
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
636
                autorest.ByUnmarshallingJSON(&result),
 
637
                autorest.ByClosing())
 
638
        result.Response = autorest.Response{Response: resp}
 
639
        return
 
640
}
 
641
 
 
642
// ListVirtualMachineScaleSetVMNetworkInterfacesNextResults retrieves the next set of results, if any.
 
643
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesNextResults(lastResults InterfaceListResult) (result InterfaceListResult, ae error) {
 
644
        req, err := lastResults.InterfaceListResultPreparer()
 
645
        if err != nil {
 
646
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure preparing next results request request")
 
647
        }
 
648
        if req == nil {
 
649
                return
 
650
        }
 
651
 
 
652
        resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req)
 
653
        if err != nil {
 
654
                result.Response = autorest.Response{Response: resp}
 
655
                return result, autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure sending next results request request")
 
656
        }
 
657
 
 
658
        result, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp)
 
659
        if err != nil {
 
660
                ae = autorest.NewErrorWithError(err, "network/InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", "Failure responding to next results request request")
 
661
        }
 
662
 
 
663
        return
 
664
}