1package compute 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. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/validation" 25 "github.com/Azure/go-autorest/tracing" 26 "net/http" 27) 28 29// ContainerServicesClient is the compute Client 30type ContainerServicesClient struct { 31 BaseClient 32} 33 34// NewContainerServicesClient creates an instance of the ContainerServicesClient client. 35func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { 36 return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) 37} 38 39// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient client. 40func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { 41 return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} 42} 43 44// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and 45// agents. 46// Parameters: 47// resourceGroupName - the name of the resource group. 48// containerServiceName - the name of the container service in the specified subscription and resource group. 49// parameters - parameters supplied to the Create or Update a Container Service operation. 50func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFuture, err error) { 51 if tracing.IsEnabled() { 52 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") 53 defer func() { 54 sc := -1 55 if result.Response() != nil { 56 sc = result.Response().StatusCode 57 } 58 tracing.EndSpan(ctx, sc, err) 59 }() 60 } 61 if err := validation.Validate([]validation.Validation{ 62 {TargetValue: parameters, 63 Constraints: []validation.Constraint{{Target: "parameters.ContainerServiceProperties", Name: validation.Null, Rule: false, 64 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile", Name: validation.Null, Rule: false, 65 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, 66 {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, 67 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, 68 {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.Secret", Name: validation.Null, Rule: true, Chain: nil}, 69 }}, 70 {Target: "parameters.ContainerServiceProperties.MasterProfile", Name: validation.Null, Rule: true, 71 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, 72 {Target: "parameters.ContainerServiceProperties.AgentPoolProfiles", Name: validation.Null, Rule: true, Chain: nil}, 73 {Target: "parameters.ContainerServiceProperties.WindowsProfile", Name: validation.Null, Rule: false, 74 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, 75 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, 76 {Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, 77 }}, 78 {Target: "parameters.ContainerServiceProperties.LinuxProfile", Name: validation.Null, Rule: true, 79 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, 80 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-z][a-z0-9_-]*$`, Chain: nil}}}, 81 {Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, 82 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, 83 }}, 84 {Target: "parameters.ContainerServiceProperties.DiagnosticsProfile", Name: validation.Null, Rule: false, 85 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, 86 Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, 87 }}, 88 }}}}}); err != nil { 89 return result, validation.NewError("compute.ContainerServicesClient", "CreateOrUpdate", err.Error()) 90 } 91 92 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) 93 if err != nil { 94 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") 95 return 96 } 97 98 result, err = client.CreateOrUpdateSender(req) 99 if err != nil { 100 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") 101 return 102 } 103 104 return 105} 106 107// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 108func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (*http.Request, error) { 109 pathParameters := map[string]interface{}{ 110 "containerServiceName": autorest.Encode("path", containerServiceName), 111 "resourceGroupName": autorest.Encode("path", resourceGroupName), 112 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 113 } 114 115 const APIVersion = "2017-01-31" 116 queryParameters := map[string]interface{}{ 117 "api-version": APIVersion, 118 } 119 120 preparer := autorest.CreatePreparer( 121 autorest.AsContentType("application/json; charset=utf-8"), 122 autorest.AsPut(), 123 autorest.WithBaseURL(client.BaseURI), 124 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), 125 autorest.WithJSON(parameters), 126 autorest.WithQueryParameters(queryParameters)) 127 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 128} 129 130// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 131// http.Response Body if it receives an error. 132func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFuture, err error) { 133 var resp *http.Response 134 resp, err = autorest.SendWithSender(client, req, 135 azure.DoRetryWithRegistration(client.Client)) 136 if err != nil { 137 return 138 } 139 future.Future, err = azure.NewFutureFromResponse(resp) 140 return 141} 142 143// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 144// closes the http.Response Body. 145func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { 146 err = autorest.Respond( 147 resp, 148 client.ByInspecting(), 149 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), 150 autorest.ByUnmarshallingJSON(&result), 151 autorest.ByClosing()) 152 result.Response = autorest.Response{Response: resp} 153 return 154} 155 156// Delete deletes the specified container service in the specified subscription and resource group. The operation does 157// not delete other resources created as part of creating a container service, including storage accounts, VMs, and 158// availability sets. All the other resources created with the container service are part of the same resource group 159// and can be deleted individually. 160// Parameters: 161// resourceGroupName - the name of the resource group. 162// containerServiceName - the name of the container service in the specified subscription and resource group. 163func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFuture, err error) { 164 if tracing.IsEnabled() { 165 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") 166 defer func() { 167 sc := -1 168 if result.Response() != nil { 169 sc = result.Response().StatusCode 170 } 171 tracing.EndSpan(ctx, sc, err) 172 }() 173 } 174 req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) 175 if err != nil { 176 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", nil, "Failure preparing request") 177 return 178 } 179 180 result, err = client.DeleteSender(req) 181 if err != nil { 182 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") 183 return 184 } 185 186 return 187} 188 189// DeletePreparer prepares the Delete request. 190func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { 191 pathParameters := map[string]interface{}{ 192 "containerServiceName": autorest.Encode("path", containerServiceName), 193 "resourceGroupName": autorest.Encode("path", resourceGroupName), 194 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 195 } 196 197 const APIVersion = "2017-01-31" 198 queryParameters := map[string]interface{}{ 199 "api-version": APIVersion, 200 } 201 202 preparer := autorest.CreatePreparer( 203 autorest.AsDelete(), 204 autorest.WithBaseURL(client.BaseURI), 205 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), 206 autorest.WithQueryParameters(queryParameters)) 207 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 208} 209 210// DeleteSender sends the Delete request. The method will close the 211// http.Response Body if it receives an error. 212func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFuture, err error) { 213 var resp *http.Response 214 resp, err = autorest.SendWithSender(client, req, 215 azure.DoRetryWithRegistration(client.Client)) 216 if err != nil { 217 return 218 } 219 future.Future, err = azure.NewFutureFromResponse(resp) 220 return 221} 222 223// DeleteResponder handles the response to the Delete request. The method always 224// closes the http.Response Body. 225func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 226 err = autorest.Respond( 227 resp, 228 client.ByInspecting(), 229 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 230 autorest.ByClosing()) 231 result.Response = resp 232 return 233} 234 235// Get gets the properties of the specified container service in the specified subscription and resource group. The 236// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters 237// and agents. 238// Parameters: 239// resourceGroupName - the name of the resource group. 240// containerServiceName - the name of the container service in the specified subscription and resource group. 241func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { 242 if tracing.IsEnabled() { 243 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Get") 244 defer func() { 245 sc := -1 246 if result.Response.Response != nil { 247 sc = result.Response.Response.StatusCode 248 } 249 tracing.EndSpan(ctx, sc, err) 250 }() 251 } 252 req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) 253 if err != nil { 254 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", nil, "Failure preparing request") 255 return 256 } 257 258 resp, err := client.GetSender(req) 259 if err != nil { 260 result.Response = autorest.Response{Response: resp} 261 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure sending request") 262 return 263 } 264 265 result, err = client.GetResponder(resp) 266 if err != nil { 267 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure responding to request") 268 } 269 270 return 271} 272 273// GetPreparer prepares the Get request. 274func (client ContainerServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { 275 pathParameters := map[string]interface{}{ 276 "containerServiceName": autorest.Encode("path", containerServiceName), 277 "resourceGroupName": autorest.Encode("path", resourceGroupName), 278 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 279 } 280 281 const APIVersion = "2017-01-31" 282 queryParameters := map[string]interface{}{ 283 "api-version": APIVersion, 284 } 285 286 preparer := autorest.CreatePreparer( 287 autorest.AsGet(), 288 autorest.WithBaseURL(client.BaseURI), 289 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), 290 autorest.WithQueryParameters(queryParameters)) 291 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 292} 293 294// GetSender sends the Get request. The method will close the 295// http.Response Body if it receives an error. 296func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Response, error) { 297 return autorest.SendWithSender(client, req, 298 azure.DoRetryWithRegistration(client.Client)) 299} 300 301// GetResponder handles the response to the Get request. The method always 302// closes the http.Response Body. 303func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { 304 err = autorest.Respond( 305 resp, 306 client.ByInspecting(), 307 azure.WithErrorUnlessStatusCode(http.StatusOK), 308 autorest.ByUnmarshallingJSON(&result), 309 autorest.ByClosing()) 310 result.Response = autorest.Response{Response: resp} 311 return 312} 313 314// List gets a list of container services in the specified subscription. The operation returns properties of each 315// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. 316func (client ContainerServicesClient) List(ctx context.Context) (result ContainerServiceListResultPage, err error) { 317 if tracing.IsEnabled() { 318 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") 319 defer func() { 320 sc := -1 321 if result.cslr.Response.Response != nil { 322 sc = result.cslr.Response.Response.StatusCode 323 } 324 tracing.EndSpan(ctx, sc, err) 325 }() 326 } 327 result.fn = client.listNextResults 328 req, err := client.ListPreparer(ctx) 329 if err != nil { 330 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", nil, "Failure preparing request") 331 return 332 } 333 334 resp, err := client.ListSender(req) 335 if err != nil { 336 result.cslr.Response = autorest.Response{Response: resp} 337 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure sending request") 338 return 339 } 340 341 result.cslr, err = client.ListResponder(resp) 342 if err != nil { 343 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to request") 344 } 345 346 return 347} 348 349// ListPreparer prepares the List request. 350func (client ContainerServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { 351 pathParameters := map[string]interface{}{ 352 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 353 } 354 355 const APIVersion = "2017-01-31" 356 queryParameters := map[string]interface{}{ 357 "api-version": APIVersion, 358 } 359 360 preparer := autorest.CreatePreparer( 361 autorest.AsGet(), 362 autorest.WithBaseURL(client.BaseURI), 363 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", pathParameters), 364 autorest.WithQueryParameters(queryParameters)) 365 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 366} 367 368// ListSender sends the List request. The method will close the 369// http.Response Body if it receives an error. 370func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Response, error) { 371 return autorest.SendWithSender(client, req, 372 azure.DoRetryWithRegistration(client.Client)) 373} 374 375// ListResponder handles the response to the List request. The method always 376// closes the http.Response Body. 377func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, err error) { 378 err = autorest.Respond( 379 resp, 380 client.ByInspecting(), 381 azure.WithErrorUnlessStatusCode(http.StatusOK), 382 autorest.ByUnmarshallingJSON(&result), 383 autorest.ByClosing()) 384 result.Response = autorest.Response{Response: resp} 385 return 386} 387 388// listNextResults retrieves the next set of results, if any. 389func (client ContainerServicesClient) listNextResults(ctx context.Context, lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { 390 req, err := lastResults.containerServiceListResultPreparer(ctx) 391 if err != nil { 392 return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listNextResults", nil, "Failure preparing next results request") 393 } 394 if req == nil { 395 return 396 } 397 resp, err := client.ListSender(req) 398 if err != nil { 399 result.Response = autorest.Response{Response: resp} 400 return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listNextResults", resp, "Failure sending next results request") 401 } 402 result, err = client.ListResponder(resp) 403 if err != nil { 404 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listNextResults", resp, "Failure responding to next results request") 405 } 406 return 407} 408 409// ListComplete enumerates all values, automatically crossing page boundaries as required. 410func (client ContainerServicesClient) ListComplete(ctx context.Context) (result ContainerServiceListResultIterator, err error) { 411 if tracing.IsEnabled() { 412 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") 413 defer func() { 414 sc := -1 415 if result.Response().Response.Response != nil { 416 sc = result.page.Response().Response.Response.StatusCode 417 } 418 tracing.EndSpan(ctx, sc, err) 419 }() 420 } 421 result.page, err = client.List(ctx) 422 return 423} 424 425// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The 426// operation returns properties of each container service including state, orchestrator, number of masters and agents, 427// and FQDNs of masters and agents. 428// Parameters: 429// resourceGroupName - the name of the resource group. 430func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ContainerServiceListResultPage, err error) { 431 if tracing.IsEnabled() { 432 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") 433 defer func() { 434 sc := -1 435 if result.cslr.Response.Response != nil { 436 sc = result.cslr.Response.Response.StatusCode 437 } 438 tracing.EndSpan(ctx, sc, err) 439 }() 440 } 441 result.fn = client.listByResourceGroupNextResults 442 req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) 443 if err != nil { 444 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") 445 return 446 } 447 448 resp, err := client.ListByResourceGroupSender(req) 449 if err != nil { 450 result.cslr.Response = autorest.Response{Response: resp} 451 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") 452 return 453 } 454 455 result.cslr, err = client.ListByResourceGroupResponder(resp) 456 if err != nil { 457 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") 458 } 459 460 return 461} 462 463// ListByResourceGroupPreparer prepares the ListByResourceGroup request. 464func (client ContainerServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { 465 pathParameters := map[string]interface{}{ 466 "resourceGroupName": autorest.Encode("path", resourceGroupName), 467 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 468 } 469 470 const APIVersion = "2017-01-31" 471 queryParameters := map[string]interface{}{ 472 "api-version": APIVersion, 473 } 474 475 preparer := autorest.CreatePreparer( 476 autorest.AsGet(), 477 autorest.WithBaseURL(client.BaseURI), 478 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", pathParameters), 479 autorest.WithQueryParameters(queryParameters)) 480 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 481} 482 483// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the 484// http.Response Body if it receives an error. 485func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { 486 return autorest.SendWithSender(client, req, 487 azure.DoRetryWithRegistration(client.Client)) 488} 489 490// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always 491// closes the http.Response Body. 492func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerServiceListResult, err error) { 493 err = autorest.Respond( 494 resp, 495 client.ByInspecting(), 496 azure.WithErrorUnlessStatusCode(http.StatusOK), 497 autorest.ByUnmarshallingJSON(&result), 498 autorest.ByClosing()) 499 result.Response = autorest.Response{Response: resp} 500 return 501} 502 503// listByResourceGroupNextResults retrieves the next set of results, if any. 504func (client ContainerServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { 505 req, err := lastResults.containerServiceListResultPreparer(ctx) 506 if err != nil { 507 return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") 508 } 509 if req == nil { 510 return 511 } 512 resp, err := client.ListByResourceGroupSender(req) 513 if err != nil { 514 result.Response = autorest.Response{Response: resp} 515 return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") 516 } 517 result, err = client.ListByResourceGroupResponder(resp) 518 if err != nil { 519 err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") 520 } 521 return 522} 523 524// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. 525func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ContainerServiceListResultIterator, err error) { 526 if tracing.IsEnabled() { 527 ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") 528 defer func() { 529 sc := -1 530 if result.Response().Response.Response != nil { 531 sc = result.page.Response().Response.Response.StatusCode 532 } 533 tracing.EndSpan(ctx, sc, err) 534 }() 535 } 536 result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) 537 return 538} 539