1package avs 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "github.com/Azure/go-autorest/autorest" 12 "github.com/Azure/go-autorest/autorest/azure" 13 "github.com/Azure/go-autorest/autorest/validation" 14 "github.com/Azure/go-autorest/tracing" 15 "net/http" 16) 17 18// WorkloadNetworksClient is the azure VMware Solution API 19type WorkloadNetworksClient struct { 20 BaseClient 21} 22 23// NewWorkloadNetworksClient creates an instance of the WorkloadNetworksClient client. 24func NewWorkloadNetworksClient(subscriptionID string) WorkloadNetworksClient { 25 return NewWorkloadNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID) 26} 27 28// NewWorkloadNetworksClientWithBaseURI creates an instance of the WorkloadNetworksClient client using a custom 29// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure 30// stack). 31func NewWorkloadNetworksClientWithBaseURI(baseURI string, subscriptionID string) WorkloadNetworksClient { 32 return WorkloadNetworksClient{NewWithBaseURI(baseURI, subscriptionID)} 33} 34 35// CreateDhcp sends the create dhcp request. 36// Parameters: 37// resourceGroupName - the name of the resource group. The name is case insensitive. 38// privateCloudName - name of the private cloud 39// dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name 40// workloadNetworkDhcp - NSX DHCP 41func (client WorkloadNetworksClient) CreateDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp) (result WorkloadNetworksCreateDhcpFuture, err error) { 42 if tracing.IsEnabled() { 43 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.CreateDhcp") 44 defer func() { 45 sc := -1 46 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 47 sc = result.FutureAPI.Response().StatusCode 48 } 49 tracing.EndSpan(ctx, sc, err) 50 }() 51 } 52 if err := validation.Validate([]validation.Validation{ 53 {TargetValue: client.SubscriptionID, 54 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 55 {TargetValue: resourceGroupName, 56 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 57 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 58 return result, validation.NewError("avs.WorkloadNetworksClient", "CreateDhcp", err.Error()) 59 } 60 61 req, err := client.CreateDhcpPreparer(ctx, resourceGroupName, privateCloudName, dhcpID, workloadNetworkDhcp) 62 if err != nil { 63 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateDhcp", nil, "Failure preparing request") 64 return 65 } 66 67 result, err = client.CreateDhcpSender(req) 68 if err != nil { 69 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateDhcp", nil, "Failure sending request") 70 return 71 } 72 73 return 74} 75 76// CreateDhcpPreparer prepares the CreateDhcp request. 77func (client WorkloadNetworksClient) CreateDhcpPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp) (*http.Request, error) { 78 pathParameters := map[string]interface{}{ 79 "dhcpId": autorest.Encode("path", dhcpID), 80 "privateCloudName": autorest.Encode("path", privateCloudName), 81 "resourceGroupName": autorest.Encode("path", resourceGroupName), 82 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 83 } 84 85 const APIVersion = "2021-06-01" 86 queryParameters := map[string]interface{}{ 87 "api-version": APIVersion, 88 } 89 90 preparer := autorest.CreatePreparer( 91 autorest.AsContentType("application/json; charset=utf-8"), 92 autorest.AsPut(), 93 autorest.WithBaseURL(client.BaseURI), 94 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", pathParameters), 95 autorest.WithJSON(workloadNetworkDhcp), 96 autorest.WithQueryParameters(queryParameters)) 97 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 98} 99 100// CreateDhcpSender sends the CreateDhcp request. The method will close the 101// http.Response Body if it receives an error. 102func (client WorkloadNetworksClient) CreateDhcpSender(req *http.Request) (future WorkloadNetworksCreateDhcpFuture, err error) { 103 var resp *http.Response 104 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 105 if err != nil { 106 return 107 } 108 var azf azure.Future 109 azf, err = azure.NewFutureFromResponse(resp) 110 future.FutureAPI = &azf 111 future.Result = future.result 112 return 113} 114 115// CreateDhcpResponder handles the response to the CreateDhcp request. The method always 116// closes the http.Response Body. 117func (client WorkloadNetworksClient) CreateDhcpResponder(resp *http.Response) (result WorkloadNetworkDhcp, err error) { 118 err = autorest.Respond( 119 resp, 120 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 121 autorest.ByUnmarshallingJSON(&result), 122 autorest.ByClosing()) 123 result.Response = autorest.Response{Response: resp} 124 return 125} 126 127// CreateDNSService sends the create dns service request. 128// Parameters: 129// resourceGroupName - the name of the resource group. The name is case insensitive. 130// privateCloudName - name of the private cloud 131// DNSServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name 132// workloadNetworkDNSService - NSX DNS Service 133func (client WorkloadNetworksClient) CreateDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, DNSServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService) (result WorkloadNetworksCreateDNSServiceFuture, err error) { 134 if tracing.IsEnabled() { 135 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.CreateDNSService") 136 defer func() { 137 sc := -1 138 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 139 sc = result.FutureAPI.Response().StatusCode 140 } 141 tracing.EndSpan(ctx, sc, err) 142 }() 143 } 144 if err := validation.Validate([]validation.Validation{ 145 {TargetValue: client.SubscriptionID, 146 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 147 {TargetValue: resourceGroupName, 148 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 149 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 150 return result, validation.NewError("avs.WorkloadNetworksClient", "CreateDNSService", err.Error()) 151 } 152 153 req, err := client.CreateDNSServicePreparer(ctx, resourceGroupName, privateCloudName, DNSServiceID, workloadNetworkDNSService) 154 if err != nil { 155 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateDNSService", nil, "Failure preparing request") 156 return 157 } 158 159 result, err = client.CreateDNSServiceSender(req) 160 if err != nil { 161 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateDNSService", nil, "Failure sending request") 162 return 163 } 164 165 return 166} 167 168// CreateDNSServicePreparer prepares the CreateDNSService request. 169func (client WorkloadNetworksClient) CreateDNSServicePreparer(ctx context.Context, resourceGroupName string, privateCloudName string, DNSServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService) (*http.Request, error) { 170 pathParameters := map[string]interface{}{ 171 "dnsServiceId": autorest.Encode("path", DNSServiceID), 172 "privateCloudName": autorest.Encode("path", privateCloudName), 173 "resourceGroupName": autorest.Encode("path", resourceGroupName), 174 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 175 } 176 177 const APIVersion = "2021-06-01" 178 queryParameters := map[string]interface{}{ 179 "api-version": APIVersion, 180 } 181 182 preparer := autorest.CreatePreparer( 183 autorest.AsContentType("application/json; charset=utf-8"), 184 autorest.AsPut(), 185 autorest.WithBaseURL(client.BaseURI), 186 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", pathParameters), 187 autorest.WithJSON(workloadNetworkDNSService), 188 autorest.WithQueryParameters(queryParameters)) 189 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 190} 191 192// CreateDNSServiceSender sends the CreateDNSService request. The method will close the 193// http.Response Body if it receives an error. 194func (client WorkloadNetworksClient) CreateDNSServiceSender(req *http.Request) (future WorkloadNetworksCreateDNSServiceFuture, err error) { 195 var resp *http.Response 196 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 197 if err != nil { 198 return 199 } 200 var azf azure.Future 201 azf, err = azure.NewFutureFromResponse(resp) 202 future.FutureAPI = &azf 203 future.Result = future.result 204 return 205} 206 207// CreateDNSServiceResponder handles the response to the CreateDNSService request. The method always 208// closes the http.Response Body. 209func (client WorkloadNetworksClient) CreateDNSServiceResponder(resp *http.Response) (result WorkloadNetworkDNSService, err error) { 210 err = autorest.Respond( 211 resp, 212 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 213 autorest.ByUnmarshallingJSON(&result), 214 autorest.ByClosing()) 215 result.Response = autorest.Response{Response: resp} 216 return 217} 218 219// CreateDNSZone sends the create dns zone request. 220// Parameters: 221// resourceGroupName - the name of the resource group. The name is case insensitive. 222// privateCloudName - name of the private cloud 223// DNSZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name 224// workloadNetworkDNSZone - NSX DNS Zone 225func (client WorkloadNetworksClient) CreateDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, DNSZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone) (result WorkloadNetworksCreateDNSZoneFuture, err error) { 226 if tracing.IsEnabled() { 227 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.CreateDNSZone") 228 defer func() { 229 sc := -1 230 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 231 sc = result.FutureAPI.Response().StatusCode 232 } 233 tracing.EndSpan(ctx, sc, err) 234 }() 235 } 236 if err := validation.Validate([]validation.Validation{ 237 {TargetValue: client.SubscriptionID, 238 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 239 {TargetValue: resourceGroupName, 240 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 241 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 242 return result, validation.NewError("avs.WorkloadNetworksClient", "CreateDNSZone", err.Error()) 243 } 244 245 req, err := client.CreateDNSZonePreparer(ctx, resourceGroupName, privateCloudName, DNSZoneID, workloadNetworkDNSZone) 246 if err != nil { 247 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateDNSZone", nil, "Failure preparing request") 248 return 249 } 250 251 result, err = client.CreateDNSZoneSender(req) 252 if err != nil { 253 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateDNSZone", nil, "Failure sending request") 254 return 255 } 256 257 return 258} 259 260// CreateDNSZonePreparer prepares the CreateDNSZone request. 261func (client WorkloadNetworksClient) CreateDNSZonePreparer(ctx context.Context, resourceGroupName string, privateCloudName string, DNSZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone) (*http.Request, error) { 262 pathParameters := map[string]interface{}{ 263 "dnsZoneId": autorest.Encode("path", DNSZoneID), 264 "privateCloudName": autorest.Encode("path", privateCloudName), 265 "resourceGroupName": autorest.Encode("path", resourceGroupName), 266 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 267 } 268 269 const APIVersion = "2021-06-01" 270 queryParameters := map[string]interface{}{ 271 "api-version": APIVersion, 272 } 273 274 preparer := autorest.CreatePreparer( 275 autorest.AsContentType("application/json; charset=utf-8"), 276 autorest.AsPut(), 277 autorest.WithBaseURL(client.BaseURI), 278 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", pathParameters), 279 autorest.WithJSON(workloadNetworkDNSZone), 280 autorest.WithQueryParameters(queryParameters)) 281 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 282} 283 284// CreateDNSZoneSender sends the CreateDNSZone request. The method will close the 285// http.Response Body if it receives an error. 286func (client WorkloadNetworksClient) CreateDNSZoneSender(req *http.Request) (future WorkloadNetworksCreateDNSZoneFuture, err error) { 287 var resp *http.Response 288 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 289 if err != nil { 290 return 291 } 292 var azf azure.Future 293 azf, err = azure.NewFutureFromResponse(resp) 294 future.FutureAPI = &azf 295 future.Result = future.result 296 return 297} 298 299// CreateDNSZoneResponder handles the response to the CreateDNSZone request. The method always 300// closes the http.Response Body. 301func (client WorkloadNetworksClient) CreateDNSZoneResponder(resp *http.Response) (result WorkloadNetworkDNSZone, err error) { 302 err = autorest.Respond( 303 resp, 304 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 305 autorest.ByUnmarshallingJSON(&result), 306 autorest.ByClosing()) 307 result.Response = autorest.Response{Response: resp} 308 return 309} 310 311// CreatePortMirroring sends the create port mirroring request. 312// Parameters: 313// resourceGroupName - the name of the resource group. The name is case insensitive. 314// privateCloudName - name of the private cloud 315// portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name 316// workloadNetworkPortMirroring - NSX port mirroring 317func (client WorkloadNetworksClient) CreatePortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring) (result WorkloadNetworksCreatePortMirroringFuture, err error) { 318 if tracing.IsEnabled() { 319 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.CreatePortMirroring") 320 defer func() { 321 sc := -1 322 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 323 sc = result.FutureAPI.Response().StatusCode 324 } 325 tracing.EndSpan(ctx, sc, err) 326 }() 327 } 328 if err := validation.Validate([]validation.Validation{ 329 {TargetValue: client.SubscriptionID, 330 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 331 {TargetValue: resourceGroupName, 332 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 333 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 334 return result, validation.NewError("avs.WorkloadNetworksClient", "CreatePortMirroring", err.Error()) 335 } 336 337 req, err := client.CreatePortMirroringPreparer(ctx, resourceGroupName, privateCloudName, portMirroringID, workloadNetworkPortMirroring) 338 if err != nil { 339 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreatePortMirroring", nil, "Failure preparing request") 340 return 341 } 342 343 result, err = client.CreatePortMirroringSender(req) 344 if err != nil { 345 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreatePortMirroring", nil, "Failure sending request") 346 return 347 } 348 349 return 350} 351 352// CreatePortMirroringPreparer prepares the CreatePortMirroring request. 353func (client WorkloadNetworksClient) CreatePortMirroringPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring) (*http.Request, error) { 354 pathParameters := map[string]interface{}{ 355 "portMirroringId": autorest.Encode("path", portMirroringID), 356 "privateCloudName": autorest.Encode("path", privateCloudName), 357 "resourceGroupName": autorest.Encode("path", resourceGroupName), 358 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 359 } 360 361 const APIVersion = "2021-06-01" 362 queryParameters := map[string]interface{}{ 363 "api-version": APIVersion, 364 } 365 366 preparer := autorest.CreatePreparer( 367 autorest.AsContentType("application/json; charset=utf-8"), 368 autorest.AsPut(), 369 autorest.WithBaseURL(client.BaseURI), 370 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", pathParameters), 371 autorest.WithJSON(workloadNetworkPortMirroring), 372 autorest.WithQueryParameters(queryParameters)) 373 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 374} 375 376// CreatePortMirroringSender sends the CreatePortMirroring request. The method will close the 377// http.Response Body if it receives an error. 378func (client WorkloadNetworksClient) CreatePortMirroringSender(req *http.Request) (future WorkloadNetworksCreatePortMirroringFuture, err error) { 379 var resp *http.Response 380 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 381 if err != nil { 382 return 383 } 384 var azf azure.Future 385 azf, err = azure.NewFutureFromResponse(resp) 386 future.FutureAPI = &azf 387 future.Result = future.result 388 return 389} 390 391// CreatePortMirroringResponder handles the response to the CreatePortMirroring request. The method always 392// closes the http.Response Body. 393func (client WorkloadNetworksClient) CreatePortMirroringResponder(resp *http.Response) (result WorkloadNetworkPortMirroring, err error) { 394 err = autorest.Respond( 395 resp, 396 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 397 autorest.ByUnmarshallingJSON(&result), 398 autorest.ByClosing()) 399 result.Response = autorest.Response{Response: resp} 400 return 401} 402 403// CreatePublicIP sends the create public ip request. 404// Parameters: 405// resourceGroupName - the name of the resource group. The name is case insensitive. 406// privateCloudName - name of the private cloud 407// publicIPID - NSX Public IP Block identifier. Generally the same as the Public IP Block's display name 408// workloadNetworkPublicIP - NSX Public IP Block 409func (client WorkloadNetworksClient) CreatePublicIP(ctx context.Context, resourceGroupName string, privateCloudName string, publicIPID string, workloadNetworkPublicIP WorkloadNetworkPublicIP) (result WorkloadNetworksCreatePublicIPFuture, err error) { 410 if tracing.IsEnabled() { 411 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.CreatePublicIP") 412 defer func() { 413 sc := -1 414 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 415 sc = result.FutureAPI.Response().StatusCode 416 } 417 tracing.EndSpan(ctx, sc, err) 418 }() 419 } 420 if err := validation.Validate([]validation.Validation{ 421 {TargetValue: client.SubscriptionID, 422 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 423 {TargetValue: resourceGroupName, 424 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 425 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 426 return result, validation.NewError("avs.WorkloadNetworksClient", "CreatePublicIP", err.Error()) 427 } 428 429 req, err := client.CreatePublicIPPreparer(ctx, resourceGroupName, privateCloudName, publicIPID, workloadNetworkPublicIP) 430 if err != nil { 431 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreatePublicIP", nil, "Failure preparing request") 432 return 433 } 434 435 result, err = client.CreatePublicIPSender(req) 436 if err != nil { 437 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreatePublicIP", nil, "Failure sending request") 438 return 439 } 440 441 return 442} 443 444// CreatePublicIPPreparer prepares the CreatePublicIP request. 445func (client WorkloadNetworksClient) CreatePublicIPPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, publicIPID string, workloadNetworkPublicIP WorkloadNetworkPublicIP) (*http.Request, error) { 446 pathParameters := map[string]interface{}{ 447 "privateCloudName": autorest.Encode("path", privateCloudName), 448 "publicIPId": autorest.Encode("path", publicIPID), 449 "resourceGroupName": autorest.Encode("path", resourceGroupName), 450 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 451 } 452 453 const APIVersion = "2021-06-01" 454 queryParameters := map[string]interface{}{ 455 "api-version": APIVersion, 456 } 457 458 preparer := autorest.CreatePreparer( 459 autorest.AsContentType("application/json; charset=utf-8"), 460 autorest.AsPut(), 461 autorest.WithBaseURL(client.BaseURI), 462 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", pathParameters), 463 autorest.WithJSON(workloadNetworkPublicIP), 464 autorest.WithQueryParameters(queryParameters)) 465 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 466} 467 468// CreatePublicIPSender sends the CreatePublicIP request. The method will close the 469// http.Response Body if it receives an error. 470func (client WorkloadNetworksClient) CreatePublicIPSender(req *http.Request) (future WorkloadNetworksCreatePublicIPFuture, err error) { 471 var resp *http.Response 472 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 473 if err != nil { 474 return 475 } 476 var azf azure.Future 477 azf, err = azure.NewFutureFromResponse(resp) 478 future.FutureAPI = &azf 479 future.Result = future.result 480 return 481} 482 483// CreatePublicIPResponder handles the response to the CreatePublicIP request. The method always 484// closes the http.Response Body. 485func (client WorkloadNetworksClient) CreatePublicIPResponder(resp *http.Response) (result WorkloadNetworkPublicIP, err error) { 486 err = autorest.Respond( 487 resp, 488 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 489 autorest.ByUnmarshallingJSON(&result), 490 autorest.ByClosing()) 491 result.Response = autorest.Response{Response: resp} 492 return 493} 494 495// CreateSegments sends the create segments request. 496// Parameters: 497// resourceGroupName - the name of the resource group. The name is case insensitive. 498// privateCloudName - name of the private cloud 499// segmentID - NSX Segment identifier. Generally the same as the Segment's display name 500// workloadNetworkSegment - NSX Segment 501func (client WorkloadNetworksClient) CreateSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment) (result WorkloadNetworksCreateSegmentsFuture, err error) { 502 if tracing.IsEnabled() { 503 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.CreateSegments") 504 defer func() { 505 sc := -1 506 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 507 sc = result.FutureAPI.Response().StatusCode 508 } 509 tracing.EndSpan(ctx, sc, err) 510 }() 511 } 512 if err := validation.Validate([]validation.Validation{ 513 {TargetValue: client.SubscriptionID, 514 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 515 {TargetValue: resourceGroupName, 516 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 517 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 518 return result, validation.NewError("avs.WorkloadNetworksClient", "CreateSegments", err.Error()) 519 } 520 521 req, err := client.CreateSegmentsPreparer(ctx, resourceGroupName, privateCloudName, segmentID, workloadNetworkSegment) 522 if err != nil { 523 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateSegments", nil, "Failure preparing request") 524 return 525 } 526 527 result, err = client.CreateSegmentsSender(req) 528 if err != nil { 529 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateSegments", nil, "Failure sending request") 530 return 531 } 532 533 return 534} 535 536// CreateSegmentsPreparer prepares the CreateSegments request. 537func (client WorkloadNetworksClient) CreateSegmentsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment) (*http.Request, error) { 538 pathParameters := map[string]interface{}{ 539 "privateCloudName": autorest.Encode("path", privateCloudName), 540 "resourceGroupName": autorest.Encode("path", resourceGroupName), 541 "segmentId": autorest.Encode("path", segmentID), 542 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 543 } 544 545 const APIVersion = "2021-06-01" 546 queryParameters := map[string]interface{}{ 547 "api-version": APIVersion, 548 } 549 550 preparer := autorest.CreatePreparer( 551 autorest.AsContentType("application/json; charset=utf-8"), 552 autorest.AsPut(), 553 autorest.WithBaseURL(client.BaseURI), 554 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", pathParameters), 555 autorest.WithJSON(workloadNetworkSegment), 556 autorest.WithQueryParameters(queryParameters)) 557 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 558} 559 560// CreateSegmentsSender sends the CreateSegments request. The method will close the 561// http.Response Body if it receives an error. 562func (client WorkloadNetworksClient) CreateSegmentsSender(req *http.Request) (future WorkloadNetworksCreateSegmentsFuture, err error) { 563 var resp *http.Response 564 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 565 if err != nil { 566 return 567 } 568 var azf azure.Future 569 azf, err = azure.NewFutureFromResponse(resp) 570 future.FutureAPI = &azf 571 future.Result = future.result 572 return 573} 574 575// CreateSegmentsResponder handles the response to the CreateSegments request. The method always 576// closes the http.Response Body. 577func (client WorkloadNetworksClient) CreateSegmentsResponder(resp *http.Response) (result WorkloadNetworkSegment, err error) { 578 err = autorest.Respond( 579 resp, 580 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 581 autorest.ByUnmarshallingJSON(&result), 582 autorest.ByClosing()) 583 result.Response = autorest.Response{Response: resp} 584 return 585} 586 587// CreateVMGroup sends the create vm group request. 588// Parameters: 589// resourceGroupName - the name of the resource group. The name is case insensitive. 590// privateCloudName - name of the private cloud 591// VMGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name 592// workloadNetworkVMGroup - NSX VM Group 593func (client WorkloadNetworksClient) CreateVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, VMGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup) (result WorkloadNetworksCreateVMGroupFuture, err error) { 594 if tracing.IsEnabled() { 595 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.CreateVMGroup") 596 defer func() { 597 sc := -1 598 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 599 sc = result.FutureAPI.Response().StatusCode 600 } 601 tracing.EndSpan(ctx, sc, err) 602 }() 603 } 604 if err := validation.Validate([]validation.Validation{ 605 {TargetValue: client.SubscriptionID, 606 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 607 {TargetValue: resourceGroupName, 608 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 609 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 610 return result, validation.NewError("avs.WorkloadNetworksClient", "CreateVMGroup", err.Error()) 611 } 612 613 req, err := client.CreateVMGroupPreparer(ctx, resourceGroupName, privateCloudName, VMGroupID, workloadNetworkVMGroup) 614 if err != nil { 615 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateVMGroup", nil, "Failure preparing request") 616 return 617 } 618 619 result, err = client.CreateVMGroupSender(req) 620 if err != nil { 621 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "CreateVMGroup", nil, "Failure sending request") 622 return 623 } 624 625 return 626} 627 628// CreateVMGroupPreparer prepares the CreateVMGroup request. 629func (client WorkloadNetworksClient) CreateVMGroupPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, VMGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup) (*http.Request, error) { 630 pathParameters := map[string]interface{}{ 631 "privateCloudName": autorest.Encode("path", privateCloudName), 632 "resourceGroupName": autorest.Encode("path", resourceGroupName), 633 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 634 "vmGroupId": autorest.Encode("path", VMGroupID), 635 } 636 637 const APIVersion = "2021-06-01" 638 queryParameters := map[string]interface{}{ 639 "api-version": APIVersion, 640 } 641 642 preparer := autorest.CreatePreparer( 643 autorest.AsContentType("application/json; charset=utf-8"), 644 autorest.AsPut(), 645 autorest.WithBaseURL(client.BaseURI), 646 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", pathParameters), 647 autorest.WithJSON(workloadNetworkVMGroup), 648 autorest.WithQueryParameters(queryParameters)) 649 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 650} 651 652// CreateVMGroupSender sends the CreateVMGroup request. The method will close the 653// http.Response Body if it receives an error. 654func (client WorkloadNetworksClient) CreateVMGroupSender(req *http.Request) (future WorkloadNetworksCreateVMGroupFuture, err error) { 655 var resp *http.Response 656 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 657 if err != nil { 658 return 659 } 660 var azf azure.Future 661 azf, err = azure.NewFutureFromResponse(resp) 662 future.FutureAPI = &azf 663 future.Result = future.result 664 return 665} 666 667// CreateVMGroupResponder handles the response to the CreateVMGroup request. The method always 668// closes the http.Response Body. 669func (client WorkloadNetworksClient) CreateVMGroupResponder(resp *http.Response) (result WorkloadNetworkVMGroup, err error) { 670 err = autorest.Respond( 671 resp, 672 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 673 autorest.ByUnmarshallingJSON(&result), 674 autorest.ByClosing()) 675 result.Response = autorest.Response{Response: resp} 676 return 677} 678 679// DeleteDhcp sends the delete dhcp request. 680// Parameters: 681// resourceGroupName - the name of the resource group. The name is case insensitive. 682// privateCloudName - name of the private cloud 683// dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name 684func (client WorkloadNetworksClient) DeleteDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string) (result WorkloadNetworksDeleteDhcpFuture, err error) { 685 if tracing.IsEnabled() { 686 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.DeleteDhcp") 687 defer func() { 688 sc := -1 689 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 690 sc = result.FutureAPI.Response().StatusCode 691 } 692 tracing.EndSpan(ctx, sc, err) 693 }() 694 } 695 if err := validation.Validate([]validation.Validation{ 696 {TargetValue: client.SubscriptionID, 697 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 698 {TargetValue: resourceGroupName, 699 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 700 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 701 return result, validation.NewError("avs.WorkloadNetworksClient", "DeleteDhcp", err.Error()) 702 } 703 704 req, err := client.DeleteDhcpPreparer(ctx, resourceGroupName, privateCloudName, dhcpID) 705 if err != nil { 706 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteDhcp", nil, "Failure preparing request") 707 return 708 } 709 710 result, err = client.DeleteDhcpSender(req) 711 if err != nil { 712 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteDhcp", nil, "Failure sending request") 713 return 714 } 715 716 return 717} 718 719// DeleteDhcpPreparer prepares the DeleteDhcp request. 720func (client WorkloadNetworksClient) DeleteDhcpPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string) (*http.Request, error) { 721 pathParameters := map[string]interface{}{ 722 "dhcpId": autorest.Encode("path", dhcpID), 723 "privateCloudName": autorest.Encode("path", privateCloudName), 724 "resourceGroupName": autorest.Encode("path", resourceGroupName), 725 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 726 } 727 728 const APIVersion = "2021-06-01" 729 queryParameters := map[string]interface{}{ 730 "api-version": APIVersion, 731 } 732 733 preparer := autorest.CreatePreparer( 734 autorest.AsDelete(), 735 autorest.WithBaseURL(client.BaseURI), 736 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", pathParameters), 737 autorest.WithQueryParameters(queryParameters)) 738 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 739} 740 741// DeleteDhcpSender sends the DeleteDhcp request. The method will close the 742// http.Response Body if it receives an error. 743func (client WorkloadNetworksClient) DeleteDhcpSender(req *http.Request) (future WorkloadNetworksDeleteDhcpFuture, err error) { 744 var resp *http.Response 745 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 746 if err != nil { 747 return 748 } 749 var azf azure.Future 750 azf, err = azure.NewFutureFromResponse(resp) 751 future.FutureAPI = &azf 752 future.Result = future.result 753 return 754} 755 756// DeleteDhcpResponder handles the response to the DeleteDhcp request. The method always 757// closes the http.Response Body. 758func (client WorkloadNetworksClient) DeleteDhcpResponder(resp *http.Response) (result autorest.Response, err error) { 759 err = autorest.Respond( 760 resp, 761 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 762 autorest.ByClosing()) 763 result.Response = resp 764 return 765} 766 767// DeleteDNSService sends the delete dns service request. 768// Parameters: 769// resourceGroupName - the name of the resource group. The name is case insensitive. 770// DNSServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name 771// privateCloudName - name of the private cloud 772func (client WorkloadNetworksClient) DeleteDNSService(ctx context.Context, resourceGroupName string, DNSServiceID string, privateCloudName string) (result WorkloadNetworksDeleteDNSServiceFuture, err error) { 773 if tracing.IsEnabled() { 774 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.DeleteDNSService") 775 defer func() { 776 sc := -1 777 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 778 sc = result.FutureAPI.Response().StatusCode 779 } 780 tracing.EndSpan(ctx, sc, err) 781 }() 782 } 783 if err := validation.Validate([]validation.Validation{ 784 {TargetValue: client.SubscriptionID, 785 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 786 {TargetValue: resourceGroupName, 787 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 788 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 789 return result, validation.NewError("avs.WorkloadNetworksClient", "DeleteDNSService", err.Error()) 790 } 791 792 req, err := client.DeleteDNSServicePreparer(ctx, resourceGroupName, DNSServiceID, privateCloudName) 793 if err != nil { 794 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteDNSService", nil, "Failure preparing request") 795 return 796 } 797 798 result, err = client.DeleteDNSServiceSender(req) 799 if err != nil { 800 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteDNSService", nil, "Failure sending request") 801 return 802 } 803 804 return 805} 806 807// DeleteDNSServicePreparer prepares the DeleteDNSService request. 808func (client WorkloadNetworksClient) DeleteDNSServicePreparer(ctx context.Context, resourceGroupName string, DNSServiceID string, privateCloudName string) (*http.Request, error) { 809 pathParameters := map[string]interface{}{ 810 "dnsServiceId": autorest.Encode("path", DNSServiceID), 811 "privateCloudName": autorest.Encode("path", privateCloudName), 812 "resourceGroupName": autorest.Encode("path", resourceGroupName), 813 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 814 } 815 816 const APIVersion = "2021-06-01" 817 queryParameters := map[string]interface{}{ 818 "api-version": APIVersion, 819 } 820 821 preparer := autorest.CreatePreparer( 822 autorest.AsDelete(), 823 autorest.WithBaseURL(client.BaseURI), 824 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", pathParameters), 825 autorest.WithQueryParameters(queryParameters)) 826 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 827} 828 829// DeleteDNSServiceSender sends the DeleteDNSService request. The method will close the 830// http.Response Body if it receives an error. 831func (client WorkloadNetworksClient) DeleteDNSServiceSender(req *http.Request) (future WorkloadNetworksDeleteDNSServiceFuture, err error) { 832 var resp *http.Response 833 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 834 if err != nil { 835 return 836 } 837 var azf azure.Future 838 azf, err = azure.NewFutureFromResponse(resp) 839 future.FutureAPI = &azf 840 future.Result = future.result 841 return 842} 843 844// DeleteDNSServiceResponder handles the response to the DeleteDNSService request. The method always 845// closes the http.Response Body. 846func (client WorkloadNetworksClient) DeleteDNSServiceResponder(resp *http.Response) (result autorest.Response, err error) { 847 err = autorest.Respond( 848 resp, 849 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 850 autorest.ByClosing()) 851 result.Response = resp 852 return 853} 854 855// DeleteDNSZone sends the delete dns zone request. 856// Parameters: 857// resourceGroupName - the name of the resource group. The name is case insensitive. 858// DNSZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name 859// privateCloudName - name of the private cloud 860func (client WorkloadNetworksClient) DeleteDNSZone(ctx context.Context, resourceGroupName string, DNSZoneID string, privateCloudName string) (result WorkloadNetworksDeleteDNSZoneFuture, err error) { 861 if tracing.IsEnabled() { 862 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.DeleteDNSZone") 863 defer func() { 864 sc := -1 865 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 866 sc = result.FutureAPI.Response().StatusCode 867 } 868 tracing.EndSpan(ctx, sc, err) 869 }() 870 } 871 if err := validation.Validate([]validation.Validation{ 872 {TargetValue: client.SubscriptionID, 873 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 874 {TargetValue: resourceGroupName, 875 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 876 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 877 return result, validation.NewError("avs.WorkloadNetworksClient", "DeleteDNSZone", err.Error()) 878 } 879 880 req, err := client.DeleteDNSZonePreparer(ctx, resourceGroupName, DNSZoneID, privateCloudName) 881 if err != nil { 882 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteDNSZone", nil, "Failure preparing request") 883 return 884 } 885 886 result, err = client.DeleteDNSZoneSender(req) 887 if err != nil { 888 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteDNSZone", nil, "Failure sending request") 889 return 890 } 891 892 return 893} 894 895// DeleteDNSZonePreparer prepares the DeleteDNSZone request. 896func (client WorkloadNetworksClient) DeleteDNSZonePreparer(ctx context.Context, resourceGroupName string, DNSZoneID string, privateCloudName string) (*http.Request, error) { 897 pathParameters := map[string]interface{}{ 898 "dnsZoneId": autorest.Encode("path", DNSZoneID), 899 "privateCloudName": autorest.Encode("path", privateCloudName), 900 "resourceGroupName": autorest.Encode("path", resourceGroupName), 901 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 902 } 903 904 const APIVersion = "2021-06-01" 905 queryParameters := map[string]interface{}{ 906 "api-version": APIVersion, 907 } 908 909 preparer := autorest.CreatePreparer( 910 autorest.AsDelete(), 911 autorest.WithBaseURL(client.BaseURI), 912 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", pathParameters), 913 autorest.WithQueryParameters(queryParameters)) 914 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 915} 916 917// DeleteDNSZoneSender sends the DeleteDNSZone request. The method will close the 918// http.Response Body if it receives an error. 919func (client WorkloadNetworksClient) DeleteDNSZoneSender(req *http.Request) (future WorkloadNetworksDeleteDNSZoneFuture, err error) { 920 var resp *http.Response 921 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 922 if err != nil { 923 return 924 } 925 var azf azure.Future 926 azf, err = azure.NewFutureFromResponse(resp) 927 future.FutureAPI = &azf 928 future.Result = future.result 929 return 930} 931 932// DeleteDNSZoneResponder handles the response to the DeleteDNSZone request. The method always 933// closes the http.Response Body. 934func (client WorkloadNetworksClient) DeleteDNSZoneResponder(resp *http.Response) (result autorest.Response, err error) { 935 err = autorest.Respond( 936 resp, 937 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 938 autorest.ByClosing()) 939 result.Response = resp 940 return 941} 942 943// DeletePortMirroring sends the delete port mirroring request. 944// Parameters: 945// resourceGroupName - the name of the resource group. The name is case insensitive. 946// portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name 947// privateCloudName - name of the private cloud 948func (client WorkloadNetworksClient) DeletePortMirroring(ctx context.Context, resourceGroupName string, portMirroringID string, privateCloudName string) (result WorkloadNetworksDeletePortMirroringFuture, err error) { 949 if tracing.IsEnabled() { 950 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.DeletePortMirroring") 951 defer func() { 952 sc := -1 953 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 954 sc = result.FutureAPI.Response().StatusCode 955 } 956 tracing.EndSpan(ctx, sc, err) 957 }() 958 } 959 if err := validation.Validate([]validation.Validation{ 960 {TargetValue: client.SubscriptionID, 961 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 962 {TargetValue: resourceGroupName, 963 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 964 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 965 return result, validation.NewError("avs.WorkloadNetworksClient", "DeletePortMirroring", err.Error()) 966 } 967 968 req, err := client.DeletePortMirroringPreparer(ctx, resourceGroupName, portMirroringID, privateCloudName) 969 if err != nil { 970 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeletePortMirroring", nil, "Failure preparing request") 971 return 972 } 973 974 result, err = client.DeletePortMirroringSender(req) 975 if err != nil { 976 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeletePortMirroring", nil, "Failure sending request") 977 return 978 } 979 980 return 981} 982 983// DeletePortMirroringPreparer prepares the DeletePortMirroring request. 984func (client WorkloadNetworksClient) DeletePortMirroringPreparer(ctx context.Context, resourceGroupName string, portMirroringID string, privateCloudName string) (*http.Request, error) { 985 pathParameters := map[string]interface{}{ 986 "portMirroringId": autorest.Encode("path", portMirroringID), 987 "privateCloudName": autorest.Encode("path", privateCloudName), 988 "resourceGroupName": autorest.Encode("path", resourceGroupName), 989 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 990 } 991 992 const APIVersion = "2021-06-01" 993 queryParameters := map[string]interface{}{ 994 "api-version": APIVersion, 995 } 996 997 preparer := autorest.CreatePreparer( 998 autorest.AsDelete(), 999 autorest.WithBaseURL(client.BaseURI), 1000 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", pathParameters), 1001 autorest.WithQueryParameters(queryParameters)) 1002 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1003} 1004 1005// DeletePortMirroringSender sends the DeletePortMirroring request. The method will close the 1006// http.Response Body if it receives an error. 1007func (client WorkloadNetworksClient) DeletePortMirroringSender(req *http.Request) (future WorkloadNetworksDeletePortMirroringFuture, err error) { 1008 var resp *http.Response 1009 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1010 if err != nil { 1011 return 1012 } 1013 var azf azure.Future 1014 azf, err = azure.NewFutureFromResponse(resp) 1015 future.FutureAPI = &azf 1016 future.Result = future.result 1017 return 1018} 1019 1020// DeletePortMirroringResponder handles the response to the DeletePortMirroring request. The method always 1021// closes the http.Response Body. 1022func (client WorkloadNetworksClient) DeletePortMirroringResponder(resp *http.Response) (result autorest.Response, err error) { 1023 err = autorest.Respond( 1024 resp, 1025 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 1026 autorest.ByClosing()) 1027 result.Response = resp 1028 return 1029} 1030 1031// DeletePublicIP sends the delete public ip request. 1032// Parameters: 1033// resourceGroupName - the name of the resource group. The name is case insensitive. 1034// publicIPID - NSX Public IP Block identifier. Generally the same as the Public IP Block's display name 1035// privateCloudName - name of the private cloud 1036func (client WorkloadNetworksClient) DeletePublicIP(ctx context.Context, resourceGroupName string, publicIPID string, privateCloudName string) (result WorkloadNetworksDeletePublicIPFuture, err error) { 1037 if tracing.IsEnabled() { 1038 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.DeletePublicIP") 1039 defer func() { 1040 sc := -1 1041 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 1042 sc = result.FutureAPI.Response().StatusCode 1043 } 1044 tracing.EndSpan(ctx, sc, err) 1045 }() 1046 } 1047 if err := validation.Validate([]validation.Validation{ 1048 {TargetValue: client.SubscriptionID, 1049 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1050 {TargetValue: resourceGroupName, 1051 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1052 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1053 return result, validation.NewError("avs.WorkloadNetworksClient", "DeletePublicIP", err.Error()) 1054 } 1055 1056 req, err := client.DeletePublicIPPreparer(ctx, resourceGroupName, publicIPID, privateCloudName) 1057 if err != nil { 1058 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeletePublicIP", nil, "Failure preparing request") 1059 return 1060 } 1061 1062 result, err = client.DeletePublicIPSender(req) 1063 if err != nil { 1064 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeletePublicIP", nil, "Failure sending request") 1065 return 1066 } 1067 1068 return 1069} 1070 1071// DeletePublicIPPreparer prepares the DeletePublicIP request. 1072func (client WorkloadNetworksClient) DeletePublicIPPreparer(ctx context.Context, resourceGroupName string, publicIPID string, privateCloudName string) (*http.Request, error) { 1073 pathParameters := map[string]interface{}{ 1074 "privateCloudName": autorest.Encode("path", privateCloudName), 1075 "publicIPId": autorest.Encode("path", publicIPID), 1076 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1077 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1078 } 1079 1080 const APIVersion = "2021-06-01" 1081 queryParameters := map[string]interface{}{ 1082 "api-version": APIVersion, 1083 } 1084 1085 preparer := autorest.CreatePreparer( 1086 autorest.AsDelete(), 1087 autorest.WithBaseURL(client.BaseURI), 1088 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", pathParameters), 1089 autorest.WithQueryParameters(queryParameters)) 1090 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1091} 1092 1093// DeletePublicIPSender sends the DeletePublicIP request. The method will close the 1094// http.Response Body if it receives an error. 1095func (client WorkloadNetworksClient) DeletePublicIPSender(req *http.Request) (future WorkloadNetworksDeletePublicIPFuture, err error) { 1096 var resp *http.Response 1097 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1098 if err != nil { 1099 return 1100 } 1101 var azf azure.Future 1102 azf, err = azure.NewFutureFromResponse(resp) 1103 future.FutureAPI = &azf 1104 future.Result = future.result 1105 return 1106} 1107 1108// DeletePublicIPResponder handles the response to the DeletePublicIP request. The method always 1109// closes the http.Response Body. 1110func (client WorkloadNetworksClient) DeletePublicIPResponder(resp *http.Response) (result autorest.Response, err error) { 1111 err = autorest.Respond( 1112 resp, 1113 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 1114 autorest.ByClosing()) 1115 result.Response = resp 1116 return 1117} 1118 1119// DeleteSegment sends the delete segment request. 1120// Parameters: 1121// resourceGroupName - the name of the resource group. The name is case insensitive. 1122// privateCloudName - name of the private cloud 1123// segmentID - NSX Segment identifier. Generally the same as the Segment's display name 1124func (client WorkloadNetworksClient) DeleteSegment(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string) (result WorkloadNetworksDeleteSegmentFuture, err error) { 1125 if tracing.IsEnabled() { 1126 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.DeleteSegment") 1127 defer func() { 1128 sc := -1 1129 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 1130 sc = result.FutureAPI.Response().StatusCode 1131 } 1132 tracing.EndSpan(ctx, sc, err) 1133 }() 1134 } 1135 if err := validation.Validate([]validation.Validation{ 1136 {TargetValue: client.SubscriptionID, 1137 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1138 {TargetValue: resourceGroupName, 1139 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1140 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1141 return result, validation.NewError("avs.WorkloadNetworksClient", "DeleteSegment", err.Error()) 1142 } 1143 1144 req, err := client.DeleteSegmentPreparer(ctx, resourceGroupName, privateCloudName, segmentID) 1145 if err != nil { 1146 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteSegment", nil, "Failure preparing request") 1147 return 1148 } 1149 1150 result, err = client.DeleteSegmentSender(req) 1151 if err != nil { 1152 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteSegment", nil, "Failure sending request") 1153 return 1154 } 1155 1156 return 1157} 1158 1159// DeleteSegmentPreparer prepares the DeleteSegment request. 1160func (client WorkloadNetworksClient) DeleteSegmentPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string) (*http.Request, error) { 1161 pathParameters := map[string]interface{}{ 1162 "privateCloudName": autorest.Encode("path", privateCloudName), 1163 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1164 "segmentId": autorest.Encode("path", segmentID), 1165 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1166 } 1167 1168 const APIVersion = "2021-06-01" 1169 queryParameters := map[string]interface{}{ 1170 "api-version": APIVersion, 1171 } 1172 1173 preparer := autorest.CreatePreparer( 1174 autorest.AsDelete(), 1175 autorest.WithBaseURL(client.BaseURI), 1176 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", pathParameters), 1177 autorest.WithQueryParameters(queryParameters)) 1178 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1179} 1180 1181// DeleteSegmentSender sends the DeleteSegment request. The method will close the 1182// http.Response Body if it receives an error. 1183func (client WorkloadNetworksClient) DeleteSegmentSender(req *http.Request) (future WorkloadNetworksDeleteSegmentFuture, err error) { 1184 var resp *http.Response 1185 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1186 if err != nil { 1187 return 1188 } 1189 var azf azure.Future 1190 azf, err = azure.NewFutureFromResponse(resp) 1191 future.FutureAPI = &azf 1192 future.Result = future.result 1193 return 1194} 1195 1196// DeleteSegmentResponder handles the response to the DeleteSegment request. The method always 1197// closes the http.Response Body. 1198func (client WorkloadNetworksClient) DeleteSegmentResponder(resp *http.Response) (result autorest.Response, err error) { 1199 err = autorest.Respond( 1200 resp, 1201 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 1202 autorest.ByClosing()) 1203 result.Response = resp 1204 return 1205} 1206 1207// DeleteVMGroup sends the delete vm group request. 1208// Parameters: 1209// resourceGroupName - the name of the resource group. The name is case insensitive. 1210// VMGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name 1211// privateCloudName - name of the private cloud 1212func (client WorkloadNetworksClient) DeleteVMGroup(ctx context.Context, resourceGroupName string, VMGroupID string, privateCloudName string) (result WorkloadNetworksDeleteVMGroupFuture, err error) { 1213 if tracing.IsEnabled() { 1214 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.DeleteVMGroup") 1215 defer func() { 1216 sc := -1 1217 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 1218 sc = result.FutureAPI.Response().StatusCode 1219 } 1220 tracing.EndSpan(ctx, sc, err) 1221 }() 1222 } 1223 if err := validation.Validate([]validation.Validation{ 1224 {TargetValue: client.SubscriptionID, 1225 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1226 {TargetValue: resourceGroupName, 1227 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1228 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1229 return result, validation.NewError("avs.WorkloadNetworksClient", "DeleteVMGroup", err.Error()) 1230 } 1231 1232 req, err := client.DeleteVMGroupPreparer(ctx, resourceGroupName, VMGroupID, privateCloudName) 1233 if err != nil { 1234 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteVMGroup", nil, "Failure preparing request") 1235 return 1236 } 1237 1238 result, err = client.DeleteVMGroupSender(req) 1239 if err != nil { 1240 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "DeleteVMGroup", nil, "Failure sending request") 1241 return 1242 } 1243 1244 return 1245} 1246 1247// DeleteVMGroupPreparer prepares the DeleteVMGroup request. 1248func (client WorkloadNetworksClient) DeleteVMGroupPreparer(ctx context.Context, resourceGroupName string, VMGroupID string, privateCloudName string) (*http.Request, error) { 1249 pathParameters := map[string]interface{}{ 1250 "privateCloudName": autorest.Encode("path", privateCloudName), 1251 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1252 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1253 "vmGroupId": autorest.Encode("path", VMGroupID), 1254 } 1255 1256 const APIVersion = "2021-06-01" 1257 queryParameters := map[string]interface{}{ 1258 "api-version": APIVersion, 1259 } 1260 1261 preparer := autorest.CreatePreparer( 1262 autorest.AsDelete(), 1263 autorest.WithBaseURL(client.BaseURI), 1264 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", pathParameters), 1265 autorest.WithQueryParameters(queryParameters)) 1266 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1267} 1268 1269// DeleteVMGroupSender sends the DeleteVMGroup request. The method will close the 1270// http.Response Body if it receives an error. 1271func (client WorkloadNetworksClient) DeleteVMGroupSender(req *http.Request) (future WorkloadNetworksDeleteVMGroupFuture, err error) { 1272 var resp *http.Response 1273 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1274 if err != nil { 1275 return 1276 } 1277 var azf azure.Future 1278 azf, err = azure.NewFutureFromResponse(resp) 1279 future.FutureAPI = &azf 1280 future.Result = future.result 1281 return 1282} 1283 1284// DeleteVMGroupResponder handles the response to the DeleteVMGroup request. The method always 1285// closes the http.Response Body. 1286func (client WorkloadNetworksClient) DeleteVMGroupResponder(resp *http.Response) (result autorest.Response, err error) { 1287 err = autorest.Respond( 1288 resp, 1289 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 1290 autorest.ByClosing()) 1291 result.Response = resp 1292 return 1293} 1294 1295// GetDhcp sends the get dhcp request. 1296// Parameters: 1297// resourceGroupName - the name of the resource group. The name is case insensitive. 1298// dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name 1299// privateCloudName - name of the private cloud 1300func (client WorkloadNetworksClient) GetDhcp(ctx context.Context, resourceGroupName string, dhcpID string, privateCloudName string) (result WorkloadNetworkDhcp, err error) { 1301 if tracing.IsEnabled() { 1302 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetDhcp") 1303 defer func() { 1304 sc := -1 1305 if result.Response.Response != nil { 1306 sc = result.Response.Response.StatusCode 1307 } 1308 tracing.EndSpan(ctx, sc, err) 1309 }() 1310 } 1311 if err := validation.Validate([]validation.Validation{ 1312 {TargetValue: client.SubscriptionID, 1313 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1314 {TargetValue: resourceGroupName, 1315 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1316 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1317 return result, validation.NewError("avs.WorkloadNetworksClient", "GetDhcp", err.Error()) 1318 } 1319 1320 req, err := client.GetDhcpPreparer(ctx, resourceGroupName, dhcpID, privateCloudName) 1321 if err != nil { 1322 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDhcp", nil, "Failure preparing request") 1323 return 1324 } 1325 1326 resp, err := client.GetDhcpSender(req) 1327 if err != nil { 1328 result.Response = autorest.Response{Response: resp} 1329 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDhcp", resp, "Failure sending request") 1330 return 1331 } 1332 1333 result, err = client.GetDhcpResponder(resp) 1334 if err != nil { 1335 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDhcp", resp, "Failure responding to request") 1336 return 1337 } 1338 1339 return 1340} 1341 1342// GetDhcpPreparer prepares the GetDhcp request. 1343func (client WorkloadNetworksClient) GetDhcpPreparer(ctx context.Context, resourceGroupName string, dhcpID string, privateCloudName string) (*http.Request, error) { 1344 pathParameters := map[string]interface{}{ 1345 "dhcpId": autorest.Encode("path", dhcpID), 1346 "privateCloudName": autorest.Encode("path", privateCloudName), 1347 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1348 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1349 } 1350 1351 const APIVersion = "2021-06-01" 1352 queryParameters := map[string]interface{}{ 1353 "api-version": APIVersion, 1354 } 1355 1356 preparer := autorest.CreatePreparer( 1357 autorest.AsGet(), 1358 autorest.WithBaseURL(client.BaseURI), 1359 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", pathParameters), 1360 autorest.WithQueryParameters(queryParameters)) 1361 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1362} 1363 1364// GetDhcpSender sends the GetDhcp request. The method will close the 1365// http.Response Body if it receives an error. 1366func (client WorkloadNetworksClient) GetDhcpSender(req *http.Request) (*http.Response, error) { 1367 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1368} 1369 1370// GetDhcpResponder handles the response to the GetDhcp request. The method always 1371// closes the http.Response Body. 1372func (client WorkloadNetworksClient) GetDhcpResponder(resp *http.Response) (result WorkloadNetworkDhcp, err error) { 1373 err = autorest.Respond( 1374 resp, 1375 azure.WithErrorUnlessStatusCode(http.StatusOK), 1376 autorest.ByUnmarshallingJSON(&result), 1377 autorest.ByClosing()) 1378 result.Response = autorest.Response{Response: resp} 1379 return 1380} 1381 1382// GetDNSService sends the get dns service request. 1383// Parameters: 1384// resourceGroupName - the name of the resource group. The name is case insensitive. 1385// privateCloudName - name of the private cloud 1386// DNSServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name 1387func (client WorkloadNetworksClient) GetDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, DNSServiceID string) (result WorkloadNetworkDNSService, err error) { 1388 if tracing.IsEnabled() { 1389 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetDNSService") 1390 defer func() { 1391 sc := -1 1392 if result.Response.Response != nil { 1393 sc = result.Response.Response.StatusCode 1394 } 1395 tracing.EndSpan(ctx, sc, err) 1396 }() 1397 } 1398 if err := validation.Validate([]validation.Validation{ 1399 {TargetValue: client.SubscriptionID, 1400 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1401 {TargetValue: resourceGroupName, 1402 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1403 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1404 return result, validation.NewError("avs.WorkloadNetworksClient", "GetDNSService", err.Error()) 1405 } 1406 1407 req, err := client.GetDNSServicePreparer(ctx, resourceGroupName, privateCloudName, DNSServiceID) 1408 if err != nil { 1409 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDNSService", nil, "Failure preparing request") 1410 return 1411 } 1412 1413 resp, err := client.GetDNSServiceSender(req) 1414 if err != nil { 1415 result.Response = autorest.Response{Response: resp} 1416 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDNSService", resp, "Failure sending request") 1417 return 1418 } 1419 1420 result, err = client.GetDNSServiceResponder(resp) 1421 if err != nil { 1422 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDNSService", resp, "Failure responding to request") 1423 return 1424 } 1425 1426 return 1427} 1428 1429// GetDNSServicePreparer prepares the GetDNSService request. 1430func (client WorkloadNetworksClient) GetDNSServicePreparer(ctx context.Context, resourceGroupName string, privateCloudName string, DNSServiceID string) (*http.Request, error) { 1431 pathParameters := map[string]interface{}{ 1432 "dnsServiceId": autorest.Encode("path", DNSServiceID), 1433 "privateCloudName": autorest.Encode("path", privateCloudName), 1434 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1435 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1436 } 1437 1438 const APIVersion = "2021-06-01" 1439 queryParameters := map[string]interface{}{ 1440 "api-version": APIVersion, 1441 } 1442 1443 preparer := autorest.CreatePreparer( 1444 autorest.AsGet(), 1445 autorest.WithBaseURL(client.BaseURI), 1446 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", pathParameters), 1447 autorest.WithQueryParameters(queryParameters)) 1448 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1449} 1450 1451// GetDNSServiceSender sends the GetDNSService request. The method will close the 1452// http.Response Body if it receives an error. 1453func (client WorkloadNetworksClient) GetDNSServiceSender(req *http.Request) (*http.Response, error) { 1454 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1455} 1456 1457// GetDNSServiceResponder handles the response to the GetDNSService request. The method always 1458// closes the http.Response Body. 1459func (client WorkloadNetworksClient) GetDNSServiceResponder(resp *http.Response) (result WorkloadNetworkDNSService, err error) { 1460 err = autorest.Respond( 1461 resp, 1462 azure.WithErrorUnlessStatusCode(http.StatusOK), 1463 autorest.ByUnmarshallingJSON(&result), 1464 autorest.ByClosing()) 1465 result.Response = autorest.Response{Response: resp} 1466 return 1467} 1468 1469// GetDNSZone sends the get dns zone request. 1470// Parameters: 1471// resourceGroupName - the name of the resource group. The name is case insensitive. 1472// privateCloudName - name of the private cloud 1473// DNSZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name 1474func (client WorkloadNetworksClient) GetDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, DNSZoneID string) (result WorkloadNetworkDNSZone, err error) { 1475 if tracing.IsEnabled() { 1476 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetDNSZone") 1477 defer func() { 1478 sc := -1 1479 if result.Response.Response != nil { 1480 sc = result.Response.Response.StatusCode 1481 } 1482 tracing.EndSpan(ctx, sc, err) 1483 }() 1484 } 1485 if err := validation.Validate([]validation.Validation{ 1486 {TargetValue: client.SubscriptionID, 1487 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1488 {TargetValue: resourceGroupName, 1489 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1490 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1491 return result, validation.NewError("avs.WorkloadNetworksClient", "GetDNSZone", err.Error()) 1492 } 1493 1494 req, err := client.GetDNSZonePreparer(ctx, resourceGroupName, privateCloudName, DNSZoneID) 1495 if err != nil { 1496 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDNSZone", nil, "Failure preparing request") 1497 return 1498 } 1499 1500 resp, err := client.GetDNSZoneSender(req) 1501 if err != nil { 1502 result.Response = autorest.Response{Response: resp} 1503 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDNSZone", resp, "Failure sending request") 1504 return 1505 } 1506 1507 result, err = client.GetDNSZoneResponder(resp) 1508 if err != nil { 1509 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetDNSZone", resp, "Failure responding to request") 1510 return 1511 } 1512 1513 return 1514} 1515 1516// GetDNSZonePreparer prepares the GetDNSZone request. 1517func (client WorkloadNetworksClient) GetDNSZonePreparer(ctx context.Context, resourceGroupName string, privateCloudName string, DNSZoneID string) (*http.Request, error) { 1518 pathParameters := map[string]interface{}{ 1519 "dnsZoneId": autorest.Encode("path", DNSZoneID), 1520 "privateCloudName": autorest.Encode("path", privateCloudName), 1521 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1522 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1523 } 1524 1525 const APIVersion = "2021-06-01" 1526 queryParameters := map[string]interface{}{ 1527 "api-version": APIVersion, 1528 } 1529 1530 preparer := autorest.CreatePreparer( 1531 autorest.AsGet(), 1532 autorest.WithBaseURL(client.BaseURI), 1533 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", pathParameters), 1534 autorest.WithQueryParameters(queryParameters)) 1535 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1536} 1537 1538// GetDNSZoneSender sends the GetDNSZone request. The method will close the 1539// http.Response Body if it receives an error. 1540func (client WorkloadNetworksClient) GetDNSZoneSender(req *http.Request) (*http.Response, error) { 1541 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1542} 1543 1544// GetDNSZoneResponder handles the response to the GetDNSZone request. The method always 1545// closes the http.Response Body. 1546func (client WorkloadNetworksClient) GetDNSZoneResponder(resp *http.Response) (result WorkloadNetworkDNSZone, err error) { 1547 err = autorest.Respond( 1548 resp, 1549 azure.WithErrorUnlessStatusCode(http.StatusOK), 1550 autorest.ByUnmarshallingJSON(&result), 1551 autorest.ByClosing()) 1552 result.Response = autorest.Response{Response: resp} 1553 return 1554} 1555 1556// GetGateway sends the get gateway request. 1557// Parameters: 1558// resourceGroupName - the name of the resource group. The name is case insensitive. 1559// privateCloudName - name of the private cloud 1560// gatewayID - NSX Gateway identifier. Generally the same as the Gateway's display name 1561func (client WorkloadNetworksClient) GetGateway(ctx context.Context, resourceGroupName string, privateCloudName string, gatewayID string) (result WorkloadNetworkGateway, err error) { 1562 if tracing.IsEnabled() { 1563 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetGateway") 1564 defer func() { 1565 sc := -1 1566 if result.Response.Response != nil { 1567 sc = result.Response.Response.StatusCode 1568 } 1569 tracing.EndSpan(ctx, sc, err) 1570 }() 1571 } 1572 if err := validation.Validate([]validation.Validation{ 1573 {TargetValue: client.SubscriptionID, 1574 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1575 {TargetValue: resourceGroupName, 1576 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1577 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1578 return result, validation.NewError("avs.WorkloadNetworksClient", "GetGateway", err.Error()) 1579 } 1580 1581 req, err := client.GetGatewayPreparer(ctx, resourceGroupName, privateCloudName, gatewayID) 1582 if err != nil { 1583 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetGateway", nil, "Failure preparing request") 1584 return 1585 } 1586 1587 resp, err := client.GetGatewaySender(req) 1588 if err != nil { 1589 result.Response = autorest.Response{Response: resp} 1590 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetGateway", resp, "Failure sending request") 1591 return 1592 } 1593 1594 result, err = client.GetGatewayResponder(resp) 1595 if err != nil { 1596 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetGateway", resp, "Failure responding to request") 1597 return 1598 } 1599 1600 return 1601} 1602 1603// GetGatewayPreparer prepares the GetGateway request. 1604func (client WorkloadNetworksClient) GetGatewayPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, gatewayID string) (*http.Request, error) { 1605 pathParameters := map[string]interface{}{ 1606 "gatewayId": autorest.Encode("path", gatewayID), 1607 "privateCloudName": autorest.Encode("path", privateCloudName), 1608 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1609 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1610 } 1611 1612 const APIVersion = "2021-06-01" 1613 queryParameters := map[string]interface{}{ 1614 "api-version": APIVersion, 1615 } 1616 1617 preparer := autorest.CreatePreparer( 1618 autorest.AsGet(), 1619 autorest.WithBaseURL(client.BaseURI), 1620 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}", pathParameters), 1621 autorest.WithQueryParameters(queryParameters)) 1622 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1623} 1624 1625// GetGatewaySender sends the GetGateway request. The method will close the 1626// http.Response Body if it receives an error. 1627func (client WorkloadNetworksClient) GetGatewaySender(req *http.Request) (*http.Response, error) { 1628 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1629} 1630 1631// GetGatewayResponder handles the response to the GetGateway request. The method always 1632// closes the http.Response Body. 1633func (client WorkloadNetworksClient) GetGatewayResponder(resp *http.Response) (result WorkloadNetworkGateway, err error) { 1634 err = autorest.Respond( 1635 resp, 1636 azure.WithErrorUnlessStatusCode(http.StatusOK), 1637 autorest.ByUnmarshallingJSON(&result), 1638 autorest.ByClosing()) 1639 result.Response = autorest.Response{Response: resp} 1640 return 1641} 1642 1643// GetPortMirroring sends the get port mirroring request. 1644// Parameters: 1645// resourceGroupName - the name of the resource group. The name is case insensitive. 1646// privateCloudName - name of the private cloud 1647// portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name 1648func (client WorkloadNetworksClient) GetPortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string) (result WorkloadNetworkPortMirroring, err error) { 1649 if tracing.IsEnabled() { 1650 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetPortMirroring") 1651 defer func() { 1652 sc := -1 1653 if result.Response.Response != nil { 1654 sc = result.Response.Response.StatusCode 1655 } 1656 tracing.EndSpan(ctx, sc, err) 1657 }() 1658 } 1659 if err := validation.Validate([]validation.Validation{ 1660 {TargetValue: client.SubscriptionID, 1661 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1662 {TargetValue: resourceGroupName, 1663 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1664 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1665 return result, validation.NewError("avs.WorkloadNetworksClient", "GetPortMirroring", err.Error()) 1666 } 1667 1668 req, err := client.GetPortMirroringPreparer(ctx, resourceGroupName, privateCloudName, portMirroringID) 1669 if err != nil { 1670 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetPortMirroring", nil, "Failure preparing request") 1671 return 1672 } 1673 1674 resp, err := client.GetPortMirroringSender(req) 1675 if err != nil { 1676 result.Response = autorest.Response{Response: resp} 1677 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetPortMirroring", resp, "Failure sending request") 1678 return 1679 } 1680 1681 result, err = client.GetPortMirroringResponder(resp) 1682 if err != nil { 1683 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetPortMirroring", resp, "Failure responding to request") 1684 return 1685 } 1686 1687 return 1688} 1689 1690// GetPortMirroringPreparer prepares the GetPortMirroring request. 1691func (client WorkloadNetworksClient) GetPortMirroringPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string) (*http.Request, error) { 1692 pathParameters := map[string]interface{}{ 1693 "portMirroringId": autorest.Encode("path", portMirroringID), 1694 "privateCloudName": autorest.Encode("path", privateCloudName), 1695 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1696 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1697 } 1698 1699 const APIVersion = "2021-06-01" 1700 queryParameters := map[string]interface{}{ 1701 "api-version": APIVersion, 1702 } 1703 1704 preparer := autorest.CreatePreparer( 1705 autorest.AsGet(), 1706 autorest.WithBaseURL(client.BaseURI), 1707 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", pathParameters), 1708 autorest.WithQueryParameters(queryParameters)) 1709 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1710} 1711 1712// GetPortMirroringSender sends the GetPortMirroring request. The method will close the 1713// http.Response Body if it receives an error. 1714func (client WorkloadNetworksClient) GetPortMirroringSender(req *http.Request) (*http.Response, error) { 1715 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1716} 1717 1718// GetPortMirroringResponder handles the response to the GetPortMirroring request. The method always 1719// closes the http.Response Body. 1720func (client WorkloadNetworksClient) GetPortMirroringResponder(resp *http.Response) (result WorkloadNetworkPortMirroring, err error) { 1721 err = autorest.Respond( 1722 resp, 1723 azure.WithErrorUnlessStatusCode(http.StatusOK), 1724 autorest.ByUnmarshallingJSON(&result), 1725 autorest.ByClosing()) 1726 result.Response = autorest.Response{Response: resp} 1727 return 1728} 1729 1730// GetPublicIP sends the get public ip request. 1731// Parameters: 1732// resourceGroupName - the name of the resource group. The name is case insensitive. 1733// privateCloudName - name of the private cloud 1734// publicIPID - NSX Public IP Block identifier. Generally the same as the Public IP Block's display name 1735func (client WorkloadNetworksClient) GetPublicIP(ctx context.Context, resourceGroupName string, privateCloudName string, publicIPID string) (result WorkloadNetworkPublicIP, err error) { 1736 if tracing.IsEnabled() { 1737 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetPublicIP") 1738 defer func() { 1739 sc := -1 1740 if result.Response.Response != nil { 1741 sc = result.Response.Response.StatusCode 1742 } 1743 tracing.EndSpan(ctx, sc, err) 1744 }() 1745 } 1746 if err := validation.Validate([]validation.Validation{ 1747 {TargetValue: client.SubscriptionID, 1748 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1749 {TargetValue: resourceGroupName, 1750 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1751 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1752 return result, validation.NewError("avs.WorkloadNetworksClient", "GetPublicIP", err.Error()) 1753 } 1754 1755 req, err := client.GetPublicIPPreparer(ctx, resourceGroupName, privateCloudName, publicIPID) 1756 if err != nil { 1757 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetPublicIP", nil, "Failure preparing request") 1758 return 1759 } 1760 1761 resp, err := client.GetPublicIPSender(req) 1762 if err != nil { 1763 result.Response = autorest.Response{Response: resp} 1764 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetPublicIP", resp, "Failure sending request") 1765 return 1766 } 1767 1768 result, err = client.GetPublicIPResponder(resp) 1769 if err != nil { 1770 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetPublicIP", resp, "Failure responding to request") 1771 return 1772 } 1773 1774 return 1775} 1776 1777// GetPublicIPPreparer prepares the GetPublicIP request. 1778func (client WorkloadNetworksClient) GetPublicIPPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, publicIPID string) (*http.Request, error) { 1779 pathParameters := map[string]interface{}{ 1780 "privateCloudName": autorest.Encode("path", privateCloudName), 1781 "publicIPId": autorest.Encode("path", publicIPID), 1782 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1783 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1784 } 1785 1786 const APIVersion = "2021-06-01" 1787 queryParameters := map[string]interface{}{ 1788 "api-version": APIVersion, 1789 } 1790 1791 preparer := autorest.CreatePreparer( 1792 autorest.AsGet(), 1793 autorest.WithBaseURL(client.BaseURI), 1794 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", pathParameters), 1795 autorest.WithQueryParameters(queryParameters)) 1796 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1797} 1798 1799// GetPublicIPSender sends the GetPublicIP request. The method will close the 1800// http.Response Body if it receives an error. 1801func (client WorkloadNetworksClient) GetPublicIPSender(req *http.Request) (*http.Response, error) { 1802 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1803} 1804 1805// GetPublicIPResponder handles the response to the GetPublicIP request. The method always 1806// closes the http.Response Body. 1807func (client WorkloadNetworksClient) GetPublicIPResponder(resp *http.Response) (result WorkloadNetworkPublicIP, err error) { 1808 err = autorest.Respond( 1809 resp, 1810 azure.WithErrorUnlessStatusCode(http.StatusOK), 1811 autorest.ByUnmarshallingJSON(&result), 1812 autorest.ByClosing()) 1813 result.Response = autorest.Response{Response: resp} 1814 return 1815} 1816 1817// GetSegment sends the get segment request. 1818// Parameters: 1819// resourceGroupName - the name of the resource group. The name is case insensitive. 1820// privateCloudName - name of the private cloud 1821// segmentID - NSX Segment identifier. Generally the same as the Segment's display name 1822func (client WorkloadNetworksClient) GetSegment(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string) (result WorkloadNetworkSegment, err error) { 1823 if tracing.IsEnabled() { 1824 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetSegment") 1825 defer func() { 1826 sc := -1 1827 if result.Response.Response != nil { 1828 sc = result.Response.Response.StatusCode 1829 } 1830 tracing.EndSpan(ctx, sc, err) 1831 }() 1832 } 1833 if err := validation.Validate([]validation.Validation{ 1834 {TargetValue: client.SubscriptionID, 1835 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1836 {TargetValue: resourceGroupName, 1837 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1838 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1839 return result, validation.NewError("avs.WorkloadNetworksClient", "GetSegment", err.Error()) 1840 } 1841 1842 req, err := client.GetSegmentPreparer(ctx, resourceGroupName, privateCloudName, segmentID) 1843 if err != nil { 1844 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetSegment", nil, "Failure preparing request") 1845 return 1846 } 1847 1848 resp, err := client.GetSegmentSender(req) 1849 if err != nil { 1850 result.Response = autorest.Response{Response: resp} 1851 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetSegment", resp, "Failure sending request") 1852 return 1853 } 1854 1855 result, err = client.GetSegmentResponder(resp) 1856 if err != nil { 1857 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetSegment", resp, "Failure responding to request") 1858 return 1859 } 1860 1861 return 1862} 1863 1864// GetSegmentPreparer prepares the GetSegment request. 1865func (client WorkloadNetworksClient) GetSegmentPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string) (*http.Request, error) { 1866 pathParameters := map[string]interface{}{ 1867 "privateCloudName": autorest.Encode("path", privateCloudName), 1868 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1869 "segmentId": autorest.Encode("path", segmentID), 1870 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1871 } 1872 1873 const APIVersion = "2021-06-01" 1874 queryParameters := map[string]interface{}{ 1875 "api-version": APIVersion, 1876 } 1877 1878 preparer := autorest.CreatePreparer( 1879 autorest.AsGet(), 1880 autorest.WithBaseURL(client.BaseURI), 1881 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", pathParameters), 1882 autorest.WithQueryParameters(queryParameters)) 1883 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1884} 1885 1886// GetSegmentSender sends the GetSegment request. The method will close the 1887// http.Response Body if it receives an error. 1888func (client WorkloadNetworksClient) GetSegmentSender(req *http.Request) (*http.Response, error) { 1889 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1890} 1891 1892// GetSegmentResponder handles the response to the GetSegment request. The method always 1893// closes the http.Response Body. 1894func (client WorkloadNetworksClient) GetSegmentResponder(resp *http.Response) (result WorkloadNetworkSegment, err error) { 1895 err = autorest.Respond( 1896 resp, 1897 azure.WithErrorUnlessStatusCode(http.StatusOK), 1898 autorest.ByUnmarshallingJSON(&result), 1899 autorest.ByClosing()) 1900 result.Response = autorest.Response{Response: resp} 1901 return 1902} 1903 1904// GetVirtualMachine sends the get virtual machine request. 1905// Parameters: 1906// resourceGroupName - the name of the resource group. The name is case insensitive. 1907// privateCloudName - name of the private cloud 1908// virtualMachineID - virtual Machine identifier 1909func (client WorkloadNetworksClient) GetVirtualMachine(ctx context.Context, resourceGroupName string, privateCloudName string, virtualMachineID string) (result WorkloadNetworkVirtualMachine, err error) { 1910 if tracing.IsEnabled() { 1911 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetVirtualMachine") 1912 defer func() { 1913 sc := -1 1914 if result.Response.Response != nil { 1915 sc = result.Response.Response.StatusCode 1916 } 1917 tracing.EndSpan(ctx, sc, err) 1918 }() 1919 } 1920 if err := validation.Validate([]validation.Validation{ 1921 {TargetValue: client.SubscriptionID, 1922 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 1923 {TargetValue: resourceGroupName, 1924 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1925 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 1926 return result, validation.NewError("avs.WorkloadNetworksClient", "GetVirtualMachine", err.Error()) 1927 } 1928 1929 req, err := client.GetVirtualMachinePreparer(ctx, resourceGroupName, privateCloudName, virtualMachineID) 1930 if err != nil { 1931 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetVirtualMachine", nil, "Failure preparing request") 1932 return 1933 } 1934 1935 resp, err := client.GetVirtualMachineSender(req) 1936 if err != nil { 1937 result.Response = autorest.Response{Response: resp} 1938 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetVirtualMachine", resp, "Failure sending request") 1939 return 1940 } 1941 1942 result, err = client.GetVirtualMachineResponder(resp) 1943 if err != nil { 1944 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetVirtualMachine", resp, "Failure responding to request") 1945 return 1946 } 1947 1948 return 1949} 1950 1951// GetVirtualMachinePreparer prepares the GetVirtualMachine request. 1952func (client WorkloadNetworksClient) GetVirtualMachinePreparer(ctx context.Context, resourceGroupName string, privateCloudName string, virtualMachineID string) (*http.Request, error) { 1953 pathParameters := map[string]interface{}{ 1954 "privateCloudName": autorest.Encode("path", privateCloudName), 1955 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1956 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1957 "virtualMachineId": autorest.Encode("path", virtualMachineID), 1958 } 1959 1960 const APIVersion = "2021-06-01" 1961 queryParameters := map[string]interface{}{ 1962 "api-version": APIVersion, 1963 } 1964 1965 preparer := autorest.CreatePreparer( 1966 autorest.AsGet(), 1967 autorest.WithBaseURL(client.BaseURI), 1968 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}", pathParameters), 1969 autorest.WithQueryParameters(queryParameters)) 1970 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1971} 1972 1973// GetVirtualMachineSender sends the GetVirtualMachine request. The method will close the 1974// http.Response Body if it receives an error. 1975func (client WorkloadNetworksClient) GetVirtualMachineSender(req *http.Request) (*http.Response, error) { 1976 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1977} 1978 1979// GetVirtualMachineResponder handles the response to the GetVirtualMachine request. The method always 1980// closes the http.Response Body. 1981func (client WorkloadNetworksClient) GetVirtualMachineResponder(resp *http.Response) (result WorkloadNetworkVirtualMachine, err error) { 1982 err = autorest.Respond( 1983 resp, 1984 azure.WithErrorUnlessStatusCode(http.StatusOK), 1985 autorest.ByUnmarshallingJSON(&result), 1986 autorest.ByClosing()) 1987 result.Response = autorest.Response{Response: resp} 1988 return 1989} 1990 1991// GetVMGroup sends the get vm group request. 1992// Parameters: 1993// resourceGroupName - the name of the resource group. The name is case insensitive. 1994// privateCloudName - name of the private cloud 1995// VMGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name 1996func (client WorkloadNetworksClient) GetVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, VMGroupID string) (result WorkloadNetworkVMGroup, err error) { 1997 if tracing.IsEnabled() { 1998 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.GetVMGroup") 1999 defer func() { 2000 sc := -1 2001 if result.Response.Response != nil { 2002 sc = result.Response.Response.StatusCode 2003 } 2004 tracing.EndSpan(ctx, sc, err) 2005 }() 2006 } 2007 if err := validation.Validate([]validation.Validation{ 2008 {TargetValue: client.SubscriptionID, 2009 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2010 {TargetValue: resourceGroupName, 2011 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2012 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2013 return result, validation.NewError("avs.WorkloadNetworksClient", "GetVMGroup", err.Error()) 2014 } 2015 2016 req, err := client.GetVMGroupPreparer(ctx, resourceGroupName, privateCloudName, VMGroupID) 2017 if err != nil { 2018 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetVMGroup", nil, "Failure preparing request") 2019 return 2020 } 2021 2022 resp, err := client.GetVMGroupSender(req) 2023 if err != nil { 2024 result.Response = autorest.Response{Response: resp} 2025 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetVMGroup", resp, "Failure sending request") 2026 return 2027 } 2028 2029 result, err = client.GetVMGroupResponder(resp) 2030 if err != nil { 2031 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "GetVMGroup", resp, "Failure responding to request") 2032 return 2033 } 2034 2035 return 2036} 2037 2038// GetVMGroupPreparer prepares the GetVMGroup request. 2039func (client WorkloadNetworksClient) GetVMGroupPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, VMGroupID string) (*http.Request, error) { 2040 pathParameters := map[string]interface{}{ 2041 "privateCloudName": autorest.Encode("path", privateCloudName), 2042 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2043 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2044 "vmGroupId": autorest.Encode("path", VMGroupID), 2045 } 2046 2047 const APIVersion = "2021-06-01" 2048 queryParameters := map[string]interface{}{ 2049 "api-version": APIVersion, 2050 } 2051 2052 preparer := autorest.CreatePreparer( 2053 autorest.AsGet(), 2054 autorest.WithBaseURL(client.BaseURI), 2055 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", pathParameters), 2056 autorest.WithQueryParameters(queryParameters)) 2057 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2058} 2059 2060// GetVMGroupSender sends the GetVMGroup request. The method will close the 2061// http.Response Body if it receives an error. 2062func (client WorkloadNetworksClient) GetVMGroupSender(req *http.Request) (*http.Response, error) { 2063 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2064} 2065 2066// GetVMGroupResponder handles the response to the GetVMGroup request. The method always 2067// closes the http.Response Body. 2068func (client WorkloadNetworksClient) GetVMGroupResponder(resp *http.Response) (result WorkloadNetworkVMGroup, err error) { 2069 err = autorest.Respond( 2070 resp, 2071 azure.WithErrorUnlessStatusCode(http.StatusOK), 2072 autorest.ByUnmarshallingJSON(&result), 2073 autorest.ByClosing()) 2074 result.Response = autorest.Response{Response: resp} 2075 return 2076} 2077 2078// ListDhcp sends the list dhcp request. 2079// Parameters: 2080// resourceGroupName - the name of the resource group. The name is case insensitive. 2081// privateCloudName - name of the private cloud 2082func (client WorkloadNetworksClient) ListDhcp(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkDhcpListPage, err error) { 2083 if tracing.IsEnabled() { 2084 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListDhcp") 2085 defer func() { 2086 sc := -1 2087 if result.wndl.Response.Response != nil { 2088 sc = result.wndl.Response.Response.StatusCode 2089 } 2090 tracing.EndSpan(ctx, sc, err) 2091 }() 2092 } 2093 if err := validation.Validate([]validation.Validation{ 2094 {TargetValue: client.SubscriptionID, 2095 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2096 {TargetValue: resourceGroupName, 2097 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2098 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2099 return result, validation.NewError("avs.WorkloadNetworksClient", "ListDhcp", err.Error()) 2100 } 2101 2102 result.fn = client.listDhcpNextResults 2103 req, err := client.ListDhcpPreparer(ctx, resourceGroupName, privateCloudName) 2104 if err != nil { 2105 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDhcp", nil, "Failure preparing request") 2106 return 2107 } 2108 2109 resp, err := client.ListDhcpSender(req) 2110 if err != nil { 2111 result.wndl.Response = autorest.Response{Response: resp} 2112 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDhcp", resp, "Failure sending request") 2113 return 2114 } 2115 2116 result.wndl, err = client.ListDhcpResponder(resp) 2117 if err != nil { 2118 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDhcp", resp, "Failure responding to request") 2119 return 2120 } 2121 if result.wndl.hasNextLink() && result.wndl.IsEmpty() { 2122 err = result.NextWithContext(ctx) 2123 return 2124 } 2125 2126 return 2127} 2128 2129// ListDhcpPreparer prepares the ListDhcp request. 2130func (client WorkloadNetworksClient) ListDhcpPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 2131 pathParameters := map[string]interface{}{ 2132 "privateCloudName": autorest.Encode("path", privateCloudName), 2133 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2134 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2135 } 2136 2137 const APIVersion = "2021-06-01" 2138 queryParameters := map[string]interface{}{ 2139 "api-version": APIVersion, 2140 } 2141 2142 preparer := autorest.CreatePreparer( 2143 autorest.AsGet(), 2144 autorest.WithBaseURL(client.BaseURI), 2145 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations", pathParameters), 2146 autorest.WithQueryParameters(queryParameters)) 2147 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2148} 2149 2150// ListDhcpSender sends the ListDhcp request. The method will close the 2151// http.Response Body if it receives an error. 2152func (client WorkloadNetworksClient) ListDhcpSender(req *http.Request) (*http.Response, error) { 2153 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2154} 2155 2156// ListDhcpResponder handles the response to the ListDhcp request. The method always 2157// closes the http.Response Body. 2158func (client WorkloadNetworksClient) ListDhcpResponder(resp *http.Response) (result WorkloadNetworkDhcpList, err error) { 2159 err = autorest.Respond( 2160 resp, 2161 azure.WithErrorUnlessStatusCode(http.StatusOK), 2162 autorest.ByUnmarshallingJSON(&result), 2163 autorest.ByClosing()) 2164 result.Response = autorest.Response{Response: resp} 2165 return 2166} 2167 2168// listDhcpNextResults retrieves the next set of results, if any. 2169func (client WorkloadNetworksClient) listDhcpNextResults(ctx context.Context, lastResults WorkloadNetworkDhcpList) (result WorkloadNetworkDhcpList, err error) { 2170 req, err := lastResults.workloadNetworkDhcpListPreparer(ctx) 2171 if err != nil { 2172 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDhcpNextResults", nil, "Failure preparing next results request") 2173 } 2174 if req == nil { 2175 return 2176 } 2177 resp, err := client.ListDhcpSender(req) 2178 if err != nil { 2179 result.Response = autorest.Response{Response: resp} 2180 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDhcpNextResults", resp, "Failure sending next results request") 2181 } 2182 result, err = client.ListDhcpResponder(resp) 2183 if err != nil { 2184 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDhcpNextResults", resp, "Failure responding to next results request") 2185 } 2186 return 2187} 2188 2189// ListDhcpComplete enumerates all values, automatically crossing page boundaries as required. 2190func (client WorkloadNetworksClient) ListDhcpComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkDhcpListIterator, err error) { 2191 if tracing.IsEnabled() { 2192 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListDhcp") 2193 defer func() { 2194 sc := -1 2195 if result.Response().Response.Response != nil { 2196 sc = result.page.Response().Response.Response.StatusCode 2197 } 2198 tracing.EndSpan(ctx, sc, err) 2199 }() 2200 } 2201 result.page, err = client.ListDhcp(ctx, resourceGroupName, privateCloudName) 2202 return 2203} 2204 2205// ListDNSServices sends the list dns services request. 2206// Parameters: 2207// resourceGroupName - the name of the resource group. The name is case insensitive. 2208// privateCloudName - name of the private cloud 2209func (client WorkloadNetworksClient) ListDNSServices(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkDNSServicesListPage, err error) { 2210 if tracing.IsEnabled() { 2211 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListDNSServices") 2212 defer func() { 2213 sc := -1 2214 if result.wndsl.Response.Response != nil { 2215 sc = result.wndsl.Response.Response.StatusCode 2216 } 2217 tracing.EndSpan(ctx, sc, err) 2218 }() 2219 } 2220 if err := validation.Validate([]validation.Validation{ 2221 {TargetValue: client.SubscriptionID, 2222 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2223 {TargetValue: resourceGroupName, 2224 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2225 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2226 return result, validation.NewError("avs.WorkloadNetworksClient", "ListDNSServices", err.Error()) 2227 } 2228 2229 result.fn = client.listDNSServicesNextResults 2230 req, err := client.ListDNSServicesPreparer(ctx, resourceGroupName, privateCloudName) 2231 if err != nil { 2232 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDNSServices", nil, "Failure preparing request") 2233 return 2234 } 2235 2236 resp, err := client.ListDNSServicesSender(req) 2237 if err != nil { 2238 result.wndsl.Response = autorest.Response{Response: resp} 2239 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDNSServices", resp, "Failure sending request") 2240 return 2241 } 2242 2243 result.wndsl, err = client.ListDNSServicesResponder(resp) 2244 if err != nil { 2245 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDNSServices", resp, "Failure responding to request") 2246 return 2247 } 2248 if result.wndsl.hasNextLink() && result.wndsl.IsEmpty() { 2249 err = result.NextWithContext(ctx) 2250 return 2251 } 2252 2253 return 2254} 2255 2256// ListDNSServicesPreparer prepares the ListDNSServices request. 2257func (client WorkloadNetworksClient) ListDNSServicesPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 2258 pathParameters := map[string]interface{}{ 2259 "privateCloudName": autorest.Encode("path", privateCloudName), 2260 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2261 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2262 } 2263 2264 const APIVersion = "2021-06-01" 2265 queryParameters := map[string]interface{}{ 2266 "api-version": APIVersion, 2267 } 2268 2269 preparer := autorest.CreatePreparer( 2270 autorest.AsGet(), 2271 autorest.WithBaseURL(client.BaseURI), 2272 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices", pathParameters), 2273 autorest.WithQueryParameters(queryParameters)) 2274 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2275} 2276 2277// ListDNSServicesSender sends the ListDNSServices request. The method will close the 2278// http.Response Body if it receives an error. 2279func (client WorkloadNetworksClient) ListDNSServicesSender(req *http.Request) (*http.Response, error) { 2280 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2281} 2282 2283// ListDNSServicesResponder handles the response to the ListDNSServices request. The method always 2284// closes the http.Response Body. 2285func (client WorkloadNetworksClient) ListDNSServicesResponder(resp *http.Response) (result WorkloadNetworkDNSServicesList, err error) { 2286 err = autorest.Respond( 2287 resp, 2288 azure.WithErrorUnlessStatusCode(http.StatusOK), 2289 autorest.ByUnmarshallingJSON(&result), 2290 autorest.ByClosing()) 2291 result.Response = autorest.Response{Response: resp} 2292 return 2293} 2294 2295// listDNSServicesNextResults retrieves the next set of results, if any. 2296func (client WorkloadNetworksClient) listDNSServicesNextResults(ctx context.Context, lastResults WorkloadNetworkDNSServicesList) (result WorkloadNetworkDNSServicesList, err error) { 2297 req, err := lastResults.workloadNetworkDNSServicesListPreparer(ctx) 2298 if err != nil { 2299 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDNSServicesNextResults", nil, "Failure preparing next results request") 2300 } 2301 if req == nil { 2302 return 2303 } 2304 resp, err := client.ListDNSServicesSender(req) 2305 if err != nil { 2306 result.Response = autorest.Response{Response: resp} 2307 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDNSServicesNextResults", resp, "Failure sending next results request") 2308 } 2309 result, err = client.ListDNSServicesResponder(resp) 2310 if err != nil { 2311 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDNSServicesNextResults", resp, "Failure responding to next results request") 2312 } 2313 return 2314} 2315 2316// ListDNSServicesComplete enumerates all values, automatically crossing page boundaries as required. 2317func (client WorkloadNetworksClient) ListDNSServicesComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkDNSServicesListIterator, err error) { 2318 if tracing.IsEnabled() { 2319 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListDNSServices") 2320 defer func() { 2321 sc := -1 2322 if result.Response().Response.Response != nil { 2323 sc = result.page.Response().Response.Response.StatusCode 2324 } 2325 tracing.EndSpan(ctx, sc, err) 2326 }() 2327 } 2328 result.page, err = client.ListDNSServices(ctx, resourceGroupName, privateCloudName) 2329 return 2330} 2331 2332// ListDNSZones sends the list dns zones request. 2333// Parameters: 2334// resourceGroupName - the name of the resource group. The name is case insensitive. 2335// privateCloudName - name of the private cloud 2336func (client WorkloadNetworksClient) ListDNSZones(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkDNSZonesListPage, err error) { 2337 if tracing.IsEnabled() { 2338 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListDNSZones") 2339 defer func() { 2340 sc := -1 2341 if result.wndzl.Response.Response != nil { 2342 sc = result.wndzl.Response.Response.StatusCode 2343 } 2344 tracing.EndSpan(ctx, sc, err) 2345 }() 2346 } 2347 if err := validation.Validate([]validation.Validation{ 2348 {TargetValue: client.SubscriptionID, 2349 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2350 {TargetValue: resourceGroupName, 2351 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2352 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2353 return result, validation.NewError("avs.WorkloadNetworksClient", "ListDNSZones", err.Error()) 2354 } 2355 2356 result.fn = client.listDNSZonesNextResults 2357 req, err := client.ListDNSZonesPreparer(ctx, resourceGroupName, privateCloudName) 2358 if err != nil { 2359 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDNSZones", nil, "Failure preparing request") 2360 return 2361 } 2362 2363 resp, err := client.ListDNSZonesSender(req) 2364 if err != nil { 2365 result.wndzl.Response = autorest.Response{Response: resp} 2366 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDNSZones", resp, "Failure sending request") 2367 return 2368 } 2369 2370 result.wndzl, err = client.ListDNSZonesResponder(resp) 2371 if err != nil { 2372 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListDNSZones", resp, "Failure responding to request") 2373 return 2374 } 2375 if result.wndzl.hasNextLink() && result.wndzl.IsEmpty() { 2376 err = result.NextWithContext(ctx) 2377 return 2378 } 2379 2380 return 2381} 2382 2383// ListDNSZonesPreparer prepares the ListDNSZones request. 2384func (client WorkloadNetworksClient) ListDNSZonesPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 2385 pathParameters := map[string]interface{}{ 2386 "privateCloudName": autorest.Encode("path", privateCloudName), 2387 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2388 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2389 } 2390 2391 const APIVersion = "2021-06-01" 2392 queryParameters := map[string]interface{}{ 2393 "api-version": APIVersion, 2394 } 2395 2396 preparer := autorest.CreatePreparer( 2397 autorest.AsGet(), 2398 autorest.WithBaseURL(client.BaseURI), 2399 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones", pathParameters), 2400 autorest.WithQueryParameters(queryParameters)) 2401 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2402} 2403 2404// ListDNSZonesSender sends the ListDNSZones request. The method will close the 2405// http.Response Body if it receives an error. 2406func (client WorkloadNetworksClient) ListDNSZonesSender(req *http.Request) (*http.Response, error) { 2407 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2408} 2409 2410// ListDNSZonesResponder handles the response to the ListDNSZones request. The method always 2411// closes the http.Response Body. 2412func (client WorkloadNetworksClient) ListDNSZonesResponder(resp *http.Response) (result WorkloadNetworkDNSZonesList, err error) { 2413 err = autorest.Respond( 2414 resp, 2415 azure.WithErrorUnlessStatusCode(http.StatusOK), 2416 autorest.ByUnmarshallingJSON(&result), 2417 autorest.ByClosing()) 2418 result.Response = autorest.Response{Response: resp} 2419 return 2420} 2421 2422// listDNSZonesNextResults retrieves the next set of results, if any. 2423func (client WorkloadNetworksClient) listDNSZonesNextResults(ctx context.Context, lastResults WorkloadNetworkDNSZonesList) (result WorkloadNetworkDNSZonesList, err error) { 2424 req, err := lastResults.workloadNetworkDNSZonesListPreparer(ctx) 2425 if err != nil { 2426 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDNSZonesNextResults", nil, "Failure preparing next results request") 2427 } 2428 if req == nil { 2429 return 2430 } 2431 resp, err := client.ListDNSZonesSender(req) 2432 if err != nil { 2433 result.Response = autorest.Response{Response: resp} 2434 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDNSZonesNextResults", resp, "Failure sending next results request") 2435 } 2436 result, err = client.ListDNSZonesResponder(resp) 2437 if err != nil { 2438 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listDNSZonesNextResults", resp, "Failure responding to next results request") 2439 } 2440 return 2441} 2442 2443// ListDNSZonesComplete enumerates all values, automatically crossing page boundaries as required. 2444func (client WorkloadNetworksClient) ListDNSZonesComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkDNSZonesListIterator, err error) { 2445 if tracing.IsEnabled() { 2446 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListDNSZones") 2447 defer func() { 2448 sc := -1 2449 if result.Response().Response.Response != nil { 2450 sc = result.page.Response().Response.Response.StatusCode 2451 } 2452 tracing.EndSpan(ctx, sc, err) 2453 }() 2454 } 2455 result.page, err = client.ListDNSZones(ctx, resourceGroupName, privateCloudName) 2456 return 2457} 2458 2459// ListGateways sends the list gateways request. 2460// Parameters: 2461// resourceGroupName - the name of the resource group. The name is case insensitive. 2462// privateCloudName - name of the private cloud 2463func (client WorkloadNetworksClient) ListGateways(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkGatewayListPage, err error) { 2464 if tracing.IsEnabled() { 2465 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListGateways") 2466 defer func() { 2467 sc := -1 2468 if result.wngl.Response.Response != nil { 2469 sc = result.wngl.Response.Response.StatusCode 2470 } 2471 tracing.EndSpan(ctx, sc, err) 2472 }() 2473 } 2474 if err := validation.Validate([]validation.Validation{ 2475 {TargetValue: client.SubscriptionID, 2476 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2477 {TargetValue: resourceGroupName, 2478 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2479 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2480 return result, validation.NewError("avs.WorkloadNetworksClient", "ListGateways", err.Error()) 2481 } 2482 2483 result.fn = client.listGatewaysNextResults 2484 req, err := client.ListGatewaysPreparer(ctx, resourceGroupName, privateCloudName) 2485 if err != nil { 2486 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListGateways", nil, "Failure preparing request") 2487 return 2488 } 2489 2490 resp, err := client.ListGatewaysSender(req) 2491 if err != nil { 2492 result.wngl.Response = autorest.Response{Response: resp} 2493 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListGateways", resp, "Failure sending request") 2494 return 2495 } 2496 2497 result.wngl, err = client.ListGatewaysResponder(resp) 2498 if err != nil { 2499 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListGateways", resp, "Failure responding to request") 2500 return 2501 } 2502 if result.wngl.hasNextLink() && result.wngl.IsEmpty() { 2503 err = result.NextWithContext(ctx) 2504 return 2505 } 2506 2507 return 2508} 2509 2510// ListGatewaysPreparer prepares the ListGateways request. 2511func (client WorkloadNetworksClient) ListGatewaysPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 2512 pathParameters := map[string]interface{}{ 2513 "privateCloudName": autorest.Encode("path", privateCloudName), 2514 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2515 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2516 } 2517 2518 const APIVersion = "2021-06-01" 2519 queryParameters := map[string]interface{}{ 2520 "api-version": APIVersion, 2521 } 2522 2523 preparer := autorest.CreatePreparer( 2524 autorest.AsGet(), 2525 autorest.WithBaseURL(client.BaseURI), 2526 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways", pathParameters), 2527 autorest.WithQueryParameters(queryParameters)) 2528 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2529} 2530 2531// ListGatewaysSender sends the ListGateways request. The method will close the 2532// http.Response Body if it receives an error. 2533func (client WorkloadNetworksClient) ListGatewaysSender(req *http.Request) (*http.Response, error) { 2534 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2535} 2536 2537// ListGatewaysResponder handles the response to the ListGateways request. The method always 2538// closes the http.Response Body. 2539func (client WorkloadNetworksClient) ListGatewaysResponder(resp *http.Response) (result WorkloadNetworkGatewayList, err error) { 2540 err = autorest.Respond( 2541 resp, 2542 azure.WithErrorUnlessStatusCode(http.StatusOK), 2543 autorest.ByUnmarshallingJSON(&result), 2544 autorest.ByClosing()) 2545 result.Response = autorest.Response{Response: resp} 2546 return 2547} 2548 2549// listGatewaysNextResults retrieves the next set of results, if any. 2550func (client WorkloadNetworksClient) listGatewaysNextResults(ctx context.Context, lastResults WorkloadNetworkGatewayList) (result WorkloadNetworkGatewayList, err error) { 2551 req, err := lastResults.workloadNetworkGatewayListPreparer(ctx) 2552 if err != nil { 2553 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listGatewaysNextResults", nil, "Failure preparing next results request") 2554 } 2555 if req == nil { 2556 return 2557 } 2558 resp, err := client.ListGatewaysSender(req) 2559 if err != nil { 2560 result.Response = autorest.Response{Response: resp} 2561 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listGatewaysNextResults", resp, "Failure sending next results request") 2562 } 2563 result, err = client.ListGatewaysResponder(resp) 2564 if err != nil { 2565 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listGatewaysNextResults", resp, "Failure responding to next results request") 2566 } 2567 return 2568} 2569 2570// ListGatewaysComplete enumerates all values, automatically crossing page boundaries as required. 2571func (client WorkloadNetworksClient) ListGatewaysComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkGatewayListIterator, err error) { 2572 if tracing.IsEnabled() { 2573 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListGateways") 2574 defer func() { 2575 sc := -1 2576 if result.Response().Response.Response != nil { 2577 sc = result.page.Response().Response.Response.StatusCode 2578 } 2579 tracing.EndSpan(ctx, sc, err) 2580 }() 2581 } 2582 result.page, err = client.ListGateways(ctx, resourceGroupName, privateCloudName) 2583 return 2584} 2585 2586// ListPortMirroring sends the list port mirroring request. 2587// Parameters: 2588// resourceGroupName - the name of the resource group. The name is case insensitive. 2589// privateCloudName - name of the private cloud 2590func (client WorkloadNetworksClient) ListPortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkPortMirroringListPage, err error) { 2591 if tracing.IsEnabled() { 2592 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListPortMirroring") 2593 defer func() { 2594 sc := -1 2595 if result.wnpml.Response.Response != nil { 2596 sc = result.wnpml.Response.Response.StatusCode 2597 } 2598 tracing.EndSpan(ctx, sc, err) 2599 }() 2600 } 2601 if err := validation.Validate([]validation.Validation{ 2602 {TargetValue: client.SubscriptionID, 2603 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2604 {TargetValue: resourceGroupName, 2605 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2606 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2607 return result, validation.NewError("avs.WorkloadNetworksClient", "ListPortMirroring", err.Error()) 2608 } 2609 2610 result.fn = client.listPortMirroringNextResults 2611 req, err := client.ListPortMirroringPreparer(ctx, resourceGroupName, privateCloudName) 2612 if err != nil { 2613 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListPortMirroring", nil, "Failure preparing request") 2614 return 2615 } 2616 2617 resp, err := client.ListPortMirroringSender(req) 2618 if err != nil { 2619 result.wnpml.Response = autorest.Response{Response: resp} 2620 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListPortMirroring", resp, "Failure sending request") 2621 return 2622 } 2623 2624 result.wnpml, err = client.ListPortMirroringResponder(resp) 2625 if err != nil { 2626 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListPortMirroring", resp, "Failure responding to request") 2627 return 2628 } 2629 if result.wnpml.hasNextLink() && result.wnpml.IsEmpty() { 2630 err = result.NextWithContext(ctx) 2631 return 2632 } 2633 2634 return 2635} 2636 2637// ListPortMirroringPreparer prepares the ListPortMirroring request. 2638func (client WorkloadNetworksClient) ListPortMirroringPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 2639 pathParameters := map[string]interface{}{ 2640 "privateCloudName": autorest.Encode("path", privateCloudName), 2641 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2642 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2643 } 2644 2645 const APIVersion = "2021-06-01" 2646 queryParameters := map[string]interface{}{ 2647 "api-version": APIVersion, 2648 } 2649 2650 preparer := autorest.CreatePreparer( 2651 autorest.AsGet(), 2652 autorest.WithBaseURL(client.BaseURI), 2653 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles", pathParameters), 2654 autorest.WithQueryParameters(queryParameters)) 2655 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2656} 2657 2658// ListPortMirroringSender sends the ListPortMirroring request. The method will close the 2659// http.Response Body if it receives an error. 2660func (client WorkloadNetworksClient) ListPortMirroringSender(req *http.Request) (*http.Response, error) { 2661 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2662} 2663 2664// ListPortMirroringResponder handles the response to the ListPortMirroring request. The method always 2665// closes the http.Response Body. 2666func (client WorkloadNetworksClient) ListPortMirroringResponder(resp *http.Response) (result WorkloadNetworkPortMirroringList, err error) { 2667 err = autorest.Respond( 2668 resp, 2669 azure.WithErrorUnlessStatusCode(http.StatusOK), 2670 autorest.ByUnmarshallingJSON(&result), 2671 autorest.ByClosing()) 2672 result.Response = autorest.Response{Response: resp} 2673 return 2674} 2675 2676// listPortMirroringNextResults retrieves the next set of results, if any. 2677func (client WorkloadNetworksClient) listPortMirroringNextResults(ctx context.Context, lastResults WorkloadNetworkPortMirroringList) (result WorkloadNetworkPortMirroringList, err error) { 2678 req, err := lastResults.workloadNetworkPortMirroringListPreparer(ctx) 2679 if err != nil { 2680 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listPortMirroringNextResults", nil, "Failure preparing next results request") 2681 } 2682 if req == nil { 2683 return 2684 } 2685 resp, err := client.ListPortMirroringSender(req) 2686 if err != nil { 2687 result.Response = autorest.Response{Response: resp} 2688 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listPortMirroringNextResults", resp, "Failure sending next results request") 2689 } 2690 result, err = client.ListPortMirroringResponder(resp) 2691 if err != nil { 2692 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listPortMirroringNextResults", resp, "Failure responding to next results request") 2693 } 2694 return 2695} 2696 2697// ListPortMirroringComplete enumerates all values, automatically crossing page boundaries as required. 2698func (client WorkloadNetworksClient) ListPortMirroringComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkPortMirroringListIterator, err error) { 2699 if tracing.IsEnabled() { 2700 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListPortMirroring") 2701 defer func() { 2702 sc := -1 2703 if result.Response().Response.Response != nil { 2704 sc = result.page.Response().Response.Response.StatusCode 2705 } 2706 tracing.EndSpan(ctx, sc, err) 2707 }() 2708 } 2709 result.page, err = client.ListPortMirroring(ctx, resourceGroupName, privateCloudName) 2710 return 2711} 2712 2713// ListPublicIPs sends the list public i ps request. 2714// Parameters: 2715// resourceGroupName - the name of the resource group. The name is case insensitive. 2716// privateCloudName - name of the private cloud 2717func (client WorkloadNetworksClient) ListPublicIPs(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkPublicIPsListPage, err error) { 2718 if tracing.IsEnabled() { 2719 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListPublicIPs") 2720 defer func() { 2721 sc := -1 2722 if result.wnpipl.Response.Response != nil { 2723 sc = result.wnpipl.Response.Response.StatusCode 2724 } 2725 tracing.EndSpan(ctx, sc, err) 2726 }() 2727 } 2728 if err := validation.Validate([]validation.Validation{ 2729 {TargetValue: client.SubscriptionID, 2730 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2731 {TargetValue: resourceGroupName, 2732 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2733 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2734 return result, validation.NewError("avs.WorkloadNetworksClient", "ListPublicIPs", err.Error()) 2735 } 2736 2737 result.fn = client.listPublicIPsNextResults 2738 req, err := client.ListPublicIPsPreparer(ctx, resourceGroupName, privateCloudName) 2739 if err != nil { 2740 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListPublicIPs", nil, "Failure preparing request") 2741 return 2742 } 2743 2744 resp, err := client.ListPublicIPsSender(req) 2745 if err != nil { 2746 result.wnpipl.Response = autorest.Response{Response: resp} 2747 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListPublicIPs", resp, "Failure sending request") 2748 return 2749 } 2750 2751 result.wnpipl, err = client.ListPublicIPsResponder(resp) 2752 if err != nil { 2753 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListPublicIPs", resp, "Failure responding to request") 2754 return 2755 } 2756 if result.wnpipl.hasNextLink() && result.wnpipl.IsEmpty() { 2757 err = result.NextWithContext(ctx) 2758 return 2759 } 2760 2761 return 2762} 2763 2764// ListPublicIPsPreparer prepares the ListPublicIPs request. 2765func (client WorkloadNetworksClient) ListPublicIPsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 2766 pathParameters := map[string]interface{}{ 2767 "privateCloudName": autorest.Encode("path", privateCloudName), 2768 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2769 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2770 } 2771 2772 const APIVersion = "2021-06-01" 2773 queryParameters := map[string]interface{}{ 2774 "api-version": APIVersion, 2775 } 2776 2777 preparer := autorest.CreatePreparer( 2778 autorest.AsGet(), 2779 autorest.WithBaseURL(client.BaseURI), 2780 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs", pathParameters), 2781 autorest.WithQueryParameters(queryParameters)) 2782 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2783} 2784 2785// ListPublicIPsSender sends the ListPublicIPs request. The method will close the 2786// http.Response Body if it receives an error. 2787func (client WorkloadNetworksClient) ListPublicIPsSender(req *http.Request) (*http.Response, error) { 2788 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2789} 2790 2791// ListPublicIPsResponder handles the response to the ListPublicIPs request. The method always 2792// closes the http.Response Body. 2793func (client WorkloadNetworksClient) ListPublicIPsResponder(resp *http.Response) (result WorkloadNetworkPublicIPsList, err error) { 2794 err = autorest.Respond( 2795 resp, 2796 azure.WithErrorUnlessStatusCode(http.StatusOK), 2797 autorest.ByUnmarshallingJSON(&result), 2798 autorest.ByClosing()) 2799 result.Response = autorest.Response{Response: resp} 2800 return 2801} 2802 2803// listPublicIPsNextResults retrieves the next set of results, if any. 2804func (client WorkloadNetworksClient) listPublicIPsNextResults(ctx context.Context, lastResults WorkloadNetworkPublicIPsList) (result WorkloadNetworkPublicIPsList, err error) { 2805 req, err := lastResults.workloadNetworkPublicIPsListPreparer(ctx) 2806 if err != nil { 2807 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listPublicIPsNextResults", nil, "Failure preparing next results request") 2808 } 2809 if req == nil { 2810 return 2811 } 2812 resp, err := client.ListPublicIPsSender(req) 2813 if err != nil { 2814 result.Response = autorest.Response{Response: resp} 2815 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listPublicIPsNextResults", resp, "Failure sending next results request") 2816 } 2817 result, err = client.ListPublicIPsResponder(resp) 2818 if err != nil { 2819 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listPublicIPsNextResults", resp, "Failure responding to next results request") 2820 } 2821 return 2822} 2823 2824// ListPublicIPsComplete enumerates all values, automatically crossing page boundaries as required. 2825func (client WorkloadNetworksClient) ListPublicIPsComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkPublicIPsListIterator, err error) { 2826 if tracing.IsEnabled() { 2827 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListPublicIPs") 2828 defer func() { 2829 sc := -1 2830 if result.Response().Response.Response != nil { 2831 sc = result.page.Response().Response.Response.StatusCode 2832 } 2833 tracing.EndSpan(ctx, sc, err) 2834 }() 2835 } 2836 result.page, err = client.ListPublicIPs(ctx, resourceGroupName, privateCloudName) 2837 return 2838} 2839 2840// ListSegments sends the list segments request. 2841// Parameters: 2842// resourceGroupName - the name of the resource group. The name is case insensitive. 2843// privateCloudName - name of the private cloud 2844func (client WorkloadNetworksClient) ListSegments(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkSegmentsListPage, err error) { 2845 if tracing.IsEnabled() { 2846 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListSegments") 2847 defer func() { 2848 sc := -1 2849 if result.wnsl.Response.Response != nil { 2850 sc = result.wnsl.Response.Response.StatusCode 2851 } 2852 tracing.EndSpan(ctx, sc, err) 2853 }() 2854 } 2855 if err := validation.Validate([]validation.Validation{ 2856 {TargetValue: client.SubscriptionID, 2857 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2858 {TargetValue: resourceGroupName, 2859 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2860 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2861 return result, validation.NewError("avs.WorkloadNetworksClient", "ListSegments", err.Error()) 2862 } 2863 2864 result.fn = client.listSegmentsNextResults 2865 req, err := client.ListSegmentsPreparer(ctx, resourceGroupName, privateCloudName) 2866 if err != nil { 2867 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListSegments", nil, "Failure preparing request") 2868 return 2869 } 2870 2871 resp, err := client.ListSegmentsSender(req) 2872 if err != nil { 2873 result.wnsl.Response = autorest.Response{Response: resp} 2874 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListSegments", resp, "Failure sending request") 2875 return 2876 } 2877 2878 result.wnsl, err = client.ListSegmentsResponder(resp) 2879 if err != nil { 2880 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListSegments", resp, "Failure responding to request") 2881 return 2882 } 2883 if result.wnsl.hasNextLink() && result.wnsl.IsEmpty() { 2884 err = result.NextWithContext(ctx) 2885 return 2886 } 2887 2888 return 2889} 2890 2891// ListSegmentsPreparer prepares the ListSegments request. 2892func (client WorkloadNetworksClient) ListSegmentsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 2893 pathParameters := map[string]interface{}{ 2894 "privateCloudName": autorest.Encode("path", privateCloudName), 2895 "resourceGroupName": autorest.Encode("path", resourceGroupName), 2896 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 2897 } 2898 2899 const APIVersion = "2021-06-01" 2900 queryParameters := map[string]interface{}{ 2901 "api-version": APIVersion, 2902 } 2903 2904 preparer := autorest.CreatePreparer( 2905 autorest.AsGet(), 2906 autorest.WithBaseURL(client.BaseURI), 2907 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments", pathParameters), 2908 autorest.WithQueryParameters(queryParameters)) 2909 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2910} 2911 2912// ListSegmentsSender sends the ListSegments request. The method will close the 2913// http.Response Body if it receives an error. 2914func (client WorkloadNetworksClient) ListSegmentsSender(req *http.Request) (*http.Response, error) { 2915 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 2916} 2917 2918// ListSegmentsResponder handles the response to the ListSegments request. The method always 2919// closes the http.Response Body. 2920func (client WorkloadNetworksClient) ListSegmentsResponder(resp *http.Response) (result WorkloadNetworkSegmentsList, err error) { 2921 err = autorest.Respond( 2922 resp, 2923 azure.WithErrorUnlessStatusCode(http.StatusOK), 2924 autorest.ByUnmarshallingJSON(&result), 2925 autorest.ByClosing()) 2926 result.Response = autorest.Response{Response: resp} 2927 return 2928} 2929 2930// listSegmentsNextResults retrieves the next set of results, if any. 2931func (client WorkloadNetworksClient) listSegmentsNextResults(ctx context.Context, lastResults WorkloadNetworkSegmentsList) (result WorkloadNetworkSegmentsList, err error) { 2932 req, err := lastResults.workloadNetworkSegmentsListPreparer(ctx) 2933 if err != nil { 2934 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listSegmentsNextResults", nil, "Failure preparing next results request") 2935 } 2936 if req == nil { 2937 return 2938 } 2939 resp, err := client.ListSegmentsSender(req) 2940 if err != nil { 2941 result.Response = autorest.Response{Response: resp} 2942 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listSegmentsNextResults", resp, "Failure sending next results request") 2943 } 2944 result, err = client.ListSegmentsResponder(resp) 2945 if err != nil { 2946 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listSegmentsNextResults", resp, "Failure responding to next results request") 2947 } 2948 return 2949} 2950 2951// ListSegmentsComplete enumerates all values, automatically crossing page boundaries as required. 2952func (client WorkloadNetworksClient) ListSegmentsComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkSegmentsListIterator, err error) { 2953 if tracing.IsEnabled() { 2954 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListSegments") 2955 defer func() { 2956 sc := -1 2957 if result.Response().Response.Response != nil { 2958 sc = result.page.Response().Response.Response.StatusCode 2959 } 2960 tracing.EndSpan(ctx, sc, err) 2961 }() 2962 } 2963 result.page, err = client.ListSegments(ctx, resourceGroupName, privateCloudName) 2964 return 2965} 2966 2967// ListVirtualMachines sends the list virtual machines request. 2968// Parameters: 2969// resourceGroupName - the name of the resource group. The name is case insensitive. 2970// privateCloudName - name of the private cloud 2971func (client WorkloadNetworksClient) ListVirtualMachines(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkVirtualMachinesListPage, err error) { 2972 if tracing.IsEnabled() { 2973 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListVirtualMachines") 2974 defer func() { 2975 sc := -1 2976 if result.wnvml.Response.Response != nil { 2977 sc = result.wnvml.Response.Response.StatusCode 2978 } 2979 tracing.EndSpan(ctx, sc, err) 2980 }() 2981 } 2982 if err := validation.Validate([]validation.Validation{ 2983 {TargetValue: client.SubscriptionID, 2984 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 2985 {TargetValue: resourceGroupName, 2986 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 2987 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 2988 return result, validation.NewError("avs.WorkloadNetworksClient", "ListVirtualMachines", err.Error()) 2989 } 2990 2991 result.fn = client.listVirtualMachinesNextResults 2992 req, err := client.ListVirtualMachinesPreparer(ctx, resourceGroupName, privateCloudName) 2993 if err != nil { 2994 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListVirtualMachines", nil, "Failure preparing request") 2995 return 2996 } 2997 2998 resp, err := client.ListVirtualMachinesSender(req) 2999 if err != nil { 3000 result.wnvml.Response = autorest.Response{Response: resp} 3001 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListVirtualMachines", resp, "Failure sending request") 3002 return 3003 } 3004 3005 result.wnvml, err = client.ListVirtualMachinesResponder(resp) 3006 if err != nil { 3007 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListVirtualMachines", resp, "Failure responding to request") 3008 return 3009 } 3010 if result.wnvml.hasNextLink() && result.wnvml.IsEmpty() { 3011 err = result.NextWithContext(ctx) 3012 return 3013 } 3014 3015 return 3016} 3017 3018// ListVirtualMachinesPreparer prepares the ListVirtualMachines request. 3019func (client WorkloadNetworksClient) ListVirtualMachinesPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 3020 pathParameters := map[string]interface{}{ 3021 "privateCloudName": autorest.Encode("path", privateCloudName), 3022 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3023 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3024 } 3025 3026 const APIVersion = "2021-06-01" 3027 queryParameters := map[string]interface{}{ 3028 "api-version": APIVersion, 3029 } 3030 3031 preparer := autorest.CreatePreparer( 3032 autorest.AsGet(), 3033 autorest.WithBaseURL(client.BaseURI), 3034 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines", pathParameters), 3035 autorest.WithQueryParameters(queryParameters)) 3036 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3037} 3038 3039// ListVirtualMachinesSender sends the ListVirtualMachines request. The method will close the 3040// http.Response Body if it receives an error. 3041func (client WorkloadNetworksClient) ListVirtualMachinesSender(req *http.Request) (*http.Response, error) { 3042 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3043} 3044 3045// ListVirtualMachinesResponder handles the response to the ListVirtualMachines request. The method always 3046// closes the http.Response Body. 3047func (client WorkloadNetworksClient) ListVirtualMachinesResponder(resp *http.Response) (result WorkloadNetworkVirtualMachinesList, err error) { 3048 err = autorest.Respond( 3049 resp, 3050 azure.WithErrorUnlessStatusCode(http.StatusOK), 3051 autorest.ByUnmarshallingJSON(&result), 3052 autorest.ByClosing()) 3053 result.Response = autorest.Response{Response: resp} 3054 return 3055} 3056 3057// listVirtualMachinesNextResults retrieves the next set of results, if any. 3058func (client WorkloadNetworksClient) listVirtualMachinesNextResults(ctx context.Context, lastResults WorkloadNetworkVirtualMachinesList) (result WorkloadNetworkVirtualMachinesList, err error) { 3059 req, err := lastResults.workloadNetworkVirtualMachinesListPreparer(ctx) 3060 if err != nil { 3061 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listVirtualMachinesNextResults", nil, "Failure preparing next results request") 3062 } 3063 if req == nil { 3064 return 3065 } 3066 resp, err := client.ListVirtualMachinesSender(req) 3067 if err != nil { 3068 result.Response = autorest.Response{Response: resp} 3069 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listVirtualMachinesNextResults", resp, "Failure sending next results request") 3070 } 3071 result, err = client.ListVirtualMachinesResponder(resp) 3072 if err != nil { 3073 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listVirtualMachinesNextResults", resp, "Failure responding to next results request") 3074 } 3075 return 3076} 3077 3078// ListVirtualMachinesComplete enumerates all values, automatically crossing page boundaries as required. 3079func (client WorkloadNetworksClient) ListVirtualMachinesComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkVirtualMachinesListIterator, err error) { 3080 if tracing.IsEnabled() { 3081 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListVirtualMachines") 3082 defer func() { 3083 sc := -1 3084 if result.Response().Response.Response != nil { 3085 sc = result.page.Response().Response.Response.StatusCode 3086 } 3087 tracing.EndSpan(ctx, sc, err) 3088 }() 3089 } 3090 result.page, err = client.ListVirtualMachines(ctx, resourceGroupName, privateCloudName) 3091 return 3092} 3093 3094// ListVMGroups sends the list vm groups request. 3095// Parameters: 3096// resourceGroupName - the name of the resource group. The name is case insensitive. 3097// privateCloudName - name of the private cloud 3098func (client WorkloadNetworksClient) ListVMGroups(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkVMGroupsListPage, err error) { 3099 if tracing.IsEnabled() { 3100 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListVMGroups") 3101 defer func() { 3102 sc := -1 3103 if result.wnvgl.Response.Response != nil { 3104 sc = result.wnvgl.Response.Response.StatusCode 3105 } 3106 tracing.EndSpan(ctx, sc, err) 3107 }() 3108 } 3109 if err := validation.Validate([]validation.Validation{ 3110 {TargetValue: client.SubscriptionID, 3111 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 3112 {TargetValue: resourceGroupName, 3113 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 3114 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 3115 return result, validation.NewError("avs.WorkloadNetworksClient", "ListVMGroups", err.Error()) 3116 } 3117 3118 result.fn = client.listVMGroupsNextResults 3119 req, err := client.ListVMGroupsPreparer(ctx, resourceGroupName, privateCloudName) 3120 if err != nil { 3121 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListVMGroups", nil, "Failure preparing request") 3122 return 3123 } 3124 3125 resp, err := client.ListVMGroupsSender(req) 3126 if err != nil { 3127 result.wnvgl.Response = autorest.Response{Response: resp} 3128 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListVMGroups", resp, "Failure sending request") 3129 return 3130 } 3131 3132 result.wnvgl, err = client.ListVMGroupsResponder(resp) 3133 if err != nil { 3134 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "ListVMGroups", resp, "Failure responding to request") 3135 return 3136 } 3137 if result.wnvgl.hasNextLink() && result.wnvgl.IsEmpty() { 3138 err = result.NextWithContext(ctx) 3139 return 3140 } 3141 3142 return 3143} 3144 3145// ListVMGroupsPreparer prepares the ListVMGroups request. 3146func (client WorkloadNetworksClient) ListVMGroupsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string) (*http.Request, error) { 3147 pathParameters := map[string]interface{}{ 3148 "privateCloudName": autorest.Encode("path", privateCloudName), 3149 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3150 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3151 } 3152 3153 const APIVersion = "2021-06-01" 3154 queryParameters := map[string]interface{}{ 3155 "api-version": APIVersion, 3156 } 3157 3158 preparer := autorest.CreatePreparer( 3159 autorest.AsGet(), 3160 autorest.WithBaseURL(client.BaseURI), 3161 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups", pathParameters), 3162 autorest.WithQueryParameters(queryParameters)) 3163 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3164} 3165 3166// ListVMGroupsSender sends the ListVMGroups request. The method will close the 3167// http.Response Body if it receives an error. 3168func (client WorkloadNetworksClient) ListVMGroupsSender(req *http.Request) (*http.Response, error) { 3169 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3170} 3171 3172// ListVMGroupsResponder handles the response to the ListVMGroups request. The method always 3173// closes the http.Response Body. 3174func (client WorkloadNetworksClient) ListVMGroupsResponder(resp *http.Response) (result WorkloadNetworkVMGroupsList, err error) { 3175 err = autorest.Respond( 3176 resp, 3177 azure.WithErrorUnlessStatusCode(http.StatusOK), 3178 autorest.ByUnmarshallingJSON(&result), 3179 autorest.ByClosing()) 3180 result.Response = autorest.Response{Response: resp} 3181 return 3182} 3183 3184// listVMGroupsNextResults retrieves the next set of results, if any. 3185func (client WorkloadNetworksClient) listVMGroupsNextResults(ctx context.Context, lastResults WorkloadNetworkVMGroupsList) (result WorkloadNetworkVMGroupsList, err error) { 3186 req, err := lastResults.workloadNetworkVMGroupsListPreparer(ctx) 3187 if err != nil { 3188 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listVMGroupsNextResults", nil, "Failure preparing next results request") 3189 } 3190 if req == nil { 3191 return 3192 } 3193 resp, err := client.ListVMGroupsSender(req) 3194 if err != nil { 3195 result.Response = autorest.Response{Response: resp} 3196 return result, autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listVMGroupsNextResults", resp, "Failure sending next results request") 3197 } 3198 result, err = client.ListVMGroupsResponder(resp) 3199 if err != nil { 3200 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "listVMGroupsNextResults", resp, "Failure responding to next results request") 3201 } 3202 return 3203} 3204 3205// ListVMGroupsComplete enumerates all values, automatically crossing page boundaries as required. 3206func (client WorkloadNetworksClient) ListVMGroupsComplete(ctx context.Context, resourceGroupName string, privateCloudName string) (result WorkloadNetworkVMGroupsListIterator, err error) { 3207 if tracing.IsEnabled() { 3208 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.ListVMGroups") 3209 defer func() { 3210 sc := -1 3211 if result.Response().Response.Response != nil { 3212 sc = result.page.Response().Response.Response.StatusCode 3213 } 3214 tracing.EndSpan(ctx, sc, err) 3215 }() 3216 } 3217 result.page, err = client.ListVMGroups(ctx, resourceGroupName, privateCloudName) 3218 return 3219} 3220 3221// UpdateDhcp sends the update dhcp request. 3222// Parameters: 3223// resourceGroupName - the name of the resource group. The name is case insensitive. 3224// privateCloudName - name of the private cloud 3225// dhcpID - NSX DHCP identifier. Generally the same as the DHCP display name 3226// workloadNetworkDhcp - NSX DHCP 3227func (client WorkloadNetworksClient) UpdateDhcp(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp) (result WorkloadNetworksUpdateDhcpFuture, err error) { 3228 if tracing.IsEnabled() { 3229 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.UpdateDhcp") 3230 defer func() { 3231 sc := -1 3232 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 3233 sc = result.FutureAPI.Response().StatusCode 3234 } 3235 tracing.EndSpan(ctx, sc, err) 3236 }() 3237 } 3238 if err := validation.Validate([]validation.Validation{ 3239 {TargetValue: client.SubscriptionID, 3240 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 3241 {TargetValue: resourceGroupName, 3242 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 3243 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 3244 return result, validation.NewError("avs.WorkloadNetworksClient", "UpdateDhcp", err.Error()) 3245 } 3246 3247 req, err := client.UpdateDhcpPreparer(ctx, resourceGroupName, privateCloudName, dhcpID, workloadNetworkDhcp) 3248 if err != nil { 3249 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateDhcp", nil, "Failure preparing request") 3250 return 3251 } 3252 3253 result, err = client.UpdateDhcpSender(req) 3254 if err != nil { 3255 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateDhcp", nil, "Failure sending request") 3256 return 3257 } 3258 3259 return 3260} 3261 3262// UpdateDhcpPreparer prepares the UpdateDhcp request. 3263func (client WorkloadNetworksClient) UpdateDhcpPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, dhcpID string, workloadNetworkDhcp WorkloadNetworkDhcp) (*http.Request, error) { 3264 pathParameters := map[string]interface{}{ 3265 "dhcpId": autorest.Encode("path", dhcpID), 3266 "privateCloudName": autorest.Encode("path", privateCloudName), 3267 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3268 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3269 } 3270 3271 const APIVersion = "2021-06-01" 3272 queryParameters := map[string]interface{}{ 3273 "api-version": APIVersion, 3274 } 3275 3276 preparer := autorest.CreatePreparer( 3277 autorest.AsContentType("application/json; charset=utf-8"), 3278 autorest.AsPatch(), 3279 autorest.WithBaseURL(client.BaseURI), 3280 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", pathParameters), 3281 autorest.WithJSON(workloadNetworkDhcp), 3282 autorest.WithQueryParameters(queryParameters)) 3283 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3284} 3285 3286// UpdateDhcpSender sends the UpdateDhcp request. The method will close the 3287// http.Response Body if it receives an error. 3288func (client WorkloadNetworksClient) UpdateDhcpSender(req *http.Request) (future WorkloadNetworksUpdateDhcpFuture, err error) { 3289 var resp *http.Response 3290 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3291 if err != nil { 3292 return 3293 } 3294 var azf azure.Future 3295 azf, err = azure.NewFutureFromResponse(resp) 3296 future.FutureAPI = &azf 3297 future.Result = future.result 3298 return 3299} 3300 3301// UpdateDhcpResponder handles the response to the UpdateDhcp request. The method always 3302// closes the http.Response Body. 3303func (client WorkloadNetworksClient) UpdateDhcpResponder(resp *http.Response) (result WorkloadNetworkDhcp, err error) { 3304 err = autorest.Respond( 3305 resp, 3306 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 3307 autorest.ByUnmarshallingJSON(&result), 3308 autorest.ByClosing()) 3309 result.Response = autorest.Response{Response: resp} 3310 return 3311} 3312 3313// UpdateDNSService sends the update dns service request. 3314// Parameters: 3315// resourceGroupName - the name of the resource group. The name is case insensitive. 3316// privateCloudName - name of the private cloud 3317// DNSServiceID - NSX DNS Service identifier. Generally the same as the DNS Service's display name 3318// workloadNetworkDNSService - NSX DNS Service 3319func (client WorkloadNetworksClient) UpdateDNSService(ctx context.Context, resourceGroupName string, privateCloudName string, DNSServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService) (result WorkloadNetworksUpdateDNSServiceFuture, err error) { 3320 if tracing.IsEnabled() { 3321 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.UpdateDNSService") 3322 defer func() { 3323 sc := -1 3324 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 3325 sc = result.FutureAPI.Response().StatusCode 3326 } 3327 tracing.EndSpan(ctx, sc, err) 3328 }() 3329 } 3330 if err := validation.Validate([]validation.Validation{ 3331 {TargetValue: client.SubscriptionID, 3332 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 3333 {TargetValue: resourceGroupName, 3334 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 3335 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 3336 return result, validation.NewError("avs.WorkloadNetworksClient", "UpdateDNSService", err.Error()) 3337 } 3338 3339 req, err := client.UpdateDNSServicePreparer(ctx, resourceGroupName, privateCloudName, DNSServiceID, workloadNetworkDNSService) 3340 if err != nil { 3341 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateDNSService", nil, "Failure preparing request") 3342 return 3343 } 3344 3345 result, err = client.UpdateDNSServiceSender(req) 3346 if err != nil { 3347 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateDNSService", nil, "Failure sending request") 3348 return 3349 } 3350 3351 return 3352} 3353 3354// UpdateDNSServicePreparer prepares the UpdateDNSService request. 3355func (client WorkloadNetworksClient) UpdateDNSServicePreparer(ctx context.Context, resourceGroupName string, privateCloudName string, DNSServiceID string, workloadNetworkDNSService WorkloadNetworkDNSService) (*http.Request, error) { 3356 pathParameters := map[string]interface{}{ 3357 "dnsServiceId": autorest.Encode("path", DNSServiceID), 3358 "privateCloudName": autorest.Encode("path", privateCloudName), 3359 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3360 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3361 } 3362 3363 const APIVersion = "2021-06-01" 3364 queryParameters := map[string]interface{}{ 3365 "api-version": APIVersion, 3366 } 3367 3368 preparer := autorest.CreatePreparer( 3369 autorest.AsContentType("application/json; charset=utf-8"), 3370 autorest.AsPatch(), 3371 autorest.WithBaseURL(client.BaseURI), 3372 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", pathParameters), 3373 autorest.WithJSON(workloadNetworkDNSService), 3374 autorest.WithQueryParameters(queryParameters)) 3375 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3376} 3377 3378// UpdateDNSServiceSender sends the UpdateDNSService request. The method will close the 3379// http.Response Body if it receives an error. 3380func (client WorkloadNetworksClient) UpdateDNSServiceSender(req *http.Request) (future WorkloadNetworksUpdateDNSServiceFuture, err error) { 3381 var resp *http.Response 3382 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3383 if err != nil { 3384 return 3385 } 3386 var azf azure.Future 3387 azf, err = azure.NewFutureFromResponse(resp) 3388 future.FutureAPI = &azf 3389 future.Result = future.result 3390 return 3391} 3392 3393// UpdateDNSServiceResponder handles the response to the UpdateDNSService request. The method always 3394// closes the http.Response Body. 3395func (client WorkloadNetworksClient) UpdateDNSServiceResponder(resp *http.Response) (result WorkloadNetworkDNSService, err error) { 3396 err = autorest.Respond( 3397 resp, 3398 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 3399 autorest.ByUnmarshallingJSON(&result), 3400 autorest.ByClosing()) 3401 result.Response = autorest.Response{Response: resp} 3402 return 3403} 3404 3405// UpdateDNSZone sends the update dns zone request. 3406// Parameters: 3407// resourceGroupName - the name of the resource group. The name is case insensitive. 3408// privateCloudName - name of the private cloud 3409// DNSZoneID - NSX DNS Zone identifier. Generally the same as the DNS Zone's display name 3410// workloadNetworkDNSZone - NSX DNS Zone 3411func (client WorkloadNetworksClient) UpdateDNSZone(ctx context.Context, resourceGroupName string, privateCloudName string, DNSZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone) (result WorkloadNetworksUpdateDNSZoneFuture, err error) { 3412 if tracing.IsEnabled() { 3413 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.UpdateDNSZone") 3414 defer func() { 3415 sc := -1 3416 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 3417 sc = result.FutureAPI.Response().StatusCode 3418 } 3419 tracing.EndSpan(ctx, sc, err) 3420 }() 3421 } 3422 if err := validation.Validate([]validation.Validation{ 3423 {TargetValue: client.SubscriptionID, 3424 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 3425 {TargetValue: resourceGroupName, 3426 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 3427 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 3428 return result, validation.NewError("avs.WorkloadNetworksClient", "UpdateDNSZone", err.Error()) 3429 } 3430 3431 req, err := client.UpdateDNSZonePreparer(ctx, resourceGroupName, privateCloudName, DNSZoneID, workloadNetworkDNSZone) 3432 if err != nil { 3433 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateDNSZone", nil, "Failure preparing request") 3434 return 3435 } 3436 3437 result, err = client.UpdateDNSZoneSender(req) 3438 if err != nil { 3439 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateDNSZone", nil, "Failure sending request") 3440 return 3441 } 3442 3443 return 3444} 3445 3446// UpdateDNSZonePreparer prepares the UpdateDNSZone request. 3447func (client WorkloadNetworksClient) UpdateDNSZonePreparer(ctx context.Context, resourceGroupName string, privateCloudName string, DNSZoneID string, workloadNetworkDNSZone WorkloadNetworkDNSZone) (*http.Request, error) { 3448 pathParameters := map[string]interface{}{ 3449 "dnsZoneId": autorest.Encode("path", DNSZoneID), 3450 "privateCloudName": autorest.Encode("path", privateCloudName), 3451 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3452 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3453 } 3454 3455 const APIVersion = "2021-06-01" 3456 queryParameters := map[string]interface{}{ 3457 "api-version": APIVersion, 3458 } 3459 3460 preparer := autorest.CreatePreparer( 3461 autorest.AsContentType("application/json; charset=utf-8"), 3462 autorest.AsPatch(), 3463 autorest.WithBaseURL(client.BaseURI), 3464 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", pathParameters), 3465 autorest.WithJSON(workloadNetworkDNSZone), 3466 autorest.WithQueryParameters(queryParameters)) 3467 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3468} 3469 3470// UpdateDNSZoneSender sends the UpdateDNSZone request. The method will close the 3471// http.Response Body if it receives an error. 3472func (client WorkloadNetworksClient) UpdateDNSZoneSender(req *http.Request) (future WorkloadNetworksUpdateDNSZoneFuture, err error) { 3473 var resp *http.Response 3474 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3475 if err != nil { 3476 return 3477 } 3478 var azf azure.Future 3479 azf, err = azure.NewFutureFromResponse(resp) 3480 future.FutureAPI = &azf 3481 future.Result = future.result 3482 return 3483} 3484 3485// UpdateDNSZoneResponder handles the response to the UpdateDNSZone request. The method always 3486// closes the http.Response Body. 3487func (client WorkloadNetworksClient) UpdateDNSZoneResponder(resp *http.Response) (result WorkloadNetworkDNSZone, err error) { 3488 err = autorest.Respond( 3489 resp, 3490 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 3491 autorest.ByUnmarshallingJSON(&result), 3492 autorest.ByClosing()) 3493 result.Response = autorest.Response{Response: resp} 3494 return 3495} 3496 3497// UpdatePortMirroring sends the update port mirroring request. 3498// Parameters: 3499// resourceGroupName - the name of the resource group. The name is case insensitive. 3500// privateCloudName - name of the private cloud 3501// portMirroringID - NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name 3502// workloadNetworkPortMirroring - NSX port mirroring 3503func (client WorkloadNetworksClient) UpdatePortMirroring(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring) (result WorkloadNetworksUpdatePortMirroringFuture, err error) { 3504 if tracing.IsEnabled() { 3505 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.UpdatePortMirroring") 3506 defer func() { 3507 sc := -1 3508 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 3509 sc = result.FutureAPI.Response().StatusCode 3510 } 3511 tracing.EndSpan(ctx, sc, err) 3512 }() 3513 } 3514 if err := validation.Validate([]validation.Validation{ 3515 {TargetValue: client.SubscriptionID, 3516 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 3517 {TargetValue: resourceGroupName, 3518 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 3519 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 3520 return result, validation.NewError("avs.WorkloadNetworksClient", "UpdatePortMirroring", err.Error()) 3521 } 3522 3523 req, err := client.UpdatePortMirroringPreparer(ctx, resourceGroupName, privateCloudName, portMirroringID, workloadNetworkPortMirroring) 3524 if err != nil { 3525 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdatePortMirroring", nil, "Failure preparing request") 3526 return 3527 } 3528 3529 result, err = client.UpdatePortMirroringSender(req) 3530 if err != nil { 3531 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdatePortMirroring", nil, "Failure sending request") 3532 return 3533 } 3534 3535 return 3536} 3537 3538// UpdatePortMirroringPreparer prepares the UpdatePortMirroring request. 3539func (client WorkloadNetworksClient) UpdatePortMirroringPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, portMirroringID string, workloadNetworkPortMirroring WorkloadNetworkPortMirroring) (*http.Request, error) { 3540 pathParameters := map[string]interface{}{ 3541 "portMirroringId": autorest.Encode("path", portMirroringID), 3542 "privateCloudName": autorest.Encode("path", privateCloudName), 3543 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3544 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3545 } 3546 3547 const APIVersion = "2021-06-01" 3548 queryParameters := map[string]interface{}{ 3549 "api-version": APIVersion, 3550 } 3551 3552 preparer := autorest.CreatePreparer( 3553 autorest.AsContentType("application/json; charset=utf-8"), 3554 autorest.AsPatch(), 3555 autorest.WithBaseURL(client.BaseURI), 3556 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", pathParameters), 3557 autorest.WithJSON(workloadNetworkPortMirroring), 3558 autorest.WithQueryParameters(queryParameters)) 3559 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3560} 3561 3562// UpdatePortMirroringSender sends the UpdatePortMirroring request. The method will close the 3563// http.Response Body if it receives an error. 3564func (client WorkloadNetworksClient) UpdatePortMirroringSender(req *http.Request) (future WorkloadNetworksUpdatePortMirroringFuture, err error) { 3565 var resp *http.Response 3566 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3567 if err != nil { 3568 return 3569 } 3570 var azf azure.Future 3571 azf, err = azure.NewFutureFromResponse(resp) 3572 future.FutureAPI = &azf 3573 future.Result = future.result 3574 return 3575} 3576 3577// UpdatePortMirroringResponder handles the response to the UpdatePortMirroring request. The method always 3578// closes the http.Response Body. 3579func (client WorkloadNetworksClient) UpdatePortMirroringResponder(resp *http.Response) (result WorkloadNetworkPortMirroring, err error) { 3580 err = autorest.Respond( 3581 resp, 3582 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 3583 autorest.ByUnmarshallingJSON(&result), 3584 autorest.ByClosing()) 3585 result.Response = autorest.Response{Response: resp} 3586 return 3587} 3588 3589// UpdateSegments sends the update segments request. 3590// Parameters: 3591// resourceGroupName - the name of the resource group. The name is case insensitive. 3592// privateCloudName - name of the private cloud 3593// segmentID - NSX Segment identifier. Generally the same as the Segment's display name 3594// workloadNetworkSegment - NSX Segment 3595func (client WorkloadNetworksClient) UpdateSegments(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment) (result WorkloadNetworksUpdateSegmentsFuture, err error) { 3596 if tracing.IsEnabled() { 3597 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.UpdateSegments") 3598 defer func() { 3599 sc := -1 3600 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 3601 sc = result.FutureAPI.Response().StatusCode 3602 } 3603 tracing.EndSpan(ctx, sc, err) 3604 }() 3605 } 3606 if err := validation.Validate([]validation.Validation{ 3607 {TargetValue: client.SubscriptionID, 3608 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 3609 {TargetValue: resourceGroupName, 3610 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 3611 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 3612 return result, validation.NewError("avs.WorkloadNetworksClient", "UpdateSegments", err.Error()) 3613 } 3614 3615 req, err := client.UpdateSegmentsPreparer(ctx, resourceGroupName, privateCloudName, segmentID, workloadNetworkSegment) 3616 if err != nil { 3617 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateSegments", nil, "Failure preparing request") 3618 return 3619 } 3620 3621 result, err = client.UpdateSegmentsSender(req) 3622 if err != nil { 3623 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateSegments", nil, "Failure sending request") 3624 return 3625 } 3626 3627 return 3628} 3629 3630// UpdateSegmentsPreparer prepares the UpdateSegments request. 3631func (client WorkloadNetworksClient) UpdateSegmentsPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, segmentID string, workloadNetworkSegment WorkloadNetworkSegment) (*http.Request, error) { 3632 pathParameters := map[string]interface{}{ 3633 "privateCloudName": autorest.Encode("path", privateCloudName), 3634 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3635 "segmentId": autorest.Encode("path", segmentID), 3636 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3637 } 3638 3639 const APIVersion = "2021-06-01" 3640 queryParameters := map[string]interface{}{ 3641 "api-version": APIVersion, 3642 } 3643 3644 preparer := autorest.CreatePreparer( 3645 autorest.AsContentType("application/json; charset=utf-8"), 3646 autorest.AsPatch(), 3647 autorest.WithBaseURL(client.BaseURI), 3648 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", pathParameters), 3649 autorest.WithJSON(workloadNetworkSegment), 3650 autorest.WithQueryParameters(queryParameters)) 3651 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3652} 3653 3654// UpdateSegmentsSender sends the UpdateSegments request. The method will close the 3655// http.Response Body if it receives an error. 3656func (client WorkloadNetworksClient) UpdateSegmentsSender(req *http.Request) (future WorkloadNetworksUpdateSegmentsFuture, err error) { 3657 var resp *http.Response 3658 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3659 if err != nil { 3660 return 3661 } 3662 var azf azure.Future 3663 azf, err = azure.NewFutureFromResponse(resp) 3664 future.FutureAPI = &azf 3665 future.Result = future.result 3666 return 3667} 3668 3669// UpdateSegmentsResponder handles the response to the UpdateSegments request. The method always 3670// closes the http.Response Body. 3671func (client WorkloadNetworksClient) UpdateSegmentsResponder(resp *http.Response) (result WorkloadNetworkSegment, err error) { 3672 err = autorest.Respond( 3673 resp, 3674 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 3675 autorest.ByUnmarshallingJSON(&result), 3676 autorest.ByClosing()) 3677 result.Response = autorest.Response{Response: resp} 3678 return 3679} 3680 3681// UpdateVMGroup sends the update vm group request. 3682// Parameters: 3683// resourceGroupName - the name of the resource group. The name is case insensitive. 3684// privateCloudName - name of the private cloud 3685// VMGroupID - NSX VM Group identifier. Generally the same as the VM Group's display name 3686// workloadNetworkVMGroup - NSX VM Group 3687func (client WorkloadNetworksClient) UpdateVMGroup(ctx context.Context, resourceGroupName string, privateCloudName string, VMGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup) (result WorkloadNetworksUpdateVMGroupFuture, err error) { 3688 if tracing.IsEnabled() { 3689 ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadNetworksClient.UpdateVMGroup") 3690 defer func() { 3691 sc := -1 3692 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 3693 sc = result.FutureAPI.Response().StatusCode 3694 } 3695 tracing.EndSpan(ctx, sc, err) 3696 }() 3697 } 3698 if err := validation.Validate([]validation.Validation{ 3699 {TargetValue: client.SubscriptionID, 3700 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, 3701 {TargetValue: resourceGroupName, 3702 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 3703 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { 3704 return result, validation.NewError("avs.WorkloadNetworksClient", "UpdateVMGroup", err.Error()) 3705 } 3706 3707 req, err := client.UpdateVMGroupPreparer(ctx, resourceGroupName, privateCloudName, VMGroupID, workloadNetworkVMGroup) 3708 if err != nil { 3709 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateVMGroup", nil, "Failure preparing request") 3710 return 3711 } 3712 3713 result, err = client.UpdateVMGroupSender(req) 3714 if err != nil { 3715 err = autorest.NewErrorWithError(err, "avs.WorkloadNetworksClient", "UpdateVMGroup", nil, "Failure sending request") 3716 return 3717 } 3718 3719 return 3720} 3721 3722// UpdateVMGroupPreparer prepares the UpdateVMGroup request. 3723func (client WorkloadNetworksClient) UpdateVMGroupPreparer(ctx context.Context, resourceGroupName string, privateCloudName string, VMGroupID string, workloadNetworkVMGroup WorkloadNetworkVMGroup) (*http.Request, error) { 3724 pathParameters := map[string]interface{}{ 3725 "privateCloudName": autorest.Encode("path", privateCloudName), 3726 "resourceGroupName": autorest.Encode("path", resourceGroupName), 3727 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 3728 "vmGroupId": autorest.Encode("path", VMGroupID), 3729 } 3730 3731 const APIVersion = "2021-06-01" 3732 queryParameters := map[string]interface{}{ 3733 "api-version": APIVersion, 3734 } 3735 3736 preparer := autorest.CreatePreparer( 3737 autorest.AsContentType("application/json; charset=utf-8"), 3738 autorest.AsPatch(), 3739 autorest.WithBaseURL(client.BaseURI), 3740 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", pathParameters), 3741 autorest.WithJSON(workloadNetworkVMGroup), 3742 autorest.WithQueryParameters(queryParameters)) 3743 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3744} 3745 3746// UpdateVMGroupSender sends the UpdateVMGroup request. The method will close the 3747// http.Response Body if it receives an error. 3748func (client WorkloadNetworksClient) UpdateVMGroupSender(req *http.Request) (future WorkloadNetworksUpdateVMGroupFuture, err error) { 3749 var resp *http.Response 3750 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 3751 if err != nil { 3752 return 3753 } 3754 var azf azure.Future 3755 azf, err = azure.NewFutureFromResponse(resp) 3756 future.FutureAPI = &azf 3757 future.Result = future.result 3758 return 3759} 3760 3761// UpdateVMGroupResponder handles the response to the UpdateVMGroup request. The method always 3762// closes the http.Response Body. 3763func (client WorkloadNetworksClient) UpdateVMGroupResponder(resp *http.Response) (result WorkloadNetworkVMGroup, err error) { 3764 err = autorest.Respond( 3765 resp, 3766 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 3767 autorest.ByUnmarshallingJSON(&result), 3768 autorest.ByClosing()) 3769 result.Response = autorest.Response{Response: resp} 3770 return 3771} 3772