1package account 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/validation" 25 "github.com/Azure/go-autorest/tracing" 26 "net/http" 27) 28 29// Client is the creates an Azure Data Lake Analytics account management client. 30type Client struct { 31 BaseClient 32} 33 34// NewClient creates an instance of the Client client. 35func NewClient(subscriptionID string) Client { 36 return NewClientWithBaseURI(DefaultBaseURI, subscriptionID) 37} 38 39// NewClientWithBaseURI creates an instance of the Client client using a custom endpoint. Use this when interacting 40// with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 41func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { 42 return Client{NewWithBaseURI(baseURI, subscriptionID)} 43} 44 45// AddDataLakeStoreAccount updates the specified Data Lake Analytics account to include the additional Data Lake Store 46// account. 47// Parameters: 48// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 49// accountName - the name of the Data Lake Analytics account to which to add the Data Lake Store account. 50// dataLakeStoreAccountName - the name of the Data Lake Store account to add. 51// parameters - the details of the Data Lake Store account. 52func (client Client) AddDataLakeStoreAccount(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string, parameters AddDataLakeStoreParameters) (result autorest.Response, err error) { 53 if tracing.IsEnabled() { 54 ctx = tracing.StartSpan(ctx, fqdn+"/Client.AddDataLakeStoreAccount") 55 defer func() { 56 sc := -1 57 if result.Response != nil { 58 sc = result.Response.StatusCode 59 } 60 tracing.EndSpan(ctx, sc, err) 61 }() 62 } 63 if err := validation.Validate([]validation.Validation{ 64 {TargetValue: parameters, 65 Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 66 return result, validation.NewError("account.Client", "AddDataLakeStoreAccount", err.Error()) 67 } 68 69 req, err := client.AddDataLakeStoreAccountPreparer(ctx, resourceGroupName, accountName, dataLakeStoreAccountName, parameters) 70 if err != nil { 71 err = autorest.NewErrorWithError(err, "account.Client", "AddDataLakeStoreAccount", nil, "Failure preparing request") 72 return 73 } 74 75 resp, err := client.AddDataLakeStoreAccountSender(req) 76 if err != nil { 77 result.Response = resp 78 err = autorest.NewErrorWithError(err, "account.Client", "AddDataLakeStoreAccount", resp, "Failure sending request") 79 return 80 } 81 82 result, err = client.AddDataLakeStoreAccountResponder(resp) 83 if err != nil { 84 err = autorest.NewErrorWithError(err, "account.Client", "AddDataLakeStoreAccount", resp, "Failure responding to request") 85 return 86 } 87 88 return 89} 90 91// AddDataLakeStoreAccountPreparer prepares the AddDataLakeStoreAccount request. 92func (client Client) AddDataLakeStoreAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string, parameters AddDataLakeStoreParameters) (*http.Request, error) { 93 pathParameters := map[string]interface{}{ 94 "accountName": autorest.Encode("path", accountName), 95 "dataLakeStoreAccountName": autorest.Encode("path", dataLakeStoreAccountName), 96 "resourceGroupName": autorest.Encode("path", resourceGroupName), 97 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 98 } 99 100 const APIVersion = "2015-10-01-preview" 101 queryParameters := map[string]interface{}{ 102 "api-version": APIVersion, 103 } 104 105 preparer := autorest.CreatePreparer( 106 autorest.AsContentType("application/json; charset=utf-8"), 107 autorest.AsPut(), 108 autorest.WithBaseURL(client.BaseURI), 109 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", pathParameters), 110 autorest.WithJSON(parameters), 111 autorest.WithQueryParameters(queryParameters)) 112 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 113} 114 115// AddDataLakeStoreAccountSender sends the AddDataLakeStoreAccount request. The method will close the 116// http.Response Body if it receives an error. 117func (client Client) AddDataLakeStoreAccountSender(req *http.Request) (*http.Response, error) { 118 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 119} 120 121// AddDataLakeStoreAccountResponder handles the response to the AddDataLakeStoreAccount request. The method always 122// closes the http.Response Body. 123func (client Client) AddDataLakeStoreAccountResponder(resp *http.Response) (result autorest.Response, err error) { 124 err = autorest.Respond( 125 resp, 126 azure.WithErrorUnlessStatusCode(http.StatusOK), 127 autorest.ByClosing()) 128 result.Response = resp 129 return 130} 131 132// AddStorageAccount updates the specified Data Lake Analytics account to add an Azure Storage account. 133// Parameters: 134// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 135// accountName - the name of the Data Lake Analytics account to which to add the Azure Storage account. 136// storageAccountName - the name of the Azure Storage account to add 137// parameters - the parameters containing the access key and optional suffix for the Azure Storage Account. 138func (client Client) AddStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (result autorest.Response, err error) { 139 if tracing.IsEnabled() { 140 ctx = tracing.StartSpan(ctx, fqdn+"/Client.AddStorageAccount") 141 defer func() { 142 sc := -1 143 if result.Response != nil { 144 sc = result.Response.StatusCode 145 } 146 tracing.EndSpan(ctx, sc, err) 147 }() 148 } 149 if err := validation.Validate([]validation.Validation{ 150 {TargetValue: parameters, 151 Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true, 152 Chain: []validation.Constraint{{Target: "parameters.Properties.AccessKey", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { 153 return result, validation.NewError("account.Client", "AddStorageAccount", err.Error()) 154 } 155 156 req, err := client.AddStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName, parameters) 157 if err != nil { 158 err = autorest.NewErrorWithError(err, "account.Client", "AddStorageAccount", nil, "Failure preparing request") 159 return 160 } 161 162 resp, err := client.AddStorageAccountSender(req) 163 if err != nil { 164 result.Response = resp 165 err = autorest.NewErrorWithError(err, "account.Client", "AddStorageAccount", resp, "Failure sending request") 166 return 167 } 168 169 result, err = client.AddStorageAccountResponder(resp) 170 if err != nil { 171 err = autorest.NewErrorWithError(err, "account.Client", "AddStorageAccount", resp, "Failure responding to request") 172 return 173 } 174 175 return 176} 177 178// AddStorageAccountPreparer prepares the AddStorageAccount request. 179func (client Client) AddStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (*http.Request, error) { 180 pathParameters := map[string]interface{}{ 181 "accountName": autorest.Encode("path", accountName), 182 "resourceGroupName": autorest.Encode("path", resourceGroupName), 183 "storageAccountName": autorest.Encode("path", storageAccountName), 184 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 185 } 186 187 const APIVersion = "2015-10-01-preview" 188 queryParameters := map[string]interface{}{ 189 "api-version": APIVersion, 190 } 191 192 preparer := autorest.CreatePreparer( 193 autorest.AsContentType("application/json; charset=utf-8"), 194 autorest.AsPut(), 195 autorest.WithBaseURL(client.BaseURI), 196 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters), 197 autorest.WithJSON(parameters), 198 autorest.WithQueryParameters(queryParameters)) 199 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 200} 201 202// AddStorageAccountSender sends the AddStorageAccount request. The method will close the 203// http.Response Body if it receives an error. 204func (client Client) AddStorageAccountSender(req *http.Request) (*http.Response, error) { 205 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 206} 207 208// AddStorageAccountResponder handles the response to the AddStorageAccount request. The method always 209// closes the http.Response Body. 210func (client Client) AddStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) { 211 err = autorest.Respond( 212 resp, 213 azure.WithErrorUnlessStatusCode(http.StatusOK), 214 autorest.ByClosing()) 215 result.Response = resp 216 return 217} 218 219// Create creates the specified Data Lake Analytics account. This supplies the user with computation services for Data 220// Lake Analytics workloads 221// Parameters: 222// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account.the 223// account will be associated with. 224// name - the name of the Data Lake Analytics account to create. 225// parameters - parameters supplied to the create Data Lake Analytics account operation. 226func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (result CreateFuture, err error) { 227 if tracing.IsEnabled() { 228 ctx = tracing.StartSpan(ctx, fqdn+"/Client.Create") 229 defer func() { 230 sc := -1 231 if result.Response() != nil { 232 sc = result.Response().StatusCode 233 } 234 tracing.EndSpan(ctx, sc, err) 235 }() 236 } 237 req, err := client.CreatePreparer(ctx, resourceGroupName, name, parameters) 238 if err != nil { 239 err = autorest.NewErrorWithError(err, "account.Client", "Create", nil, "Failure preparing request") 240 return 241 } 242 243 result, err = client.CreateSender(req) 244 if err != nil { 245 err = autorest.NewErrorWithError(err, "account.Client", "Create", nil, "Failure sending request") 246 return 247 } 248 249 return 250} 251 252// CreatePreparer prepares the Create request. 253func (client Client) CreatePreparer(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (*http.Request, error) { 254 pathParameters := map[string]interface{}{ 255 "name": autorest.Encode("path", name), 256 "resourceGroupName": autorest.Encode("path", resourceGroupName), 257 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 258 } 259 260 const APIVersion = "2015-10-01-preview" 261 queryParameters := map[string]interface{}{ 262 "api-version": APIVersion, 263 } 264 265 parameters.Type = nil 266 parameters.ID = nil 267 preparer := autorest.CreatePreparer( 268 autorest.AsContentType("application/json; charset=utf-8"), 269 autorest.AsPut(), 270 autorest.WithBaseURL(client.BaseURI), 271 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}", pathParameters), 272 autorest.WithJSON(parameters), 273 autorest.WithQueryParameters(queryParameters)) 274 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 275} 276 277// CreateSender sends the Create request. The method will close the 278// http.Response Body if it receives an error. 279func (client Client) CreateSender(req *http.Request) (future CreateFuture, err error) { 280 var resp *http.Response 281 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 282 if err != nil { 283 return 284 } 285 var azf azure.Future 286 azf, err = azure.NewFutureFromResponse(resp) 287 future.FutureAPI = &azf 288 future.Result = func(client Client) (dlaa DataLakeAnalyticsAccount, err error) { 289 var done bool 290 done, err = future.DoneWithContext(context.Background(), client) 291 if err != nil { 292 err = autorest.NewErrorWithError(err, "account.CreateFuture", "Result", future.Response(), "Polling failure") 293 return 294 } 295 if !done { 296 err = azure.NewAsyncOpIncompleteError("account.CreateFuture") 297 return 298 } 299 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 300 if dlaa.Response.Response, err = future.GetResult(sender); err == nil && dlaa.Response.Response.StatusCode != http.StatusNoContent { 301 dlaa, err = client.CreateResponder(dlaa.Response.Response) 302 if err != nil { 303 err = autorest.NewErrorWithError(err, "account.CreateFuture", "Result", dlaa.Response.Response, "Failure responding to request") 304 } 305 } 306 return 307 } 308 return 309} 310 311// CreateResponder handles the response to the Create request. The method always 312// closes the http.Response Body. 313func (client Client) CreateResponder(resp *http.Response) (result DataLakeAnalyticsAccount, err error) { 314 err = autorest.Respond( 315 resp, 316 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 317 autorest.ByUnmarshallingJSON(&result), 318 autorest.ByClosing()) 319 result.Response = autorest.Response{Response: resp} 320 return 321} 322 323// Delete begins the delete process for the Data Lake Analytics account object specified by the account name. 324// Parameters: 325// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 326// accountName - the name of the Data Lake Analytics account to delete 327func (client Client) Delete(ctx context.Context, resourceGroupName string, accountName string) (result DeleteFuture, err error) { 328 if tracing.IsEnabled() { 329 ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") 330 defer func() { 331 sc := -1 332 if result.Response() != nil { 333 sc = result.Response().StatusCode 334 } 335 tracing.EndSpan(ctx, sc, err) 336 }() 337 } 338 req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) 339 if err != nil { 340 err = autorest.NewErrorWithError(err, "account.Client", "Delete", nil, "Failure preparing request") 341 return 342 } 343 344 result, err = client.DeleteSender(req) 345 if err != nil { 346 err = autorest.NewErrorWithError(err, "account.Client", "Delete", nil, "Failure sending request") 347 return 348 } 349 350 return 351} 352 353// DeletePreparer prepares the Delete request. 354func (client Client) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { 355 pathParameters := map[string]interface{}{ 356 "accountName": autorest.Encode("path", accountName), 357 "resourceGroupName": autorest.Encode("path", resourceGroupName), 358 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 359 } 360 361 const APIVersion = "2015-10-01-preview" 362 queryParameters := map[string]interface{}{ 363 "api-version": APIVersion, 364 } 365 366 preparer := autorest.CreatePreparer( 367 autorest.AsDelete(), 368 autorest.WithBaseURL(client.BaseURI), 369 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", pathParameters), 370 autorest.WithQueryParameters(queryParameters)) 371 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 372} 373 374// DeleteSender sends the Delete request. The method will close the 375// http.Response Body if it receives an error. 376func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) { 377 var resp *http.Response 378 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 379 if err != nil { 380 return 381 } 382 var azf azure.Future 383 azf, err = azure.NewFutureFromResponse(resp) 384 future.FutureAPI = &azf 385 future.Result = func(client Client) (ar autorest.Response, err error) { 386 var done bool 387 done, err = future.DoneWithContext(context.Background(), client) 388 if err != nil { 389 err = autorest.NewErrorWithError(err, "account.DeleteFuture", "Result", future.Response(), "Polling failure") 390 return 391 } 392 if !done { 393 err = azure.NewAsyncOpIncompleteError("account.DeleteFuture") 394 return 395 } 396 ar.Response = future.Response() 397 return 398 } 399 return 400} 401 402// DeleteResponder handles the response to the Delete request. The method always 403// closes the http.Response Body. 404func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 405 err = autorest.Respond( 406 resp, 407 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound), 408 autorest.ByClosing()) 409 result.Response = resp 410 return 411} 412 413// DeleteDataLakeStoreAccount updates the Data Lake Analytics account specified to remove the specified Data Lake Store 414// account. 415// Parameters: 416// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 417// accountName - the name of the Data Lake Analytics account from which to remove the Data Lake Store account. 418// dataLakeStoreAccountName - the name of the Data Lake Store account to remove 419func (client Client) DeleteDataLakeStoreAccount(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (result autorest.Response, err error) { 420 if tracing.IsEnabled() { 421 ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteDataLakeStoreAccount") 422 defer func() { 423 sc := -1 424 if result.Response != nil { 425 sc = result.Response.StatusCode 426 } 427 tracing.EndSpan(ctx, sc, err) 428 }() 429 } 430 req, err := client.DeleteDataLakeStoreAccountPreparer(ctx, resourceGroupName, accountName, dataLakeStoreAccountName) 431 if err != nil { 432 err = autorest.NewErrorWithError(err, "account.Client", "DeleteDataLakeStoreAccount", nil, "Failure preparing request") 433 return 434 } 435 436 resp, err := client.DeleteDataLakeStoreAccountSender(req) 437 if err != nil { 438 result.Response = resp 439 err = autorest.NewErrorWithError(err, "account.Client", "DeleteDataLakeStoreAccount", resp, "Failure sending request") 440 return 441 } 442 443 result, err = client.DeleteDataLakeStoreAccountResponder(resp) 444 if err != nil { 445 err = autorest.NewErrorWithError(err, "account.Client", "DeleteDataLakeStoreAccount", resp, "Failure responding to request") 446 return 447 } 448 449 return 450} 451 452// DeleteDataLakeStoreAccountPreparer prepares the DeleteDataLakeStoreAccount request. 453func (client Client) DeleteDataLakeStoreAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (*http.Request, error) { 454 pathParameters := map[string]interface{}{ 455 "accountName": autorest.Encode("path", accountName), 456 "dataLakeStoreAccountName": autorest.Encode("path", dataLakeStoreAccountName), 457 "resourceGroupName": autorest.Encode("path", resourceGroupName), 458 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 459 } 460 461 const APIVersion = "2015-10-01-preview" 462 queryParameters := map[string]interface{}{ 463 "api-version": APIVersion, 464 } 465 466 preparer := autorest.CreatePreparer( 467 autorest.AsDelete(), 468 autorest.WithBaseURL(client.BaseURI), 469 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", pathParameters), 470 autorest.WithQueryParameters(queryParameters)) 471 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 472} 473 474// DeleteDataLakeStoreAccountSender sends the DeleteDataLakeStoreAccount request. The method will close the 475// http.Response Body if it receives an error. 476func (client Client) DeleteDataLakeStoreAccountSender(req *http.Request) (*http.Response, error) { 477 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 478} 479 480// DeleteDataLakeStoreAccountResponder handles the response to the DeleteDataLakeStoreAccount request. The method always 481// closes the http.Response Body. 482func (client Client) DeleteDataLakeStoreAccountResponder(resp *http.Response) (result autorest.Response, err error) { 483 err = autorest.Respond( 484 resp, 485 azure.WithErrorUnlessStatusCode(http.StatusOK), 486 autorest.ByClosing()) 487 result.Response = resp 488 return 489} 490 491// DeleteStorageAccount updates the specified Data Lake Analytics account to remove an Azure Storage account. 492// Parameters: 493// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 494// accountName - the name of the Data Lake Analytics account from which to remove the Azure Storage account. 495// storageAccountName - the name of the Azure Storage account to remove 496func (client Client) DeleteStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result autorest.Response, err error) { 497 if tracing.IsEnabled() { 498 ctx = tracing.StartSpan(ctx, fqdn+"/Client.DeleteStorageAccount") 499 defer func() { 500 sc := -1 501 if result.Response != nil { 502 sc = result.Response.StatusCode 503 } 504 tracing.EndSpan(ctx, sc, err) 505 }() 506 } 507 req, err := client.DeleteStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName) 508 if err != nil { 509 err = autorest.NewErrorWithError(err, "account.Client", "DeleteStorageAccount", nil, "Failure preparing request") 510 return 511 } 512 513 resp, err := client.DeleteStorageAccountSender(req) 514 if err != nil { 515 result.Response = resp 516 err = autorest.NewErrorWithError(err, "account.Client", "DeleteStorageAccount", resp, "Failure sending request") 517 return 518 } 519 520 result, err = client.DeleteStorageAccountResponder(resp) 521 if err != nil { 522 err = autorest.NewErrorWithError(err, "account.Client", "DeleteStorageAccount", resp, "Failure responding to request") 523 return 524 } 525 526 return 527} 528 529// DeleteStorageAccountPreparer prepares the DeleteStorageAccount request. 530func (client Client) DeleteStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (*http.Request, error) { 531 pathParameters := map[string]interface{}{ 532 "accountName": autorest.Encode("path", accountName), 533 "resourceGroupName": autorest.Encode("path", resourceGroupName), 534 "storageAccountName": autorest.Encode("path", storageAccountName), 535 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 536 } 537 538 const APIVersion = "2015-10-01-preview" 539 queryParameters := map[string]interface{}{ 540 "api-version": APIVersion, 541 } 542 543 preparer := autorest.CreatePreparer( 544 autorest.AsDelete(), 545 autorest.WithBaseURL(client.BaseURI), 546 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters), 547 autorest.WithQueryParameters(queryParameters)) 548 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 549} 550 551// DeleteStorageAccountSender sends the DeleteStorageAccount request. The method will close the 552// http.Response Body if it receives an error. 553func (client Client) DeleteStorageAccountSender(req *http.Request) (*http.Response, error) { 554 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 555} 556 557// DeleteStorageAccountResponder handles the response to the DeleteStorageAccount request. The method always 558// closes the http.Response Body. 559func (client Client) DeleteStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) { 560 err = autorest.Respond( 561 resp, 562 azure.WithErrorUnlessStatusCode(http.StatusOK), 563 autorest.ByClosing()) 564 result.Response = resp 565 return 566} 567 568// Get gets details of the specified Data Lake Analytics account. 569// Parameters: 570// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 571// accountName - the name of the Data Lake Analytics account to retrieve. 572func (client Client) Get(ctx context.Context, resourceGroupName string, accountName string) (result DataLakeAnalyticsAccount, err error) { 573 if tracing.IsEnabled() { 574 ctx = tracing.StartSpan(ctx, fqdn+"/Client.Get") 575 defer func() { 576 sc := -1 577 if result.Response.Response != nil { 578 sc = result.Response.Response.StatusCode 579 } 580 tracing.EndSpan(ctx, sc, err) 581 }() 582 } 583 req, err := client.GetPreparer(ctx, resourceGroupName, accountName) 584 if err != nil { 585 err = autorest.NewErrorWithError(err, "account.Client", "Get", nil, "Failure preparing request") 586 return 587 } 588 589 resp, err := client.GetSender(req) 590 if err != nil { 591 result.Response = autorest.Response{Response: resp} 592 err = autorest.NewErrorWithError(err, "account.Client", "Get", resp, "Failure sending request") 593 return 594 } 595 596 result, err = client.GetResponder(resp) 597 if err != nil { 598 err = autorest.NewErrorWithError(err, "account.Client", "Get", resp, "Failure responding to request") 599 return 600 } 601 602 return 603} 604 605// GetPreparer prepares the Get request. 606func (client Client) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { 607 pathParameters := map[string]interface{}{ 608 "accountName": autorest.Encode("path", accountName), 609 "resourceGroupName": autorest.Encode("path", resourceGroupName), 610 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 611 } 612 613 const APIVersion = "2015-10-01-preview" 614 queryParameters := map[string]interface{}{ 615 "api-version": APIVersion, 616 } 617 618 preparer := autorest.CreatePreparer( 619 autorest.AsGet(), 620 autorest.WithBaseURL(client.BaseURI), 621 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}", pathParameters), 622 autorest.WithQueryParameters(queryParameters)) 623 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 624} 625 626// GetSender sends the Get request. The method will close the 627// http.Response Body if it receives an error. 628func (client Client) GetSender(req *http.Request) (*http.Response, error) { 629 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 630} 631 632// GetResponder handles the response to the Get request. The method always 633// closes the http.Response Body. 634func (client Client) GetResponder(resp *http.Response) (result DataLakeAnalyticsAccount, err error) { 635 err = autorest.Respond( 636 resp, 637 azure.WithErrorUnlessStatusCode(http.StatusOK), 638 autorest.ByUnmarshallingJSON(&result), 639 autorest.ByClosing()) 640 result.Response = autorest.Response{Response: resp} 641 return 642} 643 644// GetDataLakeStoreAccount gets the specified Data Lake Store account details in the specified Data Lake Analytics 645// account. 646// Parameters: 647// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 648// accountName - the name of the Data Lake Analytics account from which to retrieve the Data Lake Store account 649// details. 650// dataLakeStoreAccountName - the name of the Data Lake Store account to retrieve 651func (client Client) GetDataLakeStoreAccount(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (result DataLakeStoreAccountInfo, err error) { 652 if tracing.IsEnabled() { 653 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetDataLakeStoreAccount") 654 defer func() { 655 sc := -1 656 if result.Response.Response != nil { 657 sc = result.Response.Response.StatusCode 658 } 659 tracing.EndSpan(ctx, sc, err) 660 }() 661 } 662 req, err := client.GetDataLakeStoreAccountPreparer(ctx, resourceGroupName, accountName, dataLakeStoreAccountName) 663 if err != nil { 664 err = autorest.NewErrorWithError(err, "account.Client", "GetDataLakeStoreAccount", nil, "Failure preparing request") 665 return 666 } 667 668 resp, err := client.GetDataLakeStoreAccountSender(req) 669 if err != nil { 670 result.Response = autorest.Response{Response: resp} 671 err = autorest.NewErrorWithError(err, "account.Client", "GetDataLakeStoreAccount", resp, "Failure sending request") 672 return 673 } 674 675 result, err = client.GetDataLakeStoreAccountResponder(resp) 676 if err != nil { 677 err = autorest.NewErrorWithError(err, "account.Client", "GetDataLakeStoreAccount", resp, "Failure responding to request") 678 return 679 } 680 681 return 682} 683 684// GetDataLakeStoreAccountPreparer prepares the GetDataLakeStoreAccount request. 685func (client Client) GetDataLakeStoreAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, dataLakeStoreAccountName string) (*http.Request, error) { 686 pathParameters := map[string]interface{}{ 687 "accountName": autorest.Encode("path", accountName), 688 "dataLakeStoreAccountName": autorest.Encode("path", dataLakeStoreAccountName), 689 "resourceGroupName": autorest.Encode("path", resourceGroupName), 690 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 691 } 692 693 const APIVersion = "2015-10-01-preview" 694 queryParameters := map[string]interface{}{ 695 "api-version": APIVersion, 696 } 697 698 preparer := autorest.CreatePreparer( 699 autorest.AsGet(), 700 autorest.WithBaseURL(client.BaseURI), 701 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/{dataLakeStoreAccountName}", pathParameters), 702 autorest.WithQueryParameters(queryParameters)) 703 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 704} 705 706// GetDataLakeStoreAccountSender sends the GetDataLakeStoreAccount request. The method will close the 707// http.Response Body if it receives an error. 708func (client Client) GetDataLakeStoreAccountSender(req *http.Request) (*http.Response, error) { 709 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 710} 711 712// GetDataLakeStoreAccountResponder handles the response to the GetDataLakeStoreAccount request. The method always 713// closes the http.Response Body. 714func (client Client) GetDataLakeStoreAccountResponder(resp *http.Response) (result DataLakeStoreAccountInfo, err error) { 715 err = autorest.Respond( 716 resp, 717 azure.WithErrorUnlessStatusCode(http.StatusOK), 718 autorest.ByUnmarshallingJSON(&result), 719 autorest.ByClosing()) 720 result.Response = autorest.Response{Response: resp} 721 return 722} 723 724// GetStorageAccount gets the specified Azure Storage account linked to the given Data Lake Analytics account. 725// Parameters: 726// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 727// accountName - the name of the Data Lake Analytics account from which to retrieve Azure storage account 728// details. 729// storageAccountName - the name of the Azure Storage account for which to retrieve the details. 730func (client Client) GetStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result StorageAccountInfo, err error) { 731 if tracing.IsEnabled() { 732 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetStorageAccount") 733 defer func() { 734 sc := -1 735 if result.Response.Response != nil { 736 sc = result.Response.Response.StatusCode 737 } 738 tracing.EndSpan(ctx, sc, err) 739 }() 740 } 741 req, err := client.GetStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName) 742 if err != nil { 743 err = autorest.NewErrorWithError(err, "account.Client", "GetStorageAccount", nil, "Failure preparing request") 744 return 745 } 746 747 resp, err := client.GetStorageAccountSender(req) 748 if err != nil { 749 result.Response = autorest.Response{Response: resp} 750 err = autorest.NewErrorWithError(err, "account.Client", "GetStorageAccount", resp, "Failure sending request") 751 return 752 } 753 754 result, err = client.GetStorageAccountResponder(resp) 755 if err != nil { 756 err = autorest.NewErrorWithError(err, "account.Client", "GetStorageAccount", resp, "Failure responding to request") 757 return 758 } 759 760 return 761} 762 763// GetStorageAccountPreparer prepares the GetStorageAccount request. 764func (client Client) GetStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (*http.Request, error) { 765 pathParameters := map[string]interface{}{ 766 "accountName": autorest.Encode("path", accountName), 767 "resourceGroupName": autorest.Encode("path", resourceGroupName), 768 "storageAccountName": autorest.Encode("path", storageAccountName), 769 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 770 } 771 772 const APIVersion = "2015-10-01-preview" 773 queryParameters := map[string]interface{}{ 774 "api-version": APIVersion, 775 } 776 777 preparer := autorest.CreatePreparer( 778 autorest.AsGet(), 779 autorest.WithBaseURL(client.BaseURI), 780 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters), 781 autorest.WithQueryParameters(queryParameters)) 782 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 783} 784 785// GetStorageAccountSender sends the GetStorageAccount request. The method will close the 786// http.Response Body if it receives an error. 787func (client Client) GetStorageAccountSender(req *http.Request) (*http.Response, error) { 788 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 789} 790 791// GetStorageAccountResponder handles the response to the GetStorageAccount request. The method always 792// closes the http.Response Body. 793func (client Client) GetStorageAccountResponder(resp *http.Response) (result StorageAccountInfo, err error) { 794 err = autorest.Respond( 795 resp, 796 azure.WithErrorUnlessStatusCode(http.StatusOK), 797 autorest.ByUnmarshallingJSON(&result), 798 autorest.ByClosing()) 799 result.Response = autorest.Response{Response: resp} 800 return 801} 802 803// GetStorageContainer gets the specified Azure Storage container associated with the given Data Lake Analytics and 804// Azure Storage accounts. 805// Parameters: 806// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 807// accountName - the name of the Data Lake Analytics account for which to retrieve blob container. 808// storageAccountName - the name of the Azure storage account from which to retrieve the blob container. 809// containerName - the name of the Azure storage container to retrieve 810func (client Client) GetStorageContainer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (result BlobContainer, err error) { 811 if tracing.IsEnabled() { 812 ctx = tracing.StartSpan(ctx, fqdn+"/Client.GetStorageContainer") 813 defer func() { 814 sc := -1 815 if result.Response.Response != nil { 816 sc = result.Response.Response.StatusCode 817 } 818 tracing.EndSpan(ctx, sc, err) 819 }() 820 } 821 req, err := client.GetStorageContainerPreparer(ctx, resourceGroupName, accountName, storageAccountName, containerName) 822 if err != nil { 823 err = autorest.NewErrorWithError(err, "account.Client", "GetStorageContainer", nil, "Failure preparing request") 824 return 825 } 826 827 resp, err := client.GetStorageContainerSender(req) 828 if err != nil { 829 result.Response = autorest.Response{Response: resp} 830 err = autorest.NewErrorWithError(err, "account.Client", "GetStorageContainer", resp, "Failure sending request") 831 return 832 } 833 834 result, err = client.GetStorageContainerResponder(resp) 835 if err != nil { 836 err = autorest.NewErrorWithError(err, "account.Client", "GetStorageContainer", resp, "Failure responding to request") 837 return 838 } 839 840 return 841} 842 843// GetStorageContainerPreparer prepares the GetStorageContainer request. 844func (client Client) GetStorageContainerPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (*http.Request, error) { 845 pathParameters := map[string]interface{}{ 846 "accountName": autorest.Encode("path", accountName), 847 "containerName": autorest.Encode("path", containerName), 848 "resourceGroupName": autorest.Encode("path", resourceGroupName), 849 "storageAccountName": autorest.Encode("path", storageAccountName), 850 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 851 } 852 853 const APIVersion = "2015-10-01-preview" 854 queryParameters := map[string]interface{}{ 855 "api-version": APIVersion, 856 } 857 858 preparer := autorest.CreatePreparer( 859 autorest.AsGet(), 860 autorest.WithBaseURL(client.BaseURI), 861 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}", pathParameters), 862 autorest.WithQueryParameters(queryParameters)) 863 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 864} 865 866// GetStorageContainerSender sends the GetStorageContainer request. The method will close the 867// http.Response Body if it receives an error. 868func (client Client) GetStorageContainerSender(req *http.Request) (*http.Response, error) { 869 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 870} 871 872// GetStorageContainerResponder handles the response to the GetStorageContainer request. The method always 873// closes the http.Response Body. 874func (client Client) GetStorageContainerResponder(resp *http.Response) (result BlobContainer, err error) { 875 err = autorest.Respond( 876 resp, 877 azure.WithErrorUnlessStatusCode(http.StatusOK), 878 autorest.ByUnmarshallingJSON(&result), 879 autorest.ByClosing()) 880 result.Response = autorest.Response{Response: resp} 881 return 882} 883 884// List gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a 885// link to the next page, if any. 886// Parameters: 887// filter - oData filter. Optional. 888// top - the number of items to return. Optional. 889// skip - the number of items to skip over before returning elements. Optional. 890// expand - oData expansion. Expand related resources in line with the retrieved resources, e.g. 891// Categories/$expand=Products would expand Product data in line with each Category entry. Optional. 892// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 893// Categories?$select=CategoryName,Description. Optional. 894// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 895// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 896// Optional. 897// count - the Boolean value of true or false to request a count of the matching resources included with the 898// resources in the response, e.g. Categories?$count=true. Optional. 899// search - a free form search. A free-text search expression to match for whether a particular entry should be 900// included in the feed, e.g. Categories?$search=blue OR green. Optional. 901// formatParameter - the desired return format. Return the response in particular format without access to 902// request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. 903func (client Client) List(ctx context.Context, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultPage, err error) { 904 if tracing.IsEnabled() { 905 ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") 906 defer func() { 907 sc := -1 908 if result.dlaalr.Response.Response != nil { 909 sc = result.dlaalr.Response.Response.StatusCode 910 } 911 tracing.EndSpan(ctx, sc, err) 912 }() 913 } 914 result.fn = client.listNextResults 915 req, err := client.ListPreparer(ctx, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 916 if err != nil { 917 err = autorest.NewErrorWithError(err, "account.Client", "List", nil, "Failure preparing request") 918 return 919 } 920 921 resp, err := client.ListSender(req) 922 if err != nil { 923 result.dlaalr.Response = autorest.Response{Response: resp} 924 err = autorest.NewErrorWithError(err, "account.Client", "List", resp, "Failure sending request") 925 return 926 } 927 928 result.dlaalr, err = client.ListResponder(resp) 929 if err != nil { 930 err = autorest.NewErrorWithError(err, "account.Client", "List", resp, "Failure responding to request") 931 return 932 } 933 if result.dlaalr.hasNextLink() && result.dlaalr.IsEmpty() { 934 err = result.NextWithContext(ctx) 935 return 936 } 937 938 return 939} 940 941// ListPreparer prepares the List request. 942func (client Client) ListPreparer(ctx context.Context, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) { 943 pathParameters := map[string]interface{}{ 944 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 945 } 946 947 const APIVersion = "2015-10-01-preview" 948 queryParameters := map[string]interface{}{ 949 "api-version": APIVersion, 950 } 951 if len(filter) > 0 { 952 queryParameters["$filter"] = autorest.Encode("query", filter) 953 } 954 if top != nil { 955 queryParameters["$top"] = autorest.Encode("query", *top) 956 } 957 if skip != nil { 958 queryParameters["$skip"] = autorest.Encode("query", *skip) 959 } 960 if len(expand) > 0 { 961 queryParameters["$expand"] = autorest.Encode("query", expand) 962 } 963 if len(selectParameter) > 0 { 964 queryParameters["$select"] = autorest.Encode("query", selectParameter) 965 } 966 if len(orderby) > 0 { 967 queryParameters["$orderby"] = autorest.Encode("query", orderby) 968 } 969 if count != nil { 970 queryParameters["$count"] = autorest.Encode("query", *count) 971 } 972 if len(search) > 0 { 973 queryParameters["$search"] = autorest.Encode("query", search) 974 } 975 if len(formatParameter) > 0 { 976 queryParameters["$format"] = autorest.Encode("query", formatParameter) 977 } 978 979 preparer := autorest.CreatePreparer( 980 autorest.AsGet(), 981 autorest.WithBaseURL(client.BaseURI), 982 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataLakeAnalytics/accounts", pathParameters), 983 autorest.WithQueryParameters(queryParameters)) 984 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 985} 986 987// ListSender sends the List request. The method will close the 988// http.Response Body if it receives an error. 989func (client Client) ListSender(req *http.Request) (*http.Response, error) { 990 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 991} 992 993// ListResponder handles the response to the List request. The method always 994// closes the http.Response Body. 995func (client Client) ListResponder(resp *http.Response) (result DataLakeAnalyticsAccountListResult, err error) { 996 err = autorest.Respond( 997 resp, 998 azure.WithErrorUnlessStatusCode(http.StatusOK), 999 autorest.ByUnmarshallingJSON(&result), 1000 autorest.ByClosing()) 1001 result.Response = autorest.Response{Response: resp} 1002 return 1003} 1004 1005// listNextResults retrieves the next set of results, if any. 1006func (client Client) listNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListResult) (result DataLakeAnalyticsAccountListResult, err error) { 1007 req, err := lastResults.dataLakeAnalyticsAccountListResultPreparer(ctx) 1008 if err != nil { 1009 return result, autorest.NewErrorWithError(err, "account.Client", "listNextResults", nil, "Failure preparing next results request") 1010 } 1011 if req == nil { 1012 return 1013 } 1014 resp, err := client.ListSender(req) 1015 if err != nil { 1016 result.Response = autorest.Response{Response: resp} 1017 return result, autorest.NewErrorWithError(err, "account.Client", "listNextResults", resp, "Failure sending next results request") 1018 } 1019 result, err = client.ListResponder(resp) 1020 if err != nil { 1021 err = autorest.NewErrorWithError(err, "account.Client", "listNextResults", resp, "Failure responding to next results request") 1022 } 1023 return 1024} 1025 1026// ListComplete enumerates all values, automatically crossing page boundaries as required. 1027func (client Client) ListComplete(ctx context.Context, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultIterator, err error) { 1028 if tracing.IsEnabled() { 1029 ctx = tracing.StartSpan(ctx, fqdn+"/Client.List") 1030 defer func() { 1031 sc := -1 1032 if result.Response().Response.Response != nil { 1033 sc = result.page.Response().Response.Response.StatusCode 1034 } 1035 tracing.EndSpan(ctx, sc, err) 1036 }() 1037 } 1038 result.page, err = client.List(ctx, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 1039 return 1040} 1041 1042// ListByResourceGroup gets the first page of Data Lake Analytics accounts, if any, within a specific resource group. 1043// This includes a link to the next page, if any. 1044// Parameters: 1045// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 1046// filter - oData filter. Optional. 1047// top - the number of items to return. Optional. 1048// skip - the number of items to skip over before returning elements. Optional. 1049// expand - oData expansion. Expand related resources in line with the retrieved resources, e.g. 1050// Categories/$expand=Products would expand Product data in line with each Category entry. Optional. 1051// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 1052// Categories?$select=CategoryName,Description. Optional. 1053// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 1054// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 1055// Optional. 1056// count - the Boolean value of true or false to request a count of the matching resources included with the 1057// resources in the response, e.g. Categories?$count=true. Optional. 1058// search - a free form search. A free-text search expression to match for whether a particular entry should be 1059// included in the feed, e.g. Categories?$search=blue OR green. Optional. 1060// formatParameter - the return format. Return the response in particular format without access to request 1061// headers for standard content-type negotiation (e.g Orders?$format=json). Optional. 1062func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultPage, err error) { 1063 if tracing.IsEnabled() { 1064 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") 1065 defer func() { 1066 sc := -1 1067 if result.dlaalr.Response.Response != nil { 1068 sc = result.dlaalr.Response.Response.StatusCode 1069 } 1070 tracing.EndSpan(ctx, sc, err) 1071 }() 1072 } 1073 result.fn = client.listByResourceGroupNextResults 1074 req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 1075 if err != nil { 1076 err = autorest.NewErrorWithError(err, "account.Client", "ListByResourceGroup", nil, "Failure preparing request") 1077 return 1078 } 1079 1080 resp, err := client.ListByResourceGroupSender(req) 1081 if err != nil { 1082 result.dlaalr.Response = autorest.Response{Response: resp} 1083 err = autorest.NewErrorWithError(err, "account.Client", "ListByResourceGroup", resp, "Failure sending request") 1084 return 1085 } 1086 1087 result.dlaalr, err = client.ListByResourceGroupResponder(resp) 1088 if err != nil { 1089 err = autorest.NewErrorWithError(err, "account.Client", "ListByResourceGroup", resp, "Failure responding to request") 1090 return 1091 } 1092 if result.dlaalr.hasNextLink() && result.dlaalr.IsEmpty() { 1093 err = result.NextWithContext(ctx) 1094 return 1095 } 1096 1097 return 1098} 1099 1100// ListByResourceGroupPreparer prepares the ListByResourceGroup request. 1101func (client Client) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) { 1102 pathParameters := map[string]interface{}{ 1103 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1104 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1105 } 1106 1107 const APIVersion = "2015-10-01-preview" 1108 queryParameters := map[string]interface{}{ 1109 "api-version": APIVersion, 1110 } 1111 if len(filter) > 0 { 1112 queryParameters["$filter"] = autorest.Encode("query", filter) 1113 } 1114 if top != nil { 1115 queryParameters["$top"] = autorest.Encode("query", *top) 1116 } 1117 if skip != nil { 1118 queryParameters["$skip"] = autorest.Encode("query", *skip) 1119 } 1120 if len(expand) > 0 { 1121 queryParameters["$expand"] = autorest.Encode("query", expand) 1122 } 1123 if len(selectParameter) > 0 { 1124 queryParameters["$select"] = autorest.Encode("query", selectParameter) 1125 } 1126 if len(orderby) > 0 { 1127 queryParameters["$orderby"] = autorest.Encode("query", orderby) 1128 } 1129 if count != nil { 1130 queryParameters["$count"] = autorest.Encode("query", *count) 1131 } 1132 if len(search) > 0 { 1133 queryParameters["$search"] = autorest.Encode("query", search) 1134 } 1135 if len(formatParameter) > 0 { 1136 queryParameters["$format"] = autorest.Encode("query", formatParameter) 1137 } 1138 1139 preparer := autorest.CreatePreparer( 1140 autorest.AsGet(), 1141 autorest.WithBaseURL(client.BaseURI), 1142 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts", pathParameters), 1143 autorest.WithQueryParameters(queryParameters)) 1144 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1145} 1146 1147// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the 1148// http.Response Body if it receives an error. 1149func (client Client) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { 1150 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1151} 1152 1153// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always 1154// closes the http.Response Body. 1155func (client Client) ListByResourceGroupResponder(resp *http.Response) (result DataLakeAnalyticsAccountListResult, err error) { 1156 err = autorest.Respond( 1157 resp, 1158 azure.WithErrorUnlessStatusCode(http.StatusOK), 1159 autorest.ByUnmarshallingJSON(&result), 1160 autorest.ByClosing()) 1161 result.Response = autorest.Response{Response: resp} 1162 return 1163} 1164 1165// listByResourceGroupNextResults retrieves the next set of results, if any. 1166func (client Client) listByResourceGroupNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListResult) (result DataLakeAnalyticsAccountListResult, err error) { 1167 req, err := lastResults.dataLakeAnalyticsAccountListResultPreparer(ctx) 1168 if err != nil { 1169 return result, autorest.NewErrorWithError(err, "account.Client", "listByResourceGroupNextResults", nil, "Failure preparing next results request") 1170 } 1171 if req == nil { 1172 return 1173 } 1174 resp, err := client.ListByResourceGroupSender(req) 1175 if err != nil { 1176 result.Response = autorest.Response{Response: resp} 1177 return result, autorest.NewErrorWithError(err, "account.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request") 1178 } 1179 result, err = client.ListByResourceGroupResponder(resp) 1180 if err != nil { 1181 err = autorest.NewErrorWithError(err, "account.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request") 1182 } 1183 return 1184} 1185 1186// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. 1187func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListResultIterator, err error) { 1188 if tracing.IsEnabled() { 1189 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") 1190 defer func() { 1191 sc := -1 1192 if result.Response().Response.Response != nil { 1193 sc = result.page.Response().Response.Response.StatusCode 1194 } 1195 tracing.EndSpan(ctx, sc, err) 1196 }() 1197 } 1198 result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 1199 return 1200} 1201 1202// ListDataLakeStoreAccounts gets the first page of Data Lake Store accounts linked to the specified Data Lake 1203// Analytics account. The response includes a link to the next page, if any. 1204// Parameters: 1205// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 1206// accountName - the name of the Data Lake Analytics account for which to list Data Lake Store accounts. 1207// filter - oData filter. Optional. 1208// top - the number of items to return. Optional. 1209// skip - the number of items to skip over before returning elements. Optional. 1210// expand - oData expansion. Expand related resources in line with the retrieved resources, e.g. 1211// Categories/$expand=Products would expand Product data in line with each Category entry. Optional. 1212// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 1213// Categories?$select=CategoryName,Description. Optional. 1214// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 1215// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 1216// Optional. 1217// count - the Boolean value of true or false to request a count of the matching resources included with the 1218// resources in the response, e.g. Categories?$count=true. Optional. 1219// search - a free form search. A free-text search expression to match for whether a particular entry should be 1220// included in the feed, e.g. Categories?$search=blue OR green. Optional. 1221// formatParameter - the desired return format. Return the response in particular format without access to 1222// request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. 1223func (client Client) ListDataLakeStoreAccounts(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListDataLakeStoreResultPage, err error) { 1224 if tracing.IsEnabled() { 1225 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDataLakeStoreAccounts") 1226 defer func() { 1227 sc := -1 1228 if result.dlaaldlsr.Response.Response != nil { 1229 sc = result.dlaaldlsr.Response.Response.StatusCode 1230 } 1231 tracing.EndSpan(ctx, sc, err) 1232 }() 1233 } 1234 result.fn = client.listDataLakeStoreAccountsNextResults 1235 req, err := client.ListDataLakeStoreAccountsPreparer(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 1236 if err != nil { 1237 err = autorest.NewErrorWithError(err, "account.Client", "ListDataLakeStoreAccounts", nil, "Failure preparing request") 1238 return 1239 } 1240 1241 resp, err := client.ListDataLakeStoreAccountsSender(req) 1242 if err != nil { 1243 result.dlaaldlsr.Response = autorest.Response{Response: resp} 1244 err = autorest.NewErrorWithError(err, "account.Client", "ListDataLakeStoreAccounts", resp, "Failure sending request") 1245 return 1246 } 1247 1248 result.dlaaldlsr, err = client.ListDataLakeStoreAccountsResponder(resp) 1249 if err != nil { 1250 err = autorest.NewErrorWithError(err, "account.Client", "ListDataLakeStoreAccounts", resp, "Failure responding to request") 1251 return 1252 } 1253 if result.dlaaldlsr.hasNextLink() && result.dlaaldlsr.IsEmpty() { 1254 err = result.NextWithContext(ctx) 1255 return 1256 } 1257 1258 return 1259} 1260 1261// ListDataLakeStoreAccountsPreparer prepares the ListDataLakeStoreAccounts request. 1262func (client Client) ListDataLakeStoreAccountsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) { 1263 pathParameters := map[string]interface{}{ 1264 "accountName": autorest.Encode("path", accountName), 1265 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1266 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1267 } 1268 1269 const APIVersion = "2015-10-01-preview" 1270 queryParameters := map[string]interface{}{ 1271 "api-version": APIVersion, 1272 } 1273 if len(filter) > 0 { 1274 queryParameters["$filter"] = autorest.Encode("query", filter) 1275 } 1276 if top != nil { 1277 queryParameters["$top"] = autorest.Encode("query", *top) 1278 } 1279 if skip != nil { 1280 queryParameters["$skip"] = autorest.Encode("query", *skip) 1281 } 1282 if len(expand) > 0 { 1283 queryParameters["$expand"] = autorest.Encode("query", expand) 1284 } 1285 if len(selectParameter) > 0 { 1286 queryParameters["$select"] = autorest.Encode("query", selectParameter) 1287 } 1288 if len(orderby) > 0 { 1289 queryParameters["$orderby"] = autorest.Encode("query", orderby) 1290 } 1291 if count != nil { 1292 queryParameters["$count"] = autorest.Encode("query", *count) 1293 } 1294 if len(search) > 0 { 1295 queryParameters["$search"] = autorest.Encode("query", search) 1296 } 1297 if len(formatParameter) > 0 { 1298 queryParameters["$format"] = autorest.Encode("query", formatParameter) 1299 } 1300 1301 preparer := autorest.CreatePreparer( 1302 autorest.AsGet(), 1303 autorest.WithBaseURL(client.BaseURI), 1304 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/DataLakeStoreAccounts/", pathParameters), 1305 autorest.WithQueryParameters(queryParameters)) 1306 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1307} 1308 1309// ListDataLakeStoreAccountsSender sends the ListDataLakeStoreAccounts request. The method will close the 1310// http.Response Body if it receives an error. 1311func (client Client) ListDataLakeStoreAccountsSender(req *http.Request) (*http.Response, error) { 1312 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1313} 1314 1315// ListDataLakeStoreAccountsResponder handles the response to the ListDataLakeStoreAccounts request. The method always 1316// closes the http.Response Body. 1317func (client Client) ListDataLakeStoreAccountsResponder(resp *http.Response) (result DataLakeAnalyticsAccountListDataLakeStoreResult, err error) { 1318 err = autorest.Respond( 1319 resp, 1320 azure.WithErrorUnlessStatusCode(http.StatusOK), 1321 autorest.ByUnmarshallingJSON(&result), 1322 autorest.ByClosing()) 1323 result.Response = autorest.Response{Response: resp} 1324 return 1325} 1326 1327// listDataLakeStoreAccountsNextResults retrieves the next set of results, if any. 1328func (client Client) listDataLakeStoreAccountsNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListDataLakeStoreResult) (result DataLakeAnalyticsAccountListDataLakeStoreResult, err error) { 1329 req, err := lastResults.dataLakeAnalyticsAccountListDataLakeStoreResultPreparer(ctx) 1330 if err != nil { 1331 return result, autorest.NewErrorWithError(err, "account.Client", "listDataLakeStoreAccountsNextResults", nil, "Failure preparing next results request") 1332 } 1333 if req == nil { 1334 return 1335 } 1336 resp, err := client.ListDataLakeStoreAccountsSender(req) 1337 if err != nil { 1338 result.Response = autorest.Response{Response: resp} 1339 return result, autorest.NewErrorWithError(err, "account.Client", "listDataLakeStoreAccountsNextResults", resp, "Failure sending next results request") 1340 } 1341 result, err = client.ListDataLakeStoreAccountsResponder(resp) 1342 if err != nil { 1343 err = autorest.NewErrorWithError(err, "account.Client", "listDataLakeStoreAccountsNextResults", resp, "Failure responding to next results request") 1344 } 1345 return 1346} 1347 1348// ListDataLakeStoreAccountsComplete enumerates all values, automatically crossing page boundaries as required. 1349func (client Client) ListDataLakeStoreAccountsComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListDataLakeStoreResultIterator, err error) { 1350 if tracing.IsEnabled() { 1351 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListDataLakeStoreAccounts") 1352 defer func() { 1353 sc := -1 1354 if result.Response().Response.Response != nil { 1355 sc = result.page.Response().Response.Response.StatusCode 1356 } 1357 tracing.EndSpan(ctx, sc, err) 1358 }() 1359 } 1360 result.page, err = client.ListDataLakeStoreAccounts(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 1361 return 1362} 1363 1364// ListSasTokens gets the SAS token associated with the specified Data Lake Analytics and Azure Storage account and 1365// container combination. 1366// Parameters: 1367// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 1368// accountName - the name of the Data Lake Analytics account from which an Azure Storage account's SAS token is 1369// being requested. 1370// storageAccountName - the name of the Azure storage account for which the SAS token is being requested. 1371// containerName - the name of the Azure storage container for which the SAS token is being requested. 1372func (client Client) ListSasTokens(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (result ListSasTokensResultPage, err error) { 1373 if tracing.IsEnabled() { 1374 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSasTokens") 1375 defer func() { 1376 sc := -1 1377 if result.lstr.Response.Response != nil { 1378 sc = result.lstr.Response.Response.StatusCode 1379 } 1380 tracing.EndSpan(ctx, sc, err) 1381 }() 1382 } 1383 result.fn = client.listSasTokensNextResults 1384 req, err := client.ListSasTokensPreparer(ctx, resourceGroupName, accountName, storageAccountName, containerName) 1385 if err != nil { 1386 err = autorest.NewErrorWithError(err, "account.Client", "ListSasTokens", nil, "Failure preparing request") 1387 return 1388 } 1389 1390 resp, err := client.ListSasTokensSender(req) 1391 if err != nil { 1392 result.lstr.Response = autorest.Response{Response: resp} 1393 err = autorest.NewErrorWithError(err, "account.Client", "ListSasTokens", resp, "Failure sending request") 1394 return 1395 } 1396 1397 result.lstr, err = client.ListSasTokensResponder(resp) 1398 if err != nil { 1399 err = autorest.NewErrorWithError(err, "account.Client", "ListSasTokens", resp, "Failure responding to request") 1400 return 1401 } 1402 if result.lstr.hasNextLink() && result.lstr.IsEmpty() { 1403 err = result.NextWithContext(ctx) 1404 return 1405 } 1406 1407 return 1408} 1409 1410// ListSasTokensPreparer prepares the ListSasTokens request. 1411func (client Client) ListSasTokensPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (*http.Request, error) { 1412 pathParameters := map[string]interface{}{ 1413 "accountName": autorest.Encode("path", accountName), 1414 "containerName": autorest.Encode("path", containerName), 1415 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1416 "storageAccountName": autorest.Encode("path", storageAccountName), 1417 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1418 } 1419 1420 const APIVersion = "2015-10-01-preview" 1421 queryParameters := map[string]interface{}{ 1422 "api-version": APIVersion, 1423 } 1424 1425 preparer := autorest.CreatePreparer( 1426 autorest.AsPost(), 1427 autorest.WithBaseURL(client.BaseURI), 1428 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers/{containerName}/listSasTokens", pathParameters), 1429 autorest.WithQueryParameters(queryParameters)) 1430 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1431} 1432 1433// ListSasTokensSender sends the ListSasTokens request. The method will close the 1434// http.Response Body if it receives an error. 1435func (client Client) ListSasTokensSender(req *http.Request) (*http.Response, error) { 1436 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1437} 1438 1439// ListSasTokensResponder handles the response to the ListSasTokens request. The method always 1440// closes the http.Response Body. 1441func (client Client) ListSasTokensResponder(resp *http.Response) (result ListSasTokensResult, err error) { 1442 err = autorest.Respond( 1443 resp, 1444 azure.WithErrorUnlessStatusCode(http.StatusOK), 1445 autorest.ByUnmarshallingJSON(&result), 1446 autorest.ByClosing()) 1447 result.Response = autorest.Response{Response: resp} 1448 return 1449} 1450 1451// listSasTokensNextResults retrieves the next set of results, if any. 1452func (client Client) listSasTokensNextResults(ctx context.Context, lastResults ListSasTokensResult) (result ListSasTokensResult, err error) { 1453 req, err := lastResults.listSasTokensResultPreparer(ctx) 1454 if err != nil { 1455 return result, autorest.NewErrorWithError(err, "account.Client", "listSasTokensNextResults", nil, "Failure preparing next results request") 1456 } 1457 if req == nil { 1458 return 1459 } 1460 resp, err := client.ListSasTokensSender(req) 1461 if err != nil { 1462 result.Response = autorest.Response{Response: resp} 1463 return result, autorest.NewErrorWithError(err, "account.Client", "listSasTokensNextResults", resp, "Failure sending next results request") 1464 } 1465 result, err = client.ListSasTokensResponder(resp) 1466 if err != nil { 1467 err = autorest.NewErrorWithError(err, "account.Client", "listSasTokensNextResults", resp, "Failure responding to next results request") 1468 } 1469 return 1470} 1471 1472// ListSasTokensComplete enumerates all values, automatically crossing page boundaries as required. 1473func (client Client) ListSasTokensComplete(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, containerName string) (result ListSasTokensResultIterator, err error) { 1474 if tracing.IsEnabled() { 1475 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListSasTokens") 1476 defer func() { 1477 sc := -1 1478 if result.Response().Response.Response != nil { 1479 sc = result.page.Response().Response.Response.StatusCode 1480 } 1481 tracing.EndSpan(ctx, sc, err) 1482 }() 1483 } 1484 result.page, err = client.ListSasTokens(ctx, resourceGroupName, accountName, storageAccountName, containerName) 1485 return 1486} 1487 1488// ListStorageAccounts gets the first page of Azure Storage accounts, if any, linked to the specified Data Lake 1489// Analytics account. The response includes a link to the next page, if any. 1490// Parameters: 1491// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 1492// accountName - the name of the Data Lake Analytics account for which to list Azure Storage accounts. 1493// filter - the OData filter. Optional. 1494// top - the number of items to return. Optional. 1495// skip - the number of items to skip over before returning elements. Optional. 1496// expand - oData expansion. Expand related resources in line with the retrieved resources, e.g. 1497// Categories/$expand=Products would expand Product data in line with each Category entry. Optional. 1498// selectParameter - oData Select statement. Limits the properties on each entry to just those requested, e.g. 1499// Categories?$select=CategoryName,Description. Optional. 1500// orderby - orderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or 1501// "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. 1502// Optional. 1503// count - the Boolean value of true or false to request a count of the matching resources included with the 1504// resources in the response, e.g. Categories?$count=true. Optional. 1505// search - a free form search. A free-text search expression to match for whether a particular entry should be 1506// included in the feed, e.g. Categories?$search=blue OR green. Optional. 1507// formatParameter - the desired return format. Return the response in particular format without access to 1508// request headers for standard content-type negotiation (e.g Orders?$format=json). Optional. 1509func (client Client) ListStorageAccounts(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListStorageAccountsResultPage, err error) { 1510 if tracing.IsEnabled() { 1511 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageAccounts") 1512 defer func() { 1513 sc := -1 1514 if result.dlaalsar.Response.Response != nil { 1515 sc = result.dlaalsar.Response.Response.StatusCode 1516 } 1517 tracing.EndSpan(ctx, sc, err) 1518 }() 1519 } 1520 result.fn = client.listStorageAccountsNextResults 1521 req, err := client.ListStorageAccountsPreparer(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 1522 if err != nil { 1523 err = autorest.NewErrorWithError(err, "account.Client", "ListStorageAccounts", nil, "Failure preparing request") 1524 return 1525 } 1526 1527 resp, err := client.ListStorageAccountsSender(req) 1528 if err != nil { 1529 result.dlaalsar.Response = autorest.Response{Response: resp} 1530 err = autorest.NewErrorWithError(err, "account.Client", "ListStorageAccounts", resp, "Failure sending request") 1531 return 1532 } 1533 1534 result.dlaalsar, err = client.ListStorageAccountsResponder(resp) 1535 if err != nil { 1536 err = autorest.NewErrorWithError(err, "account.Client", "ListStorageAccounts", resp, "Failure responding to request") 1537 return 1538 } 1539 if result.dlaalsar.hasNextLink() && result.dlaalsar.IsEmpty() { 1540 err = result.NextWithContext(ctx) 1541 return 1542 } 1543 1544 return 1545} 1546 1547// ListStorageAccountsPreparer prepares the ListStorageAccounts request. 1548func (client Client) ListStorageAccountsPreparer(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (*http.Request, error) { 1549 pathParameters := map[string]interface{}{ 1550 "accountName": autorest.Encode("path", accountName), 1551 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1552 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1553 } 1554 1555 const APIVersion = "2015-10-01-preview" 1556 queryParameters := map[string]interface{}{ 1557 "api-version": APIVersion, 1558 } 1559 if len(filter) > 0 { 1560 queryParameters["$filter"] = autorest.Encode("query", filter) 1561 } 1562 if top != nil { 1563 queryParameters["$top"] = autorest.Encode("query", *top) 1564 } 1565 if skip != nil { 1566 queryParameters["$skip"] = autorest.Encode("query", *skip) 1567 } 1568 if len(expand) > 0 { 1569 queryParameters["$expand"] = autorest.Encode("query", expand) 1570 } 1571 if len(selectParameter) > 0 { 1572 queryParameters["$select"] = autorest.Encode("query", selectParameter) 1573 } 1574 if len(orderby) > 0 { 1575 queryParameters["$orderby"] = autorest.Encode("query", orderby) 1576 } 1577 if count != nil { 1578 queryParameters["$count"] = autorest.Encode("query", *count) 1579 } 1580 if len(search) > 0 { 1581 queryParameters["$search"] = autorest.Encode("query", search) 1582 } 1583 if len(formatParameter) > 0 { 1584 queryParameters["$format"] = autorest.Encode("query", formatParameter) 1585 } 1586 1587 preparer := autorest.CreatePreparer( 1588 autorest.AsGet(), 1589 autorest.WithBaseURL(client.BaseURI), 1590 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/", pathParameters), 1591 autorest.WithQueryParameters(queryParameters)) 1592 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1593} 1594 1595// ListStorageAccountsSender sends the ListStorageAccounts request. The method will close the 1596// http.Response Body if it receives an error. 1597func (client Client) ListStorageAccountsSender(req *http.Request) (*http.Response, error) { 1598 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1599} 1600 1601// ListStorageAccountsResponder handles the response to the ListStorageAccounts request. The method always 1602// closes the http.Response Body. 1603func (client Client) ListStorageAccountsResponder(resp *http.Response) (result DataLakeAnalyticsAccountListStorageAccountsResult, err error) { 1604 err = autorest.Respond( 1605 resp, 1606 azure.WithErrorUnlessStatusCode(http.StatusOK), 1607 autorest.ByUnmarshallingJSON(&result), 1608 autorest.ByClosing()) 1609 result.Response = autorest.Response{Response: resp} 1610 return 1611} 1612 1613// listStorageAccountsNextResults retrieves the next set of results, if any. 1614func (client Client) listStorageAccountsNextResults(ctx context.Context, lastResults DataLakeAnalyticsAccountListStorageAccountsResult) (result DataLakeAnalyticsAccountListStorageAccountsResult, err error) { 1615 req, err := lastResults.dataLakeAnalyticsAccountListStorageAccountsResultPreparer(ctx) 1616 if err != nil { 1617 return result, autorest.NewErrorWithError(err, "account.Client", "listStorageAccountsNextResults", nil, "Failure preparing next results request") 1618 } 1619 if req == nil { 1620 return 1621 } 1622 resp, err := client.ListStorageAccountsSender(req) 1623 if err != nil { 1624 result.Response = autorest.Response{Response: resp} 1625 return result, autorest.NewErrorWithError(err, "account.Client", "listStorageAccountsNextResults", resp, "Failure sending next results request") 1626 } 1627 result, err = client.ListStorageAccountsResponder(resp) 1628 if err != nil { 1629 err = autorest.NewErrorWithError(err, "account.Client", "listStorageAccountsNextResults", resp, "Failure responding to next results request") 1630 } 1631 return 1632} 1633 1634// ListStorageAccountsComplete enumerates all values, automatically crossing page boundaries as required. 1635func (client Client) ListStorageAccountsComplete(ctx context.Context, resourceGroupName string, accountName string, filter string, top *int32, skip *int32, expand string, selectParameter string, orderby string, count *bool, search string, formatParameter string) (result DataLakeAnalyticsAccountListStorageAccountsResultIterator, err error) { 1636 if tracing.IsEnabled() { 1637 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageAccounts") 1638 defer func() { 1639 sc := -1 1640 if result.Response().Response.Response != nil { 1641 sc = result.page.Response().Response.Response.StatusCode 1642 } 1643 tracing.EndSpan(ctx, sc, err) 1644 }() 1645 } 1646 result.page, err = client.ListStorageAccounts(ctx, resourceGroupName, accountName, filter, top, skip, expand, selectParameter, orderby, count, search, formatParameter) 1647 return 1648} 1649 1650// ListStorageContainers lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics 1651// and Azure Storage account combination. The response includes a link to the next page of results, if any. 1652// Parameters: 1653// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 1654// accountName - the name of the Data Lake Analytics account for which to list Azure Storage blob containers. 1655// storageAccountName - the name of the Azure storage account from which to list blob containers. 1656func (client Client) ListStorageContainers(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result ListBlobContainersResultPage, err error) { 1657 if tracing.IsEnabled() { 1658 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageContainers") 1659 defer func() { 1660 sc := -1 1661 if result.lbcr.Response.Response != nil { 1662 sc = result.lbcr.Response.Response.StatusCode 1663 } 1664 tracing.EndSpan(ctx, sc, err) 1665 }() 1666 } 1667 result.fn = client.listStorageContainersNextResults 1668 req, err := client.ListStorageContainersPreparer(ctx, resourceGroupName, accountName, storageAccountName) 1669 if err != nil { 1670 err = autorest.NewErrorWithError(err, "account.Client", "ListStorageContainers", nil, "Failure preparing request") 1671 return 1672 } 1673 1674 resp, err := client.ListStorageContainersSender(req) 1675 if err != nil { 1676 result.lbcr.Response = autorest.Response{Response: resp} 1677 err = autorest.NewErrorWithError(err, "account.Client", "ListStorageContainers", resp, "Failure sending request") 1678 return 1679 } 1680 1681 result.lbcr, err = client.ListStorageContainersResponder(resp) 1682 if err != nil { 1683 err = autorest.NewErrorWithError(err, "account.Client", "ListStorageContainers", resp, "Failure responding to request") 1684 return 1685 } 1686 if result.lbcr.hasNextLink() && result.lbcr.IsEmpty() { 1687 err = result.NextWithContext(ctx) 1688 return 1689 } 1690 1691 return 1692} 1693 1694// ListStorageContainersPreparer prepares the ListStorageContainers request. 1695func (client Client) ListStorageContainersPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (*http.Request, error) { 1696 pathParameters := map[string]interface{}{ 1697 "accountName": autorest.Encode("path", accountName), 1698 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1699 "storageAccountName": autorest.Encode("path", storageAccountName), 1700 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1701 } 1702 1703 const APIVersion = "2015-10-01-preview" 1704 queryParameters := map[string]interface{}{ 1705 "api-version": APIVersion, 1706 } 1707 1708 preparer := autorest.CreatePreparer( 1709 autorest.AsGet(), 1710 autorest.WithBaseURL(client.BaseURI), 1711 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}/Containers", pathParameters), 1712 autorest.WithQueryParameters(queryParameters)) 1713 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1714} 1715 1716// ListStorageContainersSender sends the ListStorageContainers request. The method will close the 1717// http.Response Body if it receives an error. 1718func (client Client) ListStorageContainersSender(req *http.Request) (*http.Response, error) { 1719 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1720} 1721 1722// ListStorageContainersResponder handles the response to the ListStorageContainers request. The method always 1723// closes the http.Response Body. 1724func (client Client) ListStorageContainersResponder(resp *http.Response) (result ListBlobContainersResult, err error) { 1725 err = autorest.Respond( 1726 resp, 1727 azure.WithErrorUnlessStatusCode(http.StatusOK), 1728 autorest.ByUnmarshallingJSON(&result), 1729 autorest.ByClosing()) 1730 result.Response = autorest.Response{Response: resp} 1731 return 1732} 1733 1734// listStorageContainersNextResults retrieves the next set of results, if any. 1735func (client Client) listStorageContainersNextResults(ctx context.Context, lastResults ListBlobContainersResult) (result ListBlobContainersResult, err error) { 1736 req, err := lastResults.listBlobContainersResultPreparer(ctx) 1737 if err != nil { 1738 return result, autorest.NewErrorWithError(err, "account.Client", "listStorageContainersNextResults", nil, "Failure preparing next results request") 1739 } 1740 if req == nil { 1741 return 1742 } 1743 resp, err := client.ListStorageContainersSender(req) 1744 if err != nil { 1745 result.Response = autorest.Response{Response: resp} 1746 return result, autorest.NewErrorWithError(err, "account.Client", "listStorageContainersNextResults", resp, "Failure sending next results request") 1747 } 1748 result, err = client.ListStorageContainersResponder(resp) 1749 if err != nil { 1750 err = autorest.NewErrorWithError(err, "account.Client", "listStorageContainersNextResults", resp, "Failure responding to next results request") 1751 } 1752 return 1753} 1754 1755// ListStorageContainersComplete enumerates all values, automatically crossing page boundaries as required. 1756func (client Client) ListStorageContainersComplete(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string) (result ListBlobContainersResultIterator, err error) { 1757 if tracing.IsEnabled() { 1758 ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListStorageContainers") 1759 defer func() { 1760 sc := -1 1761 if result.Response().Response.Response != nil { 1762 sc = result.page.Response().Response.Response.StatusCode 1763 } 1764 tracing.EndSpan(ctx, sc, err) 1765 }() 1766 } 1767 result.page, err = client.ListStorageContainers(ctx, resourceGroupName, accountName, storageAccountName) 1768 return 1769} 1770 1771// Update updates the Data Lake Analytics account object specified by the accountName with the contents of the account 1772// object. 1773// Parameters: 1774// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 1775// name - the name of the Data Lake Analytics account to update. 1776// parameters - parameters supplied to the update Data Lake Analytics account operation. 1777func (client Client) Update(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (result UpdateFuture, err error) { 1778 if tracing.IsEnabled() { 1779 ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") 1780 defer func() { 1781 sc := -1 1782 if result.Response() != nil { 1783 sc = result.Response().StatusCode 1784 } 1785 tracing.EndSpan(ctx, sc, err) 1786 }() 1787 } 1788 req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters) 1789 if err != nil { 1790 err = autorest.NewErrorWithError(err, "account.Client", "Update", nil, "Failure preparing request") 1791 return 1792 } 1793 1794 result, err = client.UpdateSender(req) 1795 if err != nil { 1796 err = autorest.NewErrorWithError(err, "account.Client", "Update", nil, "Failure sending request") 1797 return 1798 } 1799 1800 return 1801} 1802 1803// UpdatePreparer prepares the Update request. 1804func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, parameters DataLakeAnalyticsAccount) (*http.Request, error) { 1805 pathParameters := map[string]interface{}{ 1806 "name": autorest.Encode("path", name), 1807 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1808 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1809 } 1810 1811 const APIVersion = "2015-10-01-preview" 1812 queryParameters := map[string]interface{}{ 1813 "api-version": APIVersion, 1814 } 1815 1816 parameters.Type = nil 1817 parameters.ID = nil 1818 preparer := autorest.CreatePreparer( 1819 autorest.AsContentType("application/json; charset=utf-8"), 1820 autorest.AsPatch(), 1821 autorest.WithBaseURL(client.BaseURI), 1822 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{name}", pathParameters), 1823 autorest.WithJSON(parameters), 1824 autorest.WithQueryParameters(queryParameters)) 1825 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1826} 1827 1828// UpdateSender sends the Update request. The method will close the 1829// http.Response Body if it receives an error. 1830func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err error) { 1831 var resp *http.Response 1832 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1833 if err != nil { 1834 return 1835 } 1836 var azf azure.Future 1837 azf, err = azure.NewFutureFromResponse(resp) 1838 future.FutureAPI = &azf 1839 future.Result = func(client Client) (dlaa DataLakeAnalyticsAccount, err error) { 1840 var done bool 1841 done, err = future.DoneWithContext(context.Background(), client) 1842 if err != nil { 1843 err = autorest.NewErrorWithError(err, "account.UpdateFuture", "Result", future.Response(), "Polling failure") 1844 return 1845 } 1846 if !done { 1847 err = azure.NewAsyncOpIncompleteError("account.UpdateFuture") 1848 return 1849 } 1850 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1851 if dlaa.Response.Response, err = future.GetResult(sender); err == nil && dlaa.Response.Response.StatusCode != http.StatusNoContent { 1852 dlaa, err = client.UpdateResponder(dlaa.Response.Response) 1853 if err != nil { 1854 err = autorest.NewErrorWithError(err, "account.UpdateFuture", "Result", dlaa.Response.Response, "Failure responding to request") 1855 } 1856 } 1857 return 1858 } 1859 return 1860} 1861 1862// UpdateResponder handles the response to the Update request. The method always 1863// closes the http.Response Body. 1864func (client Client) UpdateResponder(resp *http.Response) (result DataLakeAnalyticsAccount, err error) { 1865 err = autorest.Respond( 1866 resp, 1867 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 1868 autorest.ByUnmarshallingJSON(&result), 1869 autorest.ByClosing()) 1870 result.Response = autorest.Response{Response: resp} 1871 return 1872} 1873 1874// UpdateStorageAccount updates the Data Lake Analytics account to replace Azure Storage blob account details, such as 1875// the access key and/or suffix. 1876// Parameters: 1877// resourceGroupName - the name of the Azure resource group that contains the Data Lake Analytics account. 1878// accountName - the name of the Data Lake Analytics account to modify storage accounts in 1879// storageAccountName - the Azure Storage account to modify 1880// parameters - the parameters containing the access key and suffix to update the storage account with. 1881func (client Client) UpdateStorageAccount(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (result autorest.Response, err error) { 1882 if tracing.IsEnabled() { 1883 ctx = tracing.StartSpan(ctx, fqdn+"/Client.UpdateStorageAccount") 1884 defer func() { 1885 sc := -1 1886 if result.Response != nil { 1887 sc = result.Response.StatusCode 1888 } 1889 tracing.EndSpan(ctx, sc, err) 1890 }() 1891 } 1892 req, err := client.UpdateStorageAccountPreparer(ctx, resourceGroupName, accountName, storageAccountName, parameters) 1893 if err != nil { 1894 err = autorest.NewErrorWithError(err, "account.Client", "UpdateStorageAccount", nil, "Failure preparing request") 1895 return 1896 } 1897 1898 resp, err := client.UpdateStorageAccountSender(req) 1899 if err != nil { 1900 result.Response = resp 1901 err = autorest.NewErrorWithError(err, "account.Client", "UpdateStorageAccount", resp, "Failure sending request") 1902 return 1903 } 1904 1905 result, err = client.UpdateStorageAccountResponder(resp) 1906 if err != nil { 1907 err = autorest.NewErrorWithError(err, "account.Client", "UpdateStorageAccount", resp, "Failure responding to request") 1908 return 1909 } 1910 1911 return 1912} 1913 1914// UpdateStorageAccountPreparer prepares the UpdateStorageAccount request. 1915func (client Client) UpdateStorageAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, storageAccountName string, parameters AddStorageAccountParameters) (*http.Request, error) { 1916 pathParameters := map[string]interface{}{ 1917 "accountName": autorest.Encode("path", accountName), 1918 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1919 "storageAccountName": autorest.Encode("path", storageAccountName), 1920 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1921 } 1922 1923 const APIVersion = "2015-10-01-preview" 1924 queryParameters := map[string]interface{}{ 1925 "api-version": APIVersion, 1926 } 1927 1928 preparer := autorest.CreatePreparer( 1929 autorest.AsContentType("application/json; charset=utf-8"), 1930 autorest.AsPatch(), 1931 autorest.WithBaseURL(client.BaseURI), 1932 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataLakeAnalytics/accounts/{accountName}/StorageAccounts/{storageAccountName}", pathParameters), 1933 autorest.WithJSON(parameters), 1934 autorest.WithQueryParameters(queryParameters)) 1935 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1936} 1937 1938// UpdateStorageAccountSender sends the UpdateStorageAccount request. The method will close the 1939// http.Response Body if it receives an error. 1940func (client Client) UpdateStorageAccountSender(req *http.Request) (*http.Response, error) { 1941 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1942} 1943 1944// UpdateStorageAccountResponder handles the response to the UpdateStorageAccount request. The method always 1945// closes the http.Response Body. 1946func (client Client) UpdateStorageAccountResponder(resp *http.Response) (result autorest.Response, err error) { 1947 err = autorest.Respond( 1948 resp, 1949 azure.WithErrorUnlessStatusCode(http.StatusOK), 1950 autorest.ByClosing()) 1951 result.Response = resp 1952 return 1953} 1954