3
// Copyright (c) Microsoft and contributors. All rights reserved.
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
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.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
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
22
"github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
27
// ServerFarmsClient is the use these APIs to manage Azure Websites resources
28
// through the Azure Resource Manager. All task operations conform to the
29
// HTTP/1.1 protocol specification and each operation returns an
30
// x-ms-request-id header that can be used to obtain information about the
31
// request. You must make sure that requests made to these resources are
32
// secure. For more information, see <a
33
// href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
34
// Azure Resource Manager requests.</a>
35
type ServerFarmsClient struct {
39
// NewServerFarmsClient creates an instance of the ServerFarmsClient client.
40
func NewServerFarmsClient(subscriptionID string) ServerFarmsClient {
41
return NewServerFarmsClientWithBaseURI(DefaultBaseURI, subscriptionID)
44
// NewServerFarmsClientWithBaseURI creates an instance of the
45
// ServerFarmsClient client.
46
func NewServerFarmsClientWithBaseURI(baseURI string, subscriptionID string) ServerFarmsClient {
47
return ServerFarmsClient{NewWithBaseURI(baseURI, subscriptionID)}
50
// CreateOrUpdateServerFarm sends the create or update server farm request.
52
// resourceGroupName is name of resource group name is name of App Service
53
// Plan serverFarmEnvelope is details of App Service Plan allowPendingState
54
// is oBSOLETE: If true, allow pending state for App Service Plan
55
func (client ServerFarmsClient) CreateOrUpdateServerFarm(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool) (result ServerFarmWithRichSku, ae error) {
56
req, err := client.CreateOrUpdateServerFarmPreparer(resourceGroupName, name, serverFarmEnvelope, allowPendingState)
58
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure preparing request")
61
resp, err := client.CreateOrUpdateServerFarmSender(req)
63
result.Response = autorest.Response{Response: resp}
64
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure sending request")
67
result, err = client.CreateOrUpdateServerFarmResponder(resp)
69
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure responding to request")
75
// CreateOrUpdateServerFarmPreparer prepares the CreateOrUpdateServerFarm request.
76
func (client ServerFarmsClient) CreateOrUpdateServerFarmPreparer(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool) (*http.Request, error) {
77
pathParameters := map[string]interface{}{
78
"name": url.QueryEscape(name),
79
"resourceGroupName": url.QueryEscape(resourceGroupName),
80
"subscriptionId": url.QueryEscape(client.SubscriptionID),
83
queryParameters := map[string]interface{}{
84
"api-version": APIVersion,
86
if allowPendingState != nil {
87
queryParameters["allowPendingState"] = allowPendingState
90
return autorest.Prepare(&http.Request{},
93
autorest.WithBaseURL(client.BaseURI),
94
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
95
autorest.WithJSON(serverFarmEnvelope),
96
autorest.WithPathParameters(pathParameters),
97
autorest.WithQueryParameters(queryParameters))
100
// CreateOrUpdateServerFarmSender sends the CreateOrUpdateServerFarm request. The method will close the
101
// http.Response Body if it receives an error.
102
func (client ServerFarmsClient) CreateOrUpdateServerFarmSender(req *http.Request) (*http.Response, error) {
103
return client.Send(req, http.StatusOK, http.StatusAccepted)
106
// CreateOrUpdateServerFarmResponder handles the response to the CreateOrUpdateServerFarm request. The method always
107
// closes the http.Response Body.
108
func (client ServerFarmsClient) CreateOrUpdateServerFarmResponder(resp *http.Response) (result ServerFarmWithRichSku, err error) {
109
err = autorest.Respond(
111
client.ByInspecting(),
112
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
113
autorest.ByUnmarshallingJSON(&result),
114
autorest.ByClosing())
115
result.Response = autorest.Response{Response: resp}
119
// CreateOrUpdateVnetRoute sends the create or update vnet route request.
121
// resourceGroupName is name of resource group name is name of App Service
122
// Plan vnetName is name of virtual network routeName is name of the virtual
123
// network route route is the route object
124
func (client ServerFarmsClient) CreateOrUpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, ae error) {
125
req, err := client.CreateOrUpdateVnetRoutePreparer(resourceGroupName, name, vnetName, routeName, route)
127
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure preparing request")
130
resp, err := client.CreateOrUpdateVnetRouteSender(req)
132
result.Response = autorest.Response{Response: resp}
133
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure sending request")
136
result, err = client.CreateOrUpdateVnetRouteResponder(resp)
138
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure responding to request")
144
// CreateOrUpdateVnetRoutePreparer prepares the CreateOrUpdateVnetRoute request.
145
func (client ServerFarmsClient) CreateOrUpdateVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) {
146
pathParameters := map[string]interface{}{
147
"name": url.QueryEscape(name),
148
"resourceGroupName": url.QueryEscape(resourceGroupName),
149
"routeName": url.QueryEscape(routeName),
150
"subscriptionId": url.QueryEscape(client.SubscriptionID),
151
"vnetName": url.QueryEscape(vnetName),
154
queryParameters := map[string]interface{}{
155
"api-version": APIVersion,
158
return autorest.Prepare(&http.Request{},
161
autorest.WithBaseURL(client.BaseURI),
162
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
163
autorest.WithJSON(route),
164
autorest.WithPathParameters(pathParameters),
165
autorest.WithQueryParameters(queryParameters))
168
// CreateOrUpdateVnetRouteSender sends the CreateOrUpdateVnetRoute request. The method will close the
169
// http.Response Body if it receives an error.
170
func (client ServerFarmsClient) CreateOrUpdateVnetRouteSender(req *http.Request) (*http.Response, error) {
171
return client.Send(req, http.StatusOK, http.StatusBadRequest, http.StatusNotFound)
174
// CreateOrUpdateVnetRouteResponder handles the response to the CreateOrUpdateVnetRoute request. The method always
175
// closes the http.Response Body.
176
func (client ServerFarmsClient) CreateOrUpdateVnetRouteResponder(resp *http.Response) (result VnetRoute, err error) {
177
err = autorest.Respond(
179
client.ByInspecting(),
180
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
181
autorest.ByUnmarshallingJSON(&result),
182
autorest.ByClosing())
183
result.Response = autorest.Response{Response: resp}
187
// DeleteServerFarm sends the delete server farm request.
189
// resourceGroupName is name of resource group name is name of App Service
191
func (client ServerFarmsClient) DeleteServerFarm(resourceGroupName string, name string) (result ObjectSet, ae error) {
192
req, err := client.DeleteServerFarmPreparer(resourceGroupName, name)
194
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure preparing request")
197
resp, err := client.DeleteServerFarmSender(req)
199
result.Response = autorest.Response{Response: resp}
200
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure sending request")
203
result, err = client.DeleteServerFarmResponder(resp)
205
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure responding to request")
211
// DeleteServerFarmPreparer prepares the DeleteServerFarm request.
212
func (client ServerFarmsClient) DeleteServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
213
pathParameters := map[string]interface{}{
214
"name": url.QueryEscape(name),
215
"resourceGroupName": url.QueryEscape(resourceGroupName),
216
"subscriptionId": url.QueryEscape(client.SubscriptionID),
219
queryParameters := map[string]interface{}{
220
"api-version": APIVersion,
223
return autorest.Prepare(&http.Request{},
226
autorest.WithBaseURL(client.BaseURI),
227
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
228
autorest.WithPathParameters(pathParameters),
229
autorest.WithQueryParameters(queryParameters))
232
// DeleteServerFarmSender sends the DeleteServerFarm request. The method will close the
233
// http.Response Body if it receives an error.
234
func (client ServerFarmsClient) DeleteServerFarmSender(req *http.Request) (*http.Response, error) {
235
return client.Send(req, http.StatusOK)
238
// DeleteServerFarmResponder handles the response to the DeleteServerFarm request. The method always
239
// closes the http.Response Body.
240
func (client ServerFarmsClient) DeleteServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
241
err = autorest.Respond(
243
client.ByInspecting(),
244
autorest.WithErrorUnlessStatusCode(http.StatusOK),
245
autorest.ByUnmarshallingJSON(&result.Value),
246
autorest.ByClosing())
247
result.Response = autorest.Response{Response: resp}
251
// DeleteVnetRoute sends the delete vnet route request.
253
// resourceGroupName is name of resource group name is name of App Service
254
// Plan vnetName is name of virtual network routeName is name of the virtual
256
func (client ServerFarmsClient) DeleteVnetRoute(resourceGroupName string, name string, vnetName string, routeName string) (result ObjectSet, ae error) {
257
req, err := client.DeleteVnetRoutePreparer(resourceGroupName, name, vnetName, routeName)
259
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure preparing request")
262
resp, err := client.DeleteVnetRouteSender(req)
264
result.Response = autorest.Response{Response: resp}
265
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure sending request")
268
result, err = client.DeleteVnetRouteResponder(resp)
270
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure responding to request")
276
// DeleteVnetRoutePreparer prepares the DeleteVnetRoute request.
277
func (client ServerFarmsClient) DeleteVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) {
278
pathParameters := map[string]interface{}{
279
"name": url.QueryEscape(name),
280
"resourceGroupName": url.QueryEscape(resourceGroupName),
281
"routeName": url.QueryEscape(routeName),
282
"subscriptionId": url.QueryEscape(client.SubscriptionID),
283
"vnetName": url.QueryEscape(vnetName),
286
queryParameters := map[string]interface{}{
287
"api-version": APIVersion,
290
return autorest.Prepare(&http.Request{},
293
autorest.WithBaseURL(client.BaseURI),
294
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
295
autorest.WithPathParameters(pathParameters),
296
autorest.WithQueryParameters(queryParameters))
299
// DeleteVnetRouteSender sends the DeleteVnetRoute request. The method will close the
300
// http.Response Body if it receives an error.
301
func (client ServerFarmsClient) DeleteVnetRouteSender(req *http.Request) (*http.Response, error) {
302
return client.Send(req, http.StatusOK, http.StatusNotFound)
305
// DeleteVnetRouteResponder handles the response to the DeleteVnetRoute request. The method always
306
// closes the http.Response Body.
307
func (client ServerFarmsClient) DeleteVnetRouteResponder(resp *http.Response) (result ObjectSet, err error) {
308
err = autorest.Respond(
310
client.ByInspecting(),
311
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
312
autorest.ByUnmarshallingJSON(&result.Value),
313
autorest.ByClosing())
314
result.Response = autorest.Response{Response: resp}
318
// GetRouteForVnet sends the get route for vnet request.
320
// resourceGroupName is name of resource group name is name of App Service
321
// Plan vnetName is name of virtual network routeName is name of the virtual
323
func (client ServerFarmsClient) GetRouteForVnet(resourceGroupName string, name string, vnetName string, routeName string) (result VnetRouteList, ae error) {
324
req, err := client.GetRouteForVnetPreparer(resourceGroupName, name, vnetName, routeName)
326
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure preparing request")
329
resp, err := client.GetRouteForVnetSender(req)
331
result.Response = autorest.Response{Response: resp}
332
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure sending request")
335
result, err = client.GetRouteForVnetResponder(resp)
337
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure responding to request")
343
// GetRouteForVnetPreparer prepares the GetRouteForVnet request.
344
func (client ServerFarmsClient) GetRouteForVnetPreparer(resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) {
345
pathParameters := map[string]interface{}{
346
"name": url.QueryEscape(name),
347
"resourceGroupName": url.QueryEscape(resourceGroupName),
348
"routeName": url.QueryEscape(routeName),
349
"subscriptionId": url.QueryEscape(client.SubscriptionID),
350
"vnetName": url.QueryEscape(vnetName),
353
queryParameters := map[string]interface{}{
354
"api-version": APIVersion,
357
return autorest.Prepare(&http.Request{},
360
autorest.WithBaseURL(client.BaseURI),
361
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
362
autorest.WithPathParameters(pathParameters),
363
autorest.WithQueryParameters(queryParameters))
366
// GetRouteForVnetSender sends the GetRouteForVnet request. The method will close the
367
// http.Response Body if it receives an error.
368
func (client ServerFarmsClient) GetRouteForVnetSender(req *http.Request) (*http.Response, error) {
369
return client.Send(req, http.StatusOK, http.StatusNotFound)
372
// GetRouteForVnetResponder handles the response to the GetRouteForVnet request. The method always
373
// closes the http.Response Body.
374
func (client ServerFarmsClient) GetRouteForVnetResponder(resp *http.Response) (result VnetRouteList, err error) {
375
err = autorest.Respond(
377
client.ByInspecting(),
378
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
379
autorest.ByUnmarshallingJSON(&result.Value),
380
autorest.ByClosing())
381
result.Response = autorest.Response{Response: resp}
385
// GetRoutesForVnet sends the get routes for vnet request.
387
// resourceGroupName is name of resource group name is name of App Service
388
// Plan vnetName is name of virtual network
389
func (client ServerFarmsClient) GetRoutesForVnet(resourceGroupName string, name string, vnetName string) (result VnetRouteList, ae error) {
390
req, err := client.GetRoutesForVnetPreparer(resourceGroupName, name, vnetName)
392
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure preparing request")
395
resp, err := client.GetRoutesForVnetSender(req)
397
result.Response = autorest.Response{Response: resp}
398
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure sending request")
401
result, err = client.GetRoutesForVnetResponder(resp)
403
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure responding to request")
409
// GetRoutesForVnetPreparer prepares the GetRoutesForVnet request.
410
func (client ServerFarmsClient) GetRoutesForVnetPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
411
pathParameters := map[string]interface{}{
412
"name": url.QueryEscape(name),
413
"resourceGroupName": url.QueryEscape(resourceGroupName),
414
"subscriptionId": url.QueryEscape(client.SubscriptionID),
415
"vnetName": url.QueryEscape(vnetName),
418
queryParameters := map[string]interface{}{
419
"api-version": APIVersion,
422
return autorest.Prepare(&http.Request{},
425
autorest.WithBaseURL(client.BaseURI),
426
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes"),
427
autorest.WithPathParameters(pathParameters),
428
autorest.WithQueryParameters(queryParameters))
431
// GetRoutesForVnetSender sends the GetRoutesForVnet request. The method will close the
432
// http.Response Body if it receives an error.
433
func (client ServerFarmsClient) GetRoutesForVnetSender(req *http.Request) (*http.Response, error) {
434
return client.Send(req, http.StatusOK)
437
// GetRoutesForVnetResponder handles the response to the GetRoutesForVnet request. The method always
438
// closes the http.Response Body.
439
func (client ServerFarmsClient) GetRoutesForVnetResponder(resp *http.Response) (result VnetRouteList, err error) {
440
err = autorest.Respond(
442
client.ByInspecting(),
443
autorest.WithErrorUnlessStatusCode(http.StatusOK),
444
autorest.ByUnmarshallingJSON(&result.Value),
445
autorest.ByClosing())
446
result.Response = autorest.Response{Response: resp}
450
// GetServerFarm sends the get server farm request.
452
// resourceGroupName is name of resource group name is name of App Service
454
func (client ServerFarmsClient) GetServerFarm(resourceGroupName string, name string) (result ServerFarmWithRichSku, ae error) {
455
req, err := client.GetServerFarmPreparer(resourceGroupName, name)
457
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure preparing request")
460
resp, err := client.GetServerFarmSender(req)
462
result.Response = autorest.Response{Response: resp}
463
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure sending request")
466
result, err = client.GetServerFarmResponder(resp)
468
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure responding to request")
474
// GetServerFarmPreparer prepares the GetServerFarm request.
475
func (client ServerFarmsClient) GetServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
476
pathParameters := map[string]interface{}{
477
"name": url.QueryEscape(name),
478
"resourceGroupName": url.QueryEscape(resourceGroupName),
479
"subscriptionId": url.QueryEscape(client.SubscriptionID),
482
queryParameters := map[string]interface{}{
483
"api-version": APIVersion,
486
return autorest.Prepare(&http.Request{},
489
autorest.WithBaseURL(client.BaseURI),
490
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
491
autorest.WithPathParameters(pathParameters),
492
autorest.WithQueryParameters(queryParameters))
495
// GetServerFarmSender sends the GetServerFarm request. The method will close the
496
// http.Response Body if it receives an error.
497
func (client ServerFarmsClient) GetServerFarmSender(req *http.Request) (*http.Response, error) {
498
return client.Send(req, http.StatusOK)
501
// GetServerFarmResponder handles the response to the GetServerFarm request. The method always
502
// closes the http.Response Body.
503
func (client ServerFarmsClient) GetServerFarmResponder(resp *http.Response) (result ServerFarmWithRichSku, err error) {
504
err = autorest.Respond(
506
client.ByInspecting(),
507
autorest.WithErrorUnlessStatusCode(http.StatusOK),
508
autorest.ByUnmarshallingJSON(&result),
509
autorest.ByClosing())
510
result.Response = autorest.Response{Response: resp}
514
// GetServerFarmMetricDefintions sends the get server farm metric defintions
517
// resourceGroupName is name of resource group name is name of App Service
519
func (client ServerFarmsClient) GetServerFarmMetricDefintions(resourceGroupName string, name string) (result MetricDefinitionCollection, ae error) {
520
req, err := client.GetServerFarmMetricDefintionsPreparer(resourceGroupName, name)
522
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure preparing request")
525
resp, err := client.GetServerFarmMetricDefintionsSender(req)
527
result.Response = autorest.Response{Response: resp}
528
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure sending request")
531
result, err = client.GetServerFarmMetricDefintionsResponder(resp)
533
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure responding to request")
539
// GetServerFarmMetricDefintionsPreparer prepares the GetServerFarmMetricDefintions request.
540
func (client ServerFarmsClient) GetServerFarmMetricDefintionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
541
pathParameters := map[string]interface{}{
542
"name": url.QueryEscape(name),
543
"resourceGroupName": url.QueryEscape(resourceGroupName),
544
"subscriptionId": url.QueryEscape(client.SubscriptionID),
547
queryParameters := map[string]interface{}{
548
"api-version": APIVersion,
551
return autorest.Prepare(&http.Request{},
554
autorest.WithBaseURL(client.BaseURI),
555
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions"),
556
autorest.WithPathParameters(pathParameters),
557
autorest.WithQueryParameters(queryParameters))
560
// GetServerFarmMetricDefintionsSender sends the GetServerFarmMetricDefintions request. The method will close the
561
// http.Response Body if it receives an error.
562
func (client ServerFarmsClient) GetServerFarmMetricDefintionsSender(req *http.Request) (*http.Response, error) {
563
return client.Send(req, http.StatusOK)
566
// GetServerFarmMetricDefintionsResponder handles the response to the GetServerFarmMetricDefintions request. The method always
567
// closes the http.Response Body.
568
func (client ServerFarmsClient) GetServerFarmMetricDefintionsResponder(resp *http.Response) (result MetricDefinitionCollection, err error) {
569
err = autorest.Respond(
571
client.ByInspecting(),
572
autorest.WithErrorUnlessStatusCode(http.StatusOK),
573
autorest.ByUnmarshallingJSON(&result),
574
autorest.ByClosing())
575
result.Response = autorest.Response{Response: resp}
579
// GetServerFarmMetrics sends the get server farm metrics request.
581
// resourceGroupName is name of resource group name is name of App Service
582
// Plan details is if true, metrics are broken down per App Service Plan
583
// instance filter is return only usages/metrics specified in the filter.
584
// Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
585
// or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
586
// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
587
// duration'[Hour|Minute|Day]'.
588
func (client ServerFarmsClient) GetServerFarmMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
589
req, err := client.GetServerFarmMetricsPreparer(resourceGroupName, name, details, filter)
591
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure preparing request")
594
resp, err := client.GetServerFarmMetricsSender(req)
596
result.Response = autorest.Response{Response: resp}
597
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure sending request")
600
result, err = client.GetServerFarmMetricsResponder(resp)
602
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure responding to request")
608
// GetServerFarmMetricsPreparer prepares the GetServerFarmMetrics request.
609
func (client ServerFarmsClient) GetServerFarmMetricsPreparer(resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) {
610
pathParameters := map[string]interface{}{
611
"name": url.QueryEscape(name),
612
"resourceGroupName": url.QueryEscape(resourceGroupName),
613
"subscriptionId": url.QueryEscape(client.SubscriptionID),
616
queryParameters := map[string]interface{}{
617
"api-version": APIVersion,
620
queryParameters["details"] = details
623
queryParameters["$filter"] = filter
626
return autorest.Prepare(&http.Request{},
629
autorest.WithBaseURL(client.BaseURI),
630
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics"),
631
autorest.WithPathParameters(pathParameters),
632
autorest.WithQueryParameters(queryParameters))
635
// GetServerFarmMetricsSender sends the GetServerFarmMetrics request. The method will close the
636
// http.Response Body if it receives an error.
637
func (client ServerFarmsClient) GetServerFarmMetricsSender(req *http.Request) (*http.Response, error) {
638
return client.Send(req, http.StatusOK)
641
// GetServerFarmMetricsResponder handles the response to the GetServerFarmMetrics request. The method always
642
// closes the http.Response Body.
643
func (client ServerFarmsClient) GetServerFarmMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) {
644
err = autorest.Respond(
646
client.ByInspecting(),
647
autorest.WithErrorUnlessStatusCode(http.StatusOK),
648
autorest.ByUnmarshallingJSON(&result),
649
autorest.ByClosing())
650
result.Response = autorest.Response{Response: resp}
654
// GetServerFarmOperation sends the get server farm operation request.
656
// resourceGroupName is name of resource group name is name of server farm
657
// operationID is id of Server farm operation">
658
func (client ServerFarmsClient) GetServerFarmOperation(resourceGroupName string, name string, operationID string) (result ServerFarmWithRichSku, ae error) {
659
req, err := client.GetServerFarmOperationPreparer(resourceGroupName, name, operationID)
661
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure preparing request")
664
resp, err := client.GetServerFarmOperationSender(req)
666
result.Response = autorest.Response{Response: resp}
667
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure sending request")
670
result, err = client.GetServerFarmOperationResponder(resp)
672
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure responding to request")
678
// GetServerFarmOperationPreparer prepares the GetServerFarmOperation request.
679
func (client ServerFarmsClient) GetServerFarmOperationPreparer(resourceGroupName string, name string, operationID string) (*http.Request, error) {
680
pathParameters := map[string]interface{}{
681
"name": url.QueryEscape(name),
682
"operationId": url.QueryEscape(operationID),
683
"resourceGroupName": url.QueryEscape(resourceGroupName),
684
"subscriptionId": url.QueryEscape(client.SubscriptionID),
687
queryParameters := map[string]interface{}{
688
"api-version": APIVersion,
691
return autorest.Prepare(&http.Request{},
694
autorest.WithBaseURL(client.BaseURI),
695
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}"),
696
autorest.WithPathParameters(pathParameters),
697
autorest.WithQueryParameters(queryParameters))
700
// GetServerFarmOperationSender sends the GetServerFarmOperation request. The method will close the
701
// http.Response Body if it receives an error.
702
func (client ServerFarmsClient) GetServerFarmOperationSender(req *http.Request) (*http.Response, error) {
703
return client.Send(req, http.StatusOK)
706
// GetServerFarmOperationResponder handles the response to the GetServerFarmOperation request. The method always
707
// closes the http.Response Body.
708
func (client ServerFarmsClient) GetServerFarmOperationResponder(resp *http.Response) (result ServerFarmWithRichSku, err error) {
709
err = autorest.Respond(
711
client.ByInspecting(),
712
autorest.WithErrorUnlessStatusCode(http.StatusOK),
713
autorest.ByUnmarshallingJSON(&result),
714
autorest.ByClosing())
715
result.Response = autorest.Response{Response: resp}
719
// GetServerFarms sends the get server farms request.
721
// resourceGroupName is name of resource group
722
func (client ServerFarmsClient) GetServerFarms(resourceGroupName string) (result ServerFarmCollection, ae error) {
723
req, err := client.GetServerFarmsPreparer(resourceGroupName)
725
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure preparing request")
728
resp, err := client.GetServerFarmsSender(req)
730
result.Response = autorest.Response{Response: resp}
731
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure sending request")
734
result, err = client.GetServerFarmsResponder(resp)
736
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure responding to request")
742
// GetServerFarmsPreparer prepares the GetServerFarms request.
743
func (client ServerFarmsClient) GetServerFarmsPreparer(resourceGroupName string) (*http.Request, error) {
744
pathParameters := map[string]interface{}{
745
"resourceGroupName": url.QueryEscape(resourceGroupName),
746
"subscriptionId": url.QueryEscape(client.SubscriptionID),
749
queryParameters := map[string]interface{}{
750
"api-version": APIVersion,
753
return autorest.Prepare(&http.Request{},
756
autorest.WithBaseURL(client.BaseURI),
757
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms"),
758
autorest.WithPathParameters(pathParameters),
759
autorest.WithQueryParameters(queryParameters))
762
// GetServerFarmsSender sends the GetServerFarms request. The method will close the
763
// http.Response Body if it receives an error.
764
func (client ServerFarmsClient) GetServerFarmsSender(req *http.Request) (*http.Response, error) {
765
return client.Send(req, http.StatusOK)
768
// GetServerFarmsResponder handles the response to the GetServerFarms request. The method always
769
// closes the http.Response Body.
770
func (client ServerFarmsClient) GetServerFarmsResponder(resp *http.Response) (result ServerFarmCollection, err error) {
771
err = autorest.Respond(
773
client.ByInspecting(),
774
autorest.WithErrorUnlessStatusCode(http.StatusOK),
775
autorest.ByUnmarshallingJSON(&result),
776
autorest.ByClosing())
777
result.Response = autorest.Response{Response: resp}
781
// GetServerFarmSites sends the get server farm sites request.
783
// resourceGroupName is name of resource group name is name of App Service
784
// Plan skipToken is skip to of web apps in a list. If specified, the
785
// resulting list will contain web apps starting from (including) the
786
// skipToken. Else, the resulting list contains web apps from the start of
787
// the list filter is supported filter: $filter=state eq running. Returns
788
// only web apps that are currently running top is list page size. If
789
// specified, results are paged.
790
func (client ServerFarmsClient) GetServerFarmSites(resourceGroupName string, name string, skipToken string, filter string, top string) (result SiteCollection, ae error) {
791
req, err := client.GetServerFarmSitesPreparer(resourceGroupName, name, skipToken, filter, top)
793
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure preparing request")
796
resp, err := client.GetServerFarmSitesSender(req)
798
result.Response = autorest.Response{Response: resp}
799
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure sending request")
802
result, err = client.GetServerFarmSitesResponder(resp)
804
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure responding to request")
810
// GetServerFarmSitesPreparer prepares the GetServerFarmSites request.
811
func (client ServerFarmsClient) GetServerFarmSitesPreparer(resourceGroupName string, name string, skipToken string, filter string, top string) (*http.Request, error) {
812
pathParameters := map[string]interface{}{
813
"name": url.QueryEscape(name),
814
"resourceGroupName": url.QueryEscape(resourceGroupName),
815
"subscriptionId": url.QueryEscape(client.SubscriptionID),
818
queryParameters := map[string]interface{}{
819
"api-version": APIVersion,
821
if len(skipToken) > 0 {
822
queryParameters["$skipToken"] = skipToken
825
queryParameters["$filter"] = filter
828
queryParameters["$top"] = top
831
return autorest.Prepare(&http.Request{},
834
autorest.WithBaseURL(client.BaseURI),
835
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites"),
836
autorest.WithPathParameters(pathParameters),
837
autorest.WithQueryParameters(queryParameters))
840
// GetServerFarmSitesSender sends the GetServerFarmSites request. The method will close the
841
// http.Response Body if it receives an error.
842
func (client ServerFarmsClient) GetServerFarmSitesSender(req *http.Request) (*http.Response, error) {
843
return client.Send(req, http.StatusOK)
846
// GetServerFarmSitesResponder handles the response to the GetServerFarmSites request. The method always
847
// closes the http.Response Body.
848
func (client ServerFarmsClient) GetServerFarmSitesResponder(resp *http.Response) (result SiteCollection, err error) {
849
err = autorest.Respond(
851
client.ByInspecting(),
852
autorest.WithErrorUnlessStatusCode(http.StatusOK),
853
autorest.ByUnmarshallingJSON(&result),
854
autorest.ByClosing())
855
result.Response = autorest.Response{Response: resp}
859
// GetServerFarmSitesNextResults retrieves the next set of results, if any.
860
func (client ServerFarmsClient) GetServerFarmSitesNextResults(lastResults SiteCollection) (result SiteCollection, ae error) {
861
req, err := lastResults.SiteCollectionPreparer()
863
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure preparing next results request request")
869
resp, err := client.GetServerFarmSitesSender(req)
871
result.Response = autorest.Response{Response: resp}
872
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure sending next results request request")
875
result, err = client.GetServerFarmSitesResponder(resp)
877
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure responding to next results request request")
883
// GetServerFarmVnetGateway sends the get server farm vnet gateway request.
885
// resourceGroupName is name of resource group name is name of the App Service
886
// Plan vnetName is name of the virtual network gatewayName is name of the
887
// gateway. Only the 'primary' gateway is supported.
888
func (client ServerFarmsClient) GetServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, ae error) {
889
req, err := client.GetServerFarmVnetGatewayPreparer(resourceGroupName, name, vnetName, gatewayName)
891
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure preparing request")
894
resp, err := client.GetServerFarmVnetGatewaySender(req)
896
result.Response = autorest.Response{Response: resp}
897
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure sending request")
900
result, err = client.GetServerFarmVnetGatewayResponder(resp)
902
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure responding to request")
908
// GetServerFarmVnetGatewayPreparer prepares the GetServerFarmVnetGateway request.
909
func (client ServerFarmsClient) GetServerFarmVnetGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) {
910
pathParameters := map[string]interface{}{
911
"gatewayName": url.QueryEscape(gatewayName),
912
"name": url.QueryEscape(name),
913
"resourceGroupName": url.QueryEscape(resourceGroupName),
914
"subscriptionId": url.QueryEscape(client.SubscriptionID),
915
"vnetName": url.QueryEscape(vnetName),
918
queryParameters := map[string]interface{}{
919
"api-version": APIVersion,
922
return autorest.Prepare(&http.Request{},
925
autorest.WithBaseURL(client.BaseURI),
926
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
927
autorest.WithPathParameters(pathParameters),
928
autorest.WithQueryParameters(queryParameters))
931
// GetServerFarmVnetGatewaySender sends the GetServerFarmVnetGateway request. The method will close the
932
// http.Response Body if it receives an error.
933
func (client ServerFarmsClient) GetServerFarmVnetGatewaySender(req *http.Request) (*http.Response, error) {
934
return client.Send(req, http.StatusOK)
937
// GetServerFarmVnetGatewayResponder handles the response to the GetServerFarmVnetGateway request. The method always
938
// closes the http.Response Body.
939
func (client ServerFarmsClient) GetServerFarmVnetGatewayResponder(resp *http.Response) (result VnetGateway, err error) {
940
err = autorest.Respond(
942
client.ByInspecting(),
943
autorest.WithErrorUnlessStatusCode(http.StatusOK),
944
autorest.ByUnmarshallingJSON(&result),
945
autorest.ByClosing())
946
result.Response = autorest.Response{Response: resp}
950
// GetVnetFromServerFarm sends the get vnet from server farm request.
952
// resourceGroupName is name of resource group name is name of App Service
953
// Plan vnetName is name of virtual network
954
func (client ServerFarmsClient) GetVnetFromServerFarm(resourceGroupName string, name string, vnetName string) (result VnetInfo, ae error) {
955
req, err := client.GetVnetFromServerFarmPreparer(resourceGroupName, name, vnetName)
957
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure preparing request")
960
resp, err := client.GetVnetFromServerFarmSender(req)
962
result.Response = autorest.Response{Response: resp}
963
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure sending request")
966
result, err = client.GetVnetFromServerFarmResponder(resp)
968
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure responding to request")
974
// GetVnetFromServerFarmPreparer prepares the GetVnetFromServerFarm request.
975
func (client ServerFarmsClient) GetVnetFromServerFarmPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
976
pathParameters := map[string]interface{}{
977
"name": url.QueryEscape(name),
978
"resourceGroupName": url.QueryEscape(resourceGroupName),
979
"subscriptionId": url.QueryEscape(client.SubscriptionID),
980
"vnetName": url.QueryEscape(vnetName),
983
queryParameters := map[string]interface{}{
984
"api-version": APIVersion,
987
return autorest.Prepare(&http.Request{},
990
autorest.WithBaseURL(client.BaseURI),
991
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}"),
992
autorest.WithPathParameters(pathParameters),
993
autorest.WithQueryParameters(queryParameters))
996
// GetVnetFromServerFarmSender sends the GetVnetFromServerFarm request. The method will close the
997
// http.Response Body if it receives an error.
998
func (client ServerFarmsClient) GetVnetFromServerFarmSender(req *http.Request) (*http.Response, error) {
999
return client.Send(req, http.StatusOK, http.StatusNotFound)
1002
// GetVnetFromServerFarmResponder handles the response to the GetVnetFromServerFarm request. The method always
1003
// closes the http.Response Body.
1004
func (client ServerFarmsClient) GetVnetFromServerFarmResponder(resp *http.Response) (result VnetInfo, err error) {
1005
err = autorest.Respond(
1007
client.ByInspecting(),
1008
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
1009
autorest.ByUnmarshallingJSON(&result),
1010
autorest.ByClosing())
1011
result.Response = autorest.Response{Response: resp}
1015
// GetVnetsForServerFarm sends the get vnets for server farm request.
1017
// resourceGroupName is name of resource group name is name of App Service
1019
func (client ServerFarmsClient) GetVnetsForServerFarm(resourceGroupName string, name string) (result VnetInfoList, ae error) {
1020
req, err := client.GetVnetsForServerFarmPreparer(resourceGroupName, name)
1022
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure preparing request")
1025
resp, err := client.GetVnetsForServerFarmSender(req)
1027
result.Response = autorest.Response{Response: resp}
1028
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure sending request")
1031
result, err = client.GetVnetsForServerFarmResponder(resp)
1033
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure responding to request")
1039
// GetVnetsForServerFarmPreparer prepares the GetVnetsForServerFarm request.
1040
func (client ServerFarmsClient) GetVnetsForServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
1041
pathParameters := map[string]interface{}{
1042
"name": url.QueryEscape(name),
1043
"resourceGroupName": url.QueryEscape(resourceGroupName),
1044
"subscriptionId": url.QueryEscape(client.SubscriptionID),
1047
queryParameters := map[string]interface{}{
1048
"api-version": APIVersion,
1051
return autorest.Prepare(&http.Request{},
1054
autorest.WithBaseURL(client.BaseURI),
1055
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections"),
1056
autorest.WithPathParameters(pathParameters),
1057
autorest.WithQueryParameters(queryParameters))
1060
// GetVnetsForServerFarmSender sends the GetVnetsForServerFarm request. The method will close the
1061
// http.Response Body if it receives an error.
1062
func (client ServerFarmsClient) GetVnetsForServerFarmSender(req *http.Request) (*http.Response, error) {
1063
return client.Send(req, http.StatusOK)
1066
// GetVnetsForServerFarmResponder handles the response to the GetVnetsForServerFarm request. The method always
1067
// closes the http.Response Body.
1068
func (client ServerFarmsClient) GetVnetsForServerFarmResponder(resp *http.Response) (result VnetInfoList, err error) {
1069
err = autorest.Respond(
1071
client.ByInspecting(),
1072
autorest.WithErrorUnlessStatusCode(http.StatusOK),
1073
autorest.ByUnmarshallingJSON(&result.Value),
1074
autorest.ByClosing())
1075
result.Response = autorest.Response{Response: resp}
1079
// RebootWorkerForServerFarm sends the reboot worker for server farm request.
1081
// resourceGroupName is name of resource group name is name of server farm
1082
// workerName is name of worker machine, typically IP address
1083
func (client ServerFarmsClient) RebootWorkerForServerFarm(resourceGroupName string, name string, workerName string) (result ObjectSet, ae error) {
1084
req, err := client.RebootWorkerForServerFarmPreparer(resourceGroupName, name, workerName)
1086
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure preparing request")
1089
resp, err := client.RebootWorkerForServerFarmSender(req)
1091
result.Response = autorest.Response{Response: resp}
1092
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure sending request")
1095
result, err = client.RebootWorkerForServerFarmResponder(resp)
1097
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure responding to request")
1103
// RebootWorkerForServerFarmPreparer prepares the RebootWorkerForServerFarm request.
1104
func (client ServerFarmsClient) RebootWorkerForServerFarmPreparer(resourceGroupName string, name string, workerName string) (*http.Request, error) {
1105
pathParameters := map[string]interface{}{
1106
"name": url.QueryEscape(name),
1107
"resourceGroupName": url.QueryEscape(resourceGroupName),
1108
"subscriptionId": url.QueryEscape(client.SubscriptionID),
1109
"workerName": url.QueryEscape(workerName),
1112
queryParameters := map[string]interface{}{
1113
"api-version": APIVersion,
1116
return autorest.Prepare(&http.Request{},
1119
autorest.WithBaseURL(client.BaseURI),
1120
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}"),
1121
autorest.WithPathParameters(pathParameters),
1122
autorest.WithQueryParameters(queryParameters))
1125
// RebootWorkerForServerFarmSender sends the RebootWorkerForServerFarm request. The method will close the
1126
// http.Response Body if it receives an error.
1127
func (client ServerFarmsClient) RebootWorkerForServerFarmSender(req *http.Request) (*http.Response, error) {
1128
return client.Send(req, http.StatusOK)
1131
// RebootWorkerForServerFarmResponder handles the response to the RebootWorkerForServerFarm request. The method always
1132
// closes the http.Response Body.
1133
func (client ServerFarmsClient) RebootWorkerForServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
1134
err = autorest.Respond(
1136
client.ByInspecting(),
1137
autorest.WithErrorUnlessStatusCode(http.StatusOK),
1138
autorest.ByUnmarshallingJSON(&result.Value),
1139
autorest.ByClosing())
1140
result.Response = autorest.Response{Response: resp}
1144
// RestartSitesForServerFarm sends the restart sites for server farm request.
1146
// resourceGroupName is name of resource group name is name of App Service
1147
// Plan softRestart is soft restart applies the configuration settings and
1148
// restarts the apps if necessary. Hard restart always restarts and
1149
// reprovisions the apps
1150
func (client ServerFarmsClient) RestartSitesForServerFarm(resourceGroupName string, name string, softRestart *bool) (result ObjectSet, ae error) {
1151
req, err := client.RestartSitesForServerFarmPreparer(resourceGroupName, name, softRestart)
1153
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure preparing request")
1156
resp, err := client.RestartSitesForServerFarmSender(req)
1158
result.Response = autorest.Response{Response: resp}
1159
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure sending request")
1162
result, err = client.RestartSitesForServerFarmResponder(resp)
1164
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure responding to request")
1170
// RestartSitesForServerFarmPreparer prepares the RestartSitesForServerFarm request.
1171
func (client ServerFarmsClient) RestartSitesForServerFarmPreparer(resourceGroupName string, name string, softRestart *bool) (*http.Request, error) {
1172
pathParameters := map[string]interface{}{
1173
"name": url.QueryEscape(name),
1174
"resourceGroupName": url.QueryEscape(resourceGroupName),
1175
"subscriptionId": url.QueryEscape(client.SubscriptionID),
1178
queryParameters := map[string]interface{}{
1179
"api-version": APIVersion,
1181
if softRestart != nil {
1182
queryParameters["softRestart"] = softRestart
1185
return autorest.Prepare(&http.Request{},
1188
autorest.WithBaseURL(client.BaseURI),
1189
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites"),
1190
autorest.WithPathParameters(pathParameters),
1191
autorest.WithQueryParameters(queryParameters))
1194
// RestartSitesForServerFarmSender sends the RestartSitesForServerFarm request. The method will close the
1195
// http.Response Body if it receives an error.
1196
func (client ServerFarmsClient) RestartSitesForServerFarmSender(req *http.Request) (*http.Response, error) {
1197
return client.Send(req, http.StatusOK)
1200
// RestartSitesForServerFarmResponder handles the response to the RestartSitesForServerFarm request. The method always
1201
// closes the http.Response Body.
1202
func (client ServerFarmsClient) RestartSitesForServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
1203
err = autorest.Respond(
1205
client.ByInspecting(),
1206
autorest.WithErrorUnlessStatusCode(http.StatusOK),
1207
autorest.ByUnmarshallingJSON(&result.Value),
1208
autorest.ByClosing())
1209
result.Response = autorest.Response{Response: resp}
1213
// UpdateServerFarmVnetGateway sends the update server farm vnet gateway
1216
// resourceGroupName is the resource group name is the name of the App Service
1217
// Plan vnetName is the name of the virtual network gatewayName is the name
1218
// of the gateway. Only 'primary' is supported. connectionEnvelope is the
1220
func (client ServerFarmsClient) UpdateServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, ae error) {
1221
req, err := client.UpdateServerFarmVnetGatewayPreparer(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope)
1223
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure preparing request")
1226
resp, err := client.UpdateServerFarmVnetGatewaySender(req)
1228
result.Response = autorest.Response{Response: resp}
1229
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure sending request")
1232
result, err = client.UpdateServerFarmVnetGatewayResponder(resp)
1234
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure responding to request")
1240
// UpdateServerFarmVnetGatewayPreparer prepares the UpdateServerFarmVnetGateway request.
1241
func (client ServerFarmsClient) UpdateServerFarmVnetGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) {
1242
pathParameters := map[string]interface{}{
1243
"gatewayName": url.QueryEscape(gatewayName),
1244
"name": url.QueryEscape(name),
1245
"resourceGroupName": url.QueryEscape(resourceGroupName),
1246
"subscriptionId": url.QueryEscape(client.SubscriptionID),
1247
"vnetName": url.QueryEscape(vnetName),
1250
queryParameters := map[string]interface{}{
1251
"api-version": APIVersion,
1254
return autorest.Prepare(&http.Request{},
1257
autorest.WithBaseURL(client.BaseURI),
1258
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
1259
autorest.WithJSON(connectionEnvelope),
1260
autorest.WithPathParameters(pathParameters),
1261
autorest.WithQueryParameters(queryParameters))
1264
// UpdateServerFarmVnetGatewaySender sends the UpdateServerFarmVnetGateway request. The method will close the
1265
// http.Response Body if it receives an error.
1266
func (client ServerFarmsClient) UpdateServerFarmVnetGatewaySender(req *http.Request) (*http.Response, error) {
1267
return client.Send(req, http.StatusOK)
1270
// UpdateServerFarmVnetGatewayResponder handles the response to the UpdateServerFarmVnetGateway request. The method always
1271
// closes the http.Response Body.
1272
func (client ServerFarmsClient) UpdateServerFarmVnetGatewayResponder(resp *http.Response) (result VnetGateway, err error) {
1273
err = autorest.Respond(
1275
client.ByInspecting(),
1276
autorest.WithErrorUnlessStatusCode(http.StatusOK),
1277
autorest.ByUnmarshallingJSON(&result),
1278
autorest.ByClosing())
1279
result.Response = autorest.Response{Response: resp}
1283
// UpdateVnetRoute sends the update vnet route request.
1285
// resourceGroupName is name of resource group name is name of App Service
1286
// Plan vnetName is name of virtual network routeName is name of the virtual
1287
// network route route is the route object
1288
func (client ServerFarmsClient) UpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, ae error) {
1289
req, err := client.UpdateVnetRoutePreparer(resourceGroupName, name, vnetName, routeName, route)
1291
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure preparing request")
1294
resp, err := client.UpdateVnetRouteSender(req)
1296
result.Response = autorest.Response{Response: resp}
1297
return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure sending request")
1300
result, err = client.UpdateVnetRouteResponder(resp)
1302
ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure responding to request")
1308
// UpdateVnetRoutePreparer prepares the UpdateVnetRoute request.
1309
func (client ServerFarmsClient) UpdateVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) {
1310
pathParameters := map[string]interface{}{
1311
"name": url.QueryEscape(name),
1312
"resourceGroupName": url.QueryEscape(resourceGroupName),
1313
"routeName": url.QueryEscape(routeName),
1314
"subscriptionId": url.QueryEscape(client.SubscriptionID),
1315
"vnetName": url.QueryEscape(vnetName),
1318
queryParameters := map[string]interface{}{
1319
"api-version": APIVersion,
1322
return autorest.Prepare(&http.Request{},
1325
autorest.WithBaseURL(client.BaseURI),
1326
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
1327
autorest.WithJSON(route),
1328
autorest.WithPathParameters(pathParameters),
1329
autorest.WithQueryParameters(queryParameters))
1332
// UpdateVnetRouteSender sends the UpdateVnetRoute request. The method will close the
1333
// http.Response Body if it receives an error.
1334
func (client ServerFarmsClient) UpdateVnetRouteSender(req *http.Request) (*http.Response, error) {
1335
return client.Send(req, http.StatusOK, http.StatusBadRequest, http.StatusNotFound)
1338
// UpdateVnetRouteResponder handles the response to the UpdateVnetRoute request. The method always
1339
// closes the http.Response Body.
1340
func (client ServerFarmsClient) UpdateVnetRouteResponder(resp *http.Response) (result VnetRoute, err error) {
1341
err = autorest.Respond(
1343
client.ByInspecting(),
1344
autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
1345
autorest.ByUnmarshallingJSON(&result),
1346
autorest.ByClosing())
1347
result.Response = autorest.Response{Response: resp}