1package batch 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 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2019-04-01/batch" 33 34// Account contains information about an Azure Batch account. 35type Account struct { 36 autorest.Response `json:"-"` 37 // AccountProperties - The properties associated with the account. 38 *AccountProperties `json:"properties,omitempty"` 39 // ID - READ-ONLY; The ID of the resource. 40 ID *string `json:"id,omitempty"` 41 // Name - READ-ONLY; The name of the resource. 42 Name *string `json:"name,omitempty"` 43 // Type - READ-ONLY; The type of the resource. 44 Type *string `json:"type,omitempty"` 45 // Location - READ-ONLY; The location of the resource. 46 Location *string `json:"location,omitempty"` 47 // Tags - READ-ONLY; The tags of the resource. 48 Tags map[string]*string `json:"tags"` 49} 50 51// MarshalJSON is the custom marshaler for Account. 52func (a Account) MarshalJSON() ([]byte, error) { 53 objectMap := make(map[string]interface{}) 54 if a.AccountProperties != nil { 55 objectMap["properties"] = a.AccountProperties 56 } 57 return json.Marshal(objectMap) 58} 59 60// UnmarshalJSON is the custom unmarshaler for Account struct. 61func (a *Account) UnmarshalJSON(body []byte) error { 62 var m map[string]*json.RawMessage 63 err := json.Unmarshal(body, &m) 64 if err != nil { 65 return err 66 } 67 for k, v := range m { 68 switch k { 69 case "properties": 70 if v != nil { 71 var accountProperties AccountProperties 72 err = json.Unmarshal(*v, &accountProperties) 73 if err != nil { 74 return err 75 } 76 a.AccountProperties = &accountProperties 77 } 78 case "id": 79 if v != nil { 80 var ID string 81 err = json.Unmarshal(*v, &ID) 82 if err != nil { 83 return err 84 } 85 a.ID = &ID 86 } 87 case "name": 88 if v != nil { 89 var name string 90 err = json.Unmarshal(*v, &name) 91 if err != nil { 92 return err 93 } 94 a.Name = &name 95 } 96 case "type": 97 if v != nil { 98 var typeVar string 99 err = json.Unmarshal(*v, &typeVar) 100 if err != nil { 101 return err 102 } 103 a.Type = &typeVar 104 } 105 case "location": 106 if v != nil { 107 var location string 108 err = json.Unmarshal(*v, &location) 109 if err != nil { 110 return err 111 } 112 a.Location = &location 113 } 114 case "tags": 115 if v != nil { 116 var tags map[string]*string 117 err = json.Unmarshal(*v, &tags) 118 if err != nil { 119 return err 120 } 121 a.Tags = tags 122 } 123 } 124 } 125 126 return nil 127} 128 129// AccountCreateFuture an abstraction for monitoring and retrieving the results of a long-running 130// operation. 131type AccountCreateFuture struct { 132 azure.FutureAPI 133 // Result returns the result of the asynchronous operation. 134 // If the operation has not completed it will return an error. 135 Result func(AccountClient) (Account, error) 136} 137 138// AccountCreateParameters parameters supplied to the Create operation. 139type AccountCreateParameters struct { 140 // Location - The region in which to create the account. 141 Location *string `json:"location,omitempty"` 142 // Tags - The user-specified tags associated with the account. 143 Tags map[string]*string `json:"tags"` 144 // AccountCreateProperties - The properties of the Batch account. 145 *AccountCreateProperties `json:"properties,omitempty"` 146} 147 148// MarshalJSON is the custom marshaler for AccountCreateParameters. 149func (acp AccountCreateParameters) MarshalJSON() ([]byte, error) { 150 objectMap := make(map[string]interface{}) 151 if acp.Location != nil { 152 objectMap["location"] = acp.Location 153 } 154 if acp.Tags != nil { 155 objectMap["tags"] = acp.Tags 156 } 157 if acp.AccountCreateProperties != nil { 158 objectMap["properties"] = acp.AccountCreateProperties 159 } 160 return json.Marshal(objectMap) 161} 162 163// UnmarshalJSON is the custom unmarshaler for AccountCreateParameters struct. 164func (acp *AccountCreateParameters) UnmarshalJSON(body []byte) error { 165 var m map[string]*json.RawMessage 166 err := json.Unmarshal(body, &m) 167 if err != nil { 168 return err 169 } 170 for k, v := range m { 171 switch k { 172 case "location": 173 if v != nil { 174 var location string 175 err = json.Unmarshal(*v, &location) 176 if err != nil { 177 return err 178 } 179 acp.Location = &location 180 } 181 case "tags": 182 if v != nil { 183 var tags map[string]*string 184 err = json.Unmarshal(*v, &tags) 185 if err != nil { 186 return err 187 } 188 acp.Tags = tags 189 } 190 case "properties": 191 if v != nil { 192 var accountCreateProperties AccountCreateProperties 193 err = json.Unmarshal(*v, &accountCreateProperties) 194 if err != nil { 195 return err 196 } 197 acp.AccountCreateProperties = &accountCreateProperties 198 } 199 } 200 } 201 202 return nil 203} 204 205// AccountCreateProperties the properties of a Batch account. 206type AccountCreateProperties struct { 207 // AutoStorage - The properties related to the auto-storage account. 208 AutoStorage *AutoStorageBaseProperties `json:"autoStorage,omitempty"` 209 // PoolAllocationMode - The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Azure Active Directory. If the mode is UserSubscription, clients must use Azure Active Directory. The default is BatchService. Possible values include: 'BatchService', 'UserSubscription' 210 PoolAllocationMode PoolAllocationMode `json:"poolAllocationMode,omitempty"` 211 // KeyVaultReference - A reference to the Azure key vault associated with the Batch account. 212 KeyVaultReference *KeyVaultReference `json:"keyVaultReference,omitempty"` 213} 214 215// AccountDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 216// operation. 217type AccountDeleteFuture struct { 218 azure.FutureAPI 219 // Result returns the result of the asynchronous operation. 220 // If the operation has not completed it will return an error. 221 Result func(AccountClient) (autorest.Response, error) 222} 223 224// AccountKeys a set of Azure Batch account keys. 225type AccountKeys struct { 226 autorest.Response `json:"-"` 227 // AccountName - READ-ONLY; The Batch account name. 228 AccountName *string `json:"accountName,omitempty"` 229 // Primary - READ-ONLY; The primary key associated with the account. 230 Primary *string `json:"primary,omitempty"` 231 // Secondary - READ-ONLY; The secondary key associated with the account. 232 Secondary *string `json:"secondary,omitempty"` 233} 234 235// AccountListResult values returned by the List operation. 236type AccountListResult struct { 237 autorest.Response `json:"-"` 238 // Value - The collection of Batch accounts returned by the listing operation. 239 Value *[]Account `json:"value,omitempty"` 240 // NextLink - The continuation token. 241 NextLink *string `json:"nextLink,omitempty"` 242} 243 244// AccountListResultIterator provides access to a complete listing of Account values. 245type AccountListResultIterator struct { 246 i int 247 page AccountListResultPage 248} 249 250// NextWithContext advances to the next value. If there was an error making 251// the request the iterator does not advance and the error is returned. 252func (iter *AccountListResultIterator) NextWithContext(ctx context.Context) (err error) { 253 if tracing.IsEnabled() { 254 ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultIterator.NextWithContext") 255 defer func() { 256 sc := -1 257 if iter.Response().Response.Response != nil { 258 sc = iter.Response().Response.Response.StatusCode 259 } 260 tracing.EndSpan(ctx, sc, err) 261 }() 262 } 263 iter.i++ 264 if iter.i < len(iter.page.Values()) { 265 return nil 266 } 267 err = iter.page.NextWithContext(ctx) 268 if err != nil { 269 iter.i-- 270 return err 271 } 272 iter.i = 0 273 return nil 274} 275 276// Next advances to the next value. If there was an error making 277// the request the iterator does not advance and the error is returned. 278// Deprecated: Use NextWithContext() instead. 279func (iter *AccountListResultIterator) Next() error { 280 return iter.NextWithContext(context.Background()) 281} 282 283// NotDone returns true if the enumeration should be started or is not yet complete. 284func (iter AccountListResultIterator) NotDone() bool { 285 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 286} 287 288// Response returns the raw server response from the last page request. 289func (iter AccountListResultIterator) Response() AccountListResult { 290 return iter.page.Response() 291} 292 293// Value returns the current value or a zero-initialized value if the 294// iterator has advanced beyond the end of the collection. 295func (iter AccountListResultIterator) Value() Account { 296 if !iter.page.NotDone() { 297 return Account{} 298 } 299 return iter.page.Values()[iter.i] 300} 301 302// Creates a new instance of the AccountListResultIterator type. 303func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { 304 return AccountListResultIterator{page: page} 305} 306 307// IsEmpty returns true if the ListResult contains no values. 308func (alr AccountListResult) IsEmpty() bool { 309 return alr.Value == nil || len(*alr.Value) == 0 310} 311 312// hasNextLink returns true if the NextLink is not empty. 313func (alr AccountListResult) hasNextLink() bool { 314 return alr.NextLink != nil && len(*alr.NextLink) != 0 315} 316 317// accountListResultPreparer prepares a request to retrieve the next set of results. 318// It returns nil if no more results exist. 319func (alr AccountListResult) accountListResultPreparer(ctx context.Context) (*http.Request, error) { 320 if !alr.hasNextLink() { 321 return nil, nil 322 } 323 return autorest.Prepare((&http.Request{}).WithContext(ctx), 324 autorest.AsJSON(), 325 autorest.AsGet(), 326 autorest.WithBaseURL(to.String(alr.NextLink))) 327} 328 329// AccountListResultPage contains a page of Account values. 330type AccountListResultPage struct { 331 fn func(context.Context, AccountListResult) (AccountListResult, error) 332 alr AccountListResult 333} 334 335// NextWithContext advances to the next page of values. If there was an error making 336// the request the page does not advance and the error is returned. 337func (page *AccountListResultPage) NextWithContext(ctx context.Context) (err error) { 338 if tracing.IsEnabled() { 339 ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultPage.NextWithContext") 340 defer func() { 341 sc := -1 342 if page.Response().Response.Response != nil { 343 sc = page.Response().Response.Response.StatusCode 344 } 345 tracing.EndSpan(ctx, sc, err) 346 }() 347 } 348 for { 349 next, err := page.fn(ctx, page.alr) 350 if err != nil { 351 return err 352 } 353 page.alr = next 354 if !next.hasNextLink() || !next.IsEmpty() { 355 break 356 } 357 } 358 return nil 359} 360 361// Next advances to the next page of values. If there was an error making 362// the request the page does not advance and the error is returned. 363// Deprecated: Use NextWithContext() instead. 364func (page *AccountListResultPage) Next() error { 365 return page.NextWithContext(context.Background()) 366} 367 368// NotDone returns true if the page enumeration should be started or is not yet complete. 369func (page AccountListResultPage) NotDone() bool { 370 return !page.alr.IsEmpty() 371} 372 373// Response returns the raw server response from the last page request. 374func (page AccountListResultPage) Response() AccountListResult { 375 return page.alr 376} 377 378// Values returns the slice of values for the current page or nil if there are no values. 379func (page AccountListResultPage) Values() []Account { 380 if page.alr.IsEmpty() { 381 return nil 382 } 383 return *page.alr.Value 384} 385 386// Creates a new instance of the AccountListResultPage type. 387func NewAccountListResultPage(cur AccountListResult, getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { 388 return AccountListResultPage{ 389 fn: getNextPage, 390 alr: cur, 391 } 392} 393 394// AccountProperties account specific properties. 395type AccountProperties struct { 396 // AccountEndpoint - READ-ONLY; The account endpoint used to interact with the Batch service. 397 AccountEndpoint *string `json:"accountEndpoint,omitempty"` 398 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'ProvisioningStateInvalid', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCancelled' 399 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 400 // PoolAllocationMode - READ-ONLY; Possible values include: 'BatchService', 'UserSubscription' 401 PoolAllocationMode PoolAllocationMode `json:"poolAllocationMode,omitempty"` 402 // KeyVaultReference - READ-ONLY 403 KeyVaultReference *KeyVaultReference `json:"keyVaultReference,omitempty"` 404 // AutoStorage - READ-ONLY 405 AutoStorage *AutoStorageProperties `json:"autoStorage,omitempty"` 406 // DedicatedCoreQuota - READ-ONLY; For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. 407 DedicatedCoreQuota *int32 `json:"dedicatedCoreQuota,omitempty"` 408 // LowPriorityCoreQuota - READ-ONLY; For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. 409 LowPriorityCoreQuota *int32 `json:"lowPriorityCoreQuota,omitempty"` 410 // DedicatedCoreQuotaPerVMFamily - READ-ONLY; A list of the dedicated core quota per Virtual Machine family for the Batch account. For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. 411 DedicatedCoreQuotaPerVMFamily *[]VirtualMachineFamilyCoreQuota `json:"dedicatedCoreQuotaPerVMFamily,omitempty"` 412 // DedicatedCoreQuotaPerVMFamilyEnforced - READ-ONLY; Batch is transitioning its core quota system for dedicated cores to be enforced per Virtual Machine family. During this transitional phase, the dedicated core quota per Virtual Machine family may not yet be enforced. If this flag is false, dedicated core quota is enforced via the old dedicatedCoreQuota property on the account and does not consider Virtual Machine family. If this flag is true, dedicated core quota is enforced via the dedicatedCoreQuotaPerVMFamily property on the account, and the old dedicatedCoreQuota does not apply. 413 DedicatedCoreQuotaPerVMFamilyEnforced *bool `json:"dedicatedCoreQuotaPerVMFamilyEnforced,omitempty"` 414 // PoolQuota - READ-ONLY 415 PoolQuota *int32 `json:"poolQuota,omitempty"` 416 // ActiveJobAndJobScheduleQuota - READ-ONLY 417 ActiveJobAndJobScheduleQuota *int32 `json:"activeJobAndJobScheduleQuota,omitempty"` 418} 419 420// AccountRegenerateKeyParameters parameters supplied to the RegenerateKey operation. 421type AccountRegenerateKeyParameters struct { 422 // KeyName - The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' 423 KeyName AccountKeyType `json:"keyName,omitempty"` 424} 425 426// AccountUpdateParameters parameters for updating an Azure Batch account. 427type AccountUpdateParameters struct { 428 // Tags - The user-specified tags associated with the account. 429 Tags map[string]*string `json:"tags"` 430 // AccountUpdateProperties - The properties of the account. 431 *AccountUpdateProperties `json:"properties,omitempty"` 432} 433 434// MarshalJSON is the custom marshaler for AccountUpdateParameters. 435func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { 436 objectMap := make(map[string]interface{}) 437 if aup.Tags != nil { 438 objectMap["tags"] = aup.Tags 439 } 440 if aup.AccountUpdateProperties != nil { 441 objectMap["properties"] = aup.AccountUpdateProperties 442 } 443 return json.Marshal(objectMap) 444} 445 446// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. 447func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { 448 var m map[string]*json.RawMessage 449 err := json.Unmarshal(body, &m) 450 if err != nil { 451 return err 452 } 453 for k, v := range m { 454 switch k { 455 case "tags": 456 if v != nil { 457 var tags map[string]*string 458 err = json.Unmarshal(*v, &tags) 459 if err != nil { 460 return err 461 } 462 aup.Tags = tags 463 } 464 case "properties": 465 if v != nil { 466 var accountUpdateProperties AccountUpdateProperties 467 err = json.Unmarshal(*v, &accountUpdateProperties) 468 if err != nil { 469 return err 470 } 471 aup.AccountUpdateProperties = &accountUpdateProperties 472 } 473 } 474 } 475 476 return nil 477} 478 479// AccountUpdateProperties the properties of a Batch account. 480type AccountUpdateProperties struct { 481 // AutoStorage - The properties related to the auto-storage account. 482 AutoStorage *AutoStorageBaseProperties `json:"autoStorage,omitempty"` 483} 484 485// ActivateApplicationPackageParameters parameters for an activating an application package. 486type ActivateApplicationPackageParameters struct { 487 // Format - The format of the application package binary file. 488 Format *string `json:"format,omitempty"` 489} 490 491// Application contains information about an application in a Batch account. 492type Application struct { 493 autorest.Response `json:"-"` 494 // ApplicationProperties - The properties associated with the Application. 495 *ApplicationProperties `json:"properties,omitempty"` 496 // ID - READ-ONLY; The ID of the resource. 497 ID *string `json:"id,omitempty"` 498 // Name - READ-ONLY; The name of the resource. 499 Name *string `json:"name,omitempty"` 500 // Type - READ-ONLY; The type of the resource. 501 Type *string `json:"type,omitempty"` 502 // Etag - READ-ONLY; The ETag of the resource, used for concurrency statements. 503 Etag *string `json:"etag,omitempty"` 504} 505 506// MarshalJSON is the custom marshaler for Application. 507func (a Application) MarshalJSON() ([]byte, error) { 508 objectMap := make(map[string]interface{}) 509 if a.ApplicationProperties != nil { 510 objectMap["properties"] = a.ApplicationProperties 511 } 512 return json.Marshal(objectMap) 513} 514 515// UnmarshalJSON is the custom unmarshaler for Application struct. 516func (a *Application) UnmarshalJSON(body []byte) error { 517 var m map[string]*json.RawMessage 518 err := json.Unmarshal(body, &m) 519 if err != nil { 520 return err 521 } 522 for k, v := range m { 523 switch k { 524 case "properties": 525 if v != nil { 526 var applicationProperties ApplicationProperties 527 err = json.Unmarshal(*v, &applicationProperties) 528 if err != nil { 529 return err 530 } 531 a.ApplicationProperties = &applicationProperties 532 } 533 case "id": 534 if v != nil { 535 var ID string 536 err = json.Unmarshal(*v, &ID) 537 if err != nil { 538 return err 539 } 540 a.ID = &ID 541 } 542 case "name": 543 if v != nil { 544 var name string 545 err = json.Unmarshal(*v, &name) 546 if err != nil { 547 return err 548 } 549 a.Name = &name 550 } 551 case "type": 552 if v != nil { 553 var typeVar string 554 err = json.Unmarshal(*v, &typeVar) 555 if err != nil { 556 return err 557 } 558 a.Type = &typeVar 559 } 560 case "etag": 561 if v != nil { 562 var etag string 563 err = json.Unmarshal(*v, &etag) 564 if err != nil { 565 return err 566 } 567 a.Etag = &etag 568 } 569 } 570 } 571 572 return nil 573} 574 575// ApplicationPackage an application package which represents a particular version of an application. 576type ApplicationPackage struct { 577 autorest.Response `json:"-"` 578 // ApplicationPackageProperties - The properties associated with the Application Package. 579 *ApplicationPackageProperties `json:"properties,omitempty"` 580 // ID - READ-ONLY; The ID of the resource. 581 ID *string `json:"id,omitempty"` 582 // Name - READ-ONLY; The name of the resource. 583 Name *string `json:"name,omitempty"` 584 // Type - READ-ONLY; The type of the resource. 585 Type *string `json:"type,omitempty"` 586 // Etag - READ-ONLY; The ETag of the resource, used for concurrency statements. 587 Etag *string `json:"etag,omitempty"` 588} 589 590// MarshalJSON is the custom marshaler for ApplicationPackage. 591func (ap ApplicationPackage) MarshalJSON() ([]byte, error) { 592 objectMap := make(map[string]interface{}) 593 if ap.ApplicationPackageProperties != nil { 594 objectMap["properties"] = ap.ApplicationPackageProperties 595 } 596 return json.Marshal(objectMap) 597} 598 599// UnmarshalJSON is the custom unmarshaler for ApplicationPackage struct. 600func (ap *ApplicationPackage) UnmarshalJSON(body []byte) error { 601 var m map[string]*json.RawMessage 602 err := json.Unmarshal(body, &m) 603 if err != nil { 604 return err 605 } 606 for k, v := range m { 607 switch k { 608 case "properties": 609 if v != nil { 610 var applicationPackageProperties ApplicationPackageProperties 611 err = json.Unmarshal(*v, &applicationPackageProperties) 612 if err != nil { 613 return err 614 } 615 ap.ApplicationPackageProperties = &applicationPackageProperties 616 } 617 case "id": 618 if v != nil { 619 var ID string 620 err = json.Unmarshal(*v, &ID) 621 if err != nil { 622 return err 623 } 624 ap.ID = &ID 625 } 626 case "name": 627 if v != nil { 628 var name string 629 err = json.Unmarshal(*v, &name) 630 if err != nil { 631 return err 632 } 633 ap.Name = &name 634 } 635 case "type": 636 if v != nil { 637 var typeVar string 638 err = json.Unmarshal(*v, &typeVar) 639 if err != nil { 640 return err 641 } 642 ap.Type = &typeVar 643 } 644 case "etag": 645 if v != nil { 646 var etag string 647 err = json.Unmarshal(*v, &etag) 648 if err != nil { 649 return err 650 } 651 ap.Etag = &etag 652 } 653 } 654 } 655 656 return nil 657} 658 659// ApplicationPackageProperties properties of an application package 660type ApplicationPackageProperties struct { 661 // State - READ-ONLY; The current state of the application package. Possible values include: 'Pending', 'Active' 662 State PackageState `json:"state,omitempty"` 663 // Format - READ-ONLY; The format of the application package, if the package is active. 664 Format *string `json:"format,omitempty"` 665 // StorageURL - READ-ONLY; The URL for the application package in Azure Storage. 666 StorageURL *string `json:"storageUrl,omitempty"` 667 // StorageURLExpiry - READ-ONLY; The UTC time at which the Azure Storage URL will expire. 668 StorageURLExpiry *date.Time `json:"storageUrlExpiry,omitempty"` 669 // LastActivationTime - READ-ONLY; The time at which the package was last activated, if the package is active. 670 LastActivationTime *date.Time `json:"lastActivationTime,omitempty"` 671} 672 673// ApplicationPackageReference ... 674type ApplicationPackageReference struct { 675 ID *string `json:"id,omitempty"` 676 // Version - If this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409. 677 Version *string `json:"version,omitempty"` 678} 679 680// ApplicationProperties the properties associated with the Application. 681type ApplicationProperties struct { 682 // DisplayName - The display name for the application. 683 DisplayName *string `json:"displayName,omitempty"` 684 // AllowUpdates - A value indicating whether packages within the application may be overwritten using the same version string. 685 AllowUpdates *bool `json:"allowUpdates,omitempty"` 686 // DefaultVersion - The package to use if a client requests the application but does not specify a version. This property can only be set to the name of an existing package. 687 DefaultVersion *string `json:"defaultVersion,omitempty"` 688} 689 690// AutoScaleRun ... 691type AutoScaleRun struct { 692 EvaluationTime *date.Time `json:"evaluationTime,omitempty"` 693 // Results - Each variable value is returned in the form $variable=value, and variables are separated by semicolons. 694 Results *string `json:"results,omitempty"` 695 Error *AutoScaleRunError `json:"error,omitempty"` 696} 697 698// AutoScaleRunError ... 699type AutoScaleRunError struct { 700 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 701 Code *string `json:"code,omitempty"` 702 // Message - A message describing the error, intended to be suitable for display in a user interface. 703 Message *string `json:"message,omitempty"` 704 Details *[]AutoScaleRunError `json:"details,omitempty"` 705} 706 707// AutoScaleSettings ... 708type AutoScaleSettings struct { 709 Formula *string `json:"formula,omitempty"` 710 // EvaluationInterval - If omitted, the default value is 15 minutes (PT15M). 711 EvaluationInterval *string `json:"evaluationInterval,omitempty"` 712} 713 714// AutoStorageBaseProperties the properties related to the auto-storage account. 715type AutoStorageBaseProperties struct { 716 // StorageAccountID - The resource ID of the storage account to be used for auto-storage account. 717 StorageAccountID *string `json:"storageAccountId,omitempty"` 718} 719 720// AutoStorageProperties contains information about the auto-storage account associated with a Batch 721// account. 722type AutoStorageProperties struct { 723 // LastKeySync - The UTC time at which storage keys were last synchronized with the Batch account. 724 LastKeySync *date.Time `json:"lastKeySync,omitempty"` 725 // StorageAccountID - The resource ID of the storage account to be used for auto-storage account. 726 StorageAccountID *string `json:"storageAccountId,omitempty"` 727} 728 729// AutoUserSpecification ... 730type AutoUserSpecification struct { 731 // Scope - The default value is task. Possible values include: 'AutoUserScopeTask', 'AutoUserScopePool' 732 Scope AutoUserScope `json:"scope,omitempty"` 733 // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' 734 ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` 735} 736 737// Certificate contains information about a certificate. 738type Certificate struct { 739 autorest.Response `json:"-"` 740 // CertificateProperties - The properties associated with the certificate. 741 *CertificateProperties `json:"properties,omitempty"` 742 // ID - READ-ONLY; The ID of the resource. 743 ID *string `json:"id,omitempty"` 744 // Name - READ-ONLY; The name of the resource. 745 Name *string `json:"name,omitempty"` 746 // Type - READ-ONLY; The type of the resource. 747 Type *string `json:"type,omitempty"` 748 // Etag - READ-ONLY; The ETag of the resource, used for concurrency statements. 749 Etag *string `json:"etag,omitempty"` 750} 751 752// MarshalJSON is the custom marshaler for Certificate. 753func (c Certificate) MarshalJSON() ([]byte, error) { 754 objectMap := make(map[string]interface{}) 755 if c.CertificateProperties != nil { 756 objectMap["properties"] = c.CertificateProperties 757 } 758 return json.Marshal(objectMap) 759} 760 761// UnmarshalJSON is the custom unmarshaler for Certificate struct. 762func (c *Certificate) UnmarshalJSON(body []byte) error { 763 var m map[string]*json.RawMessage 764 err := json.Unmarshal(body, &m) 765 if err != nil { 766 return err 767 } 768 for k, v := range m { 769 switch k { 770 case "properties": 771 if v != nil { 772 var certificateProperties CertificateProperties 773 err = json.Unmarshal(*v, &certificateProperties) 774 if err != nil { 775 return err 776 } 777 c.CertificateProperties = &certificateProperties 778 } 779 case "id": 780 if v != nil { 781 var ID string 782 err = json.Unmarshal(*v, &ID) 783 if err != nil { 784 return err 785 } 786 c.ID = &ID 787 } 788 case "name": 789 if v != nil { 790 var name string 791 err = json.Unmarshal(*v, &name) 792 if err != nil { 793 return err 794 } 795 c.Name = &name 796 } 797 case "type": 798 if v != nil { 799 var typeVar string 800 err = json.Unmarshal(*v, &typeVar) 801 if err != nil { 802 return err 803 } 804 c.Type = &typeVar 805 } 806 case "etag": 807 if v != nil { 808 var etag string 809 err = json.Unmarshal(*v, &etag) 810 if err != nil { 811 return err 812 } 813 c.Etag = &etag 814 } 815 } 816 } 817 818 return nil 819} 820 821// CertificateBaseProperties ... 822type CertificateBaseProperties struct { 823 // ThumbprintAlgorithm - This must match the first portion of the certificate name. Currently required to be 'SHA1'. 824 ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` 825 // Thumbprint - This must match the thumbprint from the name. 826 Thumbprint *string `json:"thumbprint,omitempty"` 827 // Format - The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer' 828 Format CertificateFormat `json:"format,omitempty"` 829} 830 831// CertificateCreateFuture an abstraction for monitoring and retrieving the results of a long-running 832// operation. 833type CertificateCreateFuture struct { 834 azure.FutureAPI 835 // Result returns the result of the asynchronous operation. 836 // If the operation has not completed it will return an error. 837 Result func(CertificateClient) (Certificate, error) 838} 839 840// CertificateCreateOrUpdateParameters contains information about a certificate. 841type CertificateCreateOrUpdateParameters struct { 842 // CertificateCreateOrUpdateProperties - The properties associated with the certificate. 843 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 844 // ID - READ-ONLY; The ID of the resource. 845 ID *string `json:"id,omitempty"` 846 // Name - READ-ONLY; The name of the resource. 847 Name *string `json:"name,omitempty"` 848 // Type - READ-ONLY; The type of the resource. 849 Type *string `json:"type,omitempty"` 850 // Etag - READ-ONLY; The ETag of the resource, used for concurrency statements. 851 Etag *string `json:"etag,omitempty"` 852} 853 854// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 855func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 856 objectMap := make(map[string]interface{}) 857 if ccoup.CertificateCreateOrUpdateProperties != nil { 858 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 859 } 860 return json.Marshal(objectMap) 861} 862 863// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 864func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 865 var m map[string]*json.RawMessage 866 err := json.Unmarshal(body, &m) 867 if err != nil { 868 return err 869 } 870 for k, v := range m { 871 switch k { 872 case "properties": 873 if v != nil { 874 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 875 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 876 if err != nil { 877 return err 878 } 879 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 880 } 881 case "id": 882 if v != nil { 883 var ID string 884 err = json.Unmarshal(*v, &ID) 885 if err != nil { 886 return err 887 } 888 ccoup.ID = &ID 889 } 890 case "name": 891 if v != nil { 892 var name string 893 err = json.Unmarshal(*v, &name) 894 if err != nil { 895 return err 896 } 897 ccoup.Name = &name 898 } 899 case "type": 900 if v != nil { 901 var typeVar string 902 err = json.Unmarshal(*v, &typeVar) 903 if err != nil { 904 return err 905 } 906 ccoup.Type = &typeVar 907 } 908 case "etag": 909 if v != nil { 910 var etag string 911 err = json.Unmarshal(*v, &etag) 912 if err != nil { 913 return err 914 } 915 ccoup.Etag = &etag 916 } 917 } 918 } 919 920 return nil 921} 922 923// CertificateCreateOrUpdateProperties certificate properties for create operations 924type CertificateCreateOrUpdateProperties struct { 925 // Data - The maximum size is 10KB. 926 Data *string `json:"data,omitempty"` 927 // Password - This is required if the certificate format is pfx and must be omitted if the certificate format is cer. 928 Password *string `json:"password,omitempty"` 929 // ThumbprintAlgorithm - This must match the first portion of the certificate name. Currently required to be 'SHA1'. 930 ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` 931 // Thumbprint - This must match the thumbprint from the name. 932 Thumbprint *string `json:"thumbprint,omitempty"` 933 // Format - The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer' 934 Format CertificateFormat `json:"format,omitempty"` 935} 936 937// CertificateDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 938// operation. 939type CertificateDeleteFuture struct { 940 azure.FutureAPI 941 // Result returns the result of the asynchronous operation. 942 // If the operation has not completed it will return an error. 943 Result func(CertificateClient) (autorest.Response, error) 944} 945 946// CertificateProperties certificate properties. 947type CertificateProperties struct { 948 // ProvisioningState - READ-ONLY; Possible values include: 'Succeeded', 'Deleting', 'Failed' 949 ProvisioningState CertificateProvisioningState `json:"provisioningState,omitempty"` 950 // ProvisioningStateTransitionTime - READ-ONLY 951 ProvisioningStateTransitionTime *date.Time `json:"provisioningStateTransitionTime,omitempty"` 952 // PreviousProvisioningState - READ-ONLY; The previous provisioned state of the resource. Possible values include: 'Succeeded', 'Deleting', 'Failed' 953 PreviousProvisioningState CertificateProvisioningState `json:"previousProvisioningState,omitempty"` 954 // PreviousProvisioningStateTransitionTime - READ-ONLY 955 PreviousProvisioningStateTransitionTime *date.Time `json:"previousProvisioningStateTransitionTime,omitempty"` 956 // PublicData - READ-ONLY; The public key of the certificate. 957 PublicData *string `json:"publicData,omitempty"` 958 // DeleteCertificateError - READ-ONLY; This is only returned when the certificate provisioningState is 'Failed'. 959 DeleteCertificateError *DeleteCertificateError `json:"deleteCertificateError,omitempty"` 960 // ThumbprintAlgorithm - This must match the first portion of the certificate name. Currently required to be 'SHA1'. 961 ThumbprintAlgorithm *string `json:"thumbprintAlgorithm,omitempty"` 962 // Thumbprint - This must match the thumbprint from the name. 963 Thumbprint *string `json:"thumbprint,omitempty"` 964 // Format - The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer' 965 Format CertificateFormat `json:"format,omitempty"` 966} 967 968// MarshalJSON is the custom marshaler for CertificateProperties. 969func (cp CertificateProperties) MarshalJSON() ([]byte, error) { 970 objectMap := make(map[string]interface{}) 971 if cp.ThumbprintAlgorithm != nil { 972 objectMap["thumbprintAlgorithm"] = cp.ThumbprintAlgorithm 973 } 974 if cp.Thumbprint != nil { 975 objectMap["thumbprint"] = cp.Thumbprint 976 } 977 if cp.Format != "" { 978 objectMap["format"] = cp.Format 979 } 980 return json.Marshal(objectMap) 981} 982 983// CertificateReference ... 984type CertificateReference struct { 985 ID *string `json:"id,omitempty"` 986 // StoreLocation - The default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CurrentUser', 'LocalMachine' 987 StoreLocation CertificateStoreLocation `json:"storeLocation,omitempty"` 988 // StoreName - This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. 989 StoreName *string `json:"storeName,omitempty"` 990 Visibility *[]CertificateVisibility `json:"visibility,omitempty"` 991} 992 993// CheckNameAvailabilityParameters parameters for a check name availability request. 994type CheckNameAvailabilityParameters struct { 995 // Name - The name to check for availability 996 Name *string `json:"name,omitempty"` 997 // Type - The resource type. Must be set to Microsoft.Batch/batchAccounts 998 Type *string `json:"type,omitempty"` 999} 1000 1001// CheckNameAvailabilityResult the CheckNameAvailability operation response. 1002type CheckNameAvailabilityResult struct { 1003 autorest.Response `json:"-"` 1004 // NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. 1005 NameAvailable *bool `json:"nameAvailable,omitempty"` 1006 // Reason - READ-ONLY; Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists' 1007 Reason NameAvailabilityReason `json:"reason,omitempty"` 1008 // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail. 1009 Message *string `json:"message,omitempty"` 1010} 1011 1012// CloudError an error response from the Batch service. 1013type CloudError struct { 1014 Error *CloudErrorBody `json:"error,omitempty"` 1015} 1016 1017// CloudErrorBody an error response from the Batch service. 1018type CloudErrorBody struct { 1019 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 1020 Code *string `json:"code,omitempty"` 1021 // Message - A message describing the error, intended to be suitable for display in a user interface. 1022 Message *string `json:"message,omitempty"` 1023 // Target - The target of the particular error. For example, the name of the property in error. 1024 Target *string `json:"target,omitempty"` 1025 // Details - A list of additional details about the error. 1026 Details *[]CloudErrorBody `json:"details,omitempty"` 1027} 1028 1029// CloudServiceConfiguration ... 1030type CloudServiceConfiguration struct { 1031 // OsFamily - Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. 6 - OS Family 6, equivalent to Windows Server 2019. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). 1032 OsFamily *string `json:"osFamily,omitempty"` 1033 // OsVersion - The default value is * which specifies the latest operating system version for the specified OS family. 1034 OsVersion *string `json:"osVersion,omitempty"` 1035} 1036 1037// ContainerConfiguration ... 1038type ContainerConfiguration struct { 1039 Type *string `json:"type,omitempty"` 1040 // ContainerImageNames - This is the full image reference, as would be specified to "docker pull". An image will be sourced from the default Docker registry unless the image is fully qualified with an alternative registry. 1041 ContainerImageNames *[]string `json:"containerImageNames,omitempty"` 1042 // ContainerRegistries - If any images must be downloaded from a private registry which requires credentials, then those credentials must be provided here. 1043 ContainerRegistries *[]ContainerRegistry `json:"containerRegistries,omitempty"` 1044} 1045 1046// ContainerRegistry ... 1047type ContainerRegistry struct { 1048 // RegistryServer - If omitted, the default is "docker.io". 1049 RegistryServer *string `json:"registryServer,omitempty"` 1050 UserName *string `json:"username,omitempty"` 1051 Password *string `json:"password,omitempty"` 1052} 1053 1054// DataDisk data Disk settings which will be used by the data disks associated to Compute Nodes in the 1055// pool. 1056type DataDisk struct { 1057 // Lun - The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. 1058 Lun *int32 `json:"lun,omitempty"` 1059 // Caching - Values are: 1060 // none - The caching mode for the disk is not enabled. 1061 // readOnly - The caching mode for the disk is read only. 1062 // readWrite - The caching mode for the disk is read and write. 1063 // The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite' 1064 Caching CachingType `json:"caching,omitempty"` 1065 DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` 1066 // StorageAccountType - If omitted, the default is "Standard_LRS". Values are: 1067 // Standard_LRS - The data disk should use standard locally redundant storage. 1068 // Premium_LRS - The data disk should use premium locally redundant storage. Possible values include: 'StandardLRS', 'PremiumLRS' 1069 StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` 1070} 1071 1072// DeleteCertificateError an error response from the Batch service. 1073type DeleteCertificateError struct { 1074 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 1075 Code *string `json:"code,omitempty"` 1076 // Message - A message describing the error, intended to be suitable for display in a user interface. 1077 Message *string `json:"message,omitempty"` 1078 // Target - The target of the particular error. For example, the name of the property in error. 1079 Target *string `json:"target,omitempty"` 1080 // Details - A list of additional details about the error. 1081 Details *[]DeleteCertificateError `json:"details,omitempty"` 1082} 1083 1084// DeploymentConfiguration ... 1085type DeploymentConfiguration struct { 1086 // CloudServiceConfiguration - This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. 1087 CloudServiceConfiguration *CloudServiceConfiguration `json:"cloudServiceConfiguration,omitempty"` 1088 // VirtualMachineConfiguration - This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. 1089 VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` 1090} 1091 1092// EnvironmentSetting ... 1093type EnvironmentSetting struct { 1094 Name *string `json:"name,omitempty"` 1095 Value *string `json:"value,omitempty"` 1096} 1097 1098// FixedScaleSettings ... 1099type FixedScaleSettings struct { 1100 // ResizeTimeout - The default value is 15 minutes. Timeout values use ISO 8601 format. For example, use PT10M for 10 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). 1101 ResizeTimeout *string `json:"resizeTimeout,omitempty"` 1102 // TargetDedicatedNodes - At least one of targetDedicatedNodes, targetLowPriority nodes must be set. 1103 TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` 1104 // TargetLowPriorityNodes - At least one of targetDedicatedNodes, targetLowPriority nodes must be set. 1105 TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` 1106 // NodeDeallocationOption - If omitted, the default value is Requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' 1107 NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` 1108} 1109 1110// ImageReference ... 1111type ImageReference struct { 1112 // Publisher - For example, Canonical or MicrosoftWindowsServer. 1113 Publisher *string `json:"publisher,omitempty"` 1114 // Offer - For example, UbuntuServer or WindowsServer. 1115 Offer *string `json:"offer,omitempty"` 1116 // Sku - For example, 14.04.0-LTS or 2012-R2-Datacenter. 1117 Sku *string `json:"sku,omitempty"` 1118 // Version - A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. 1119 Version *string `json:"version,omitempty"` 1120 // ID - This property is mutually exclusive with other properties. The virtual machine image must be in the same region and subscription as the Azure Batch account. For information about the firewall settings for Batch node agent to communicate with Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration . 1121 ID *string `json:"id,omitempty"` 1122} 1123 1124// InboundNatPool ... 1125type InboundNatPool struct { 1126 // Name - The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. 1127 Name *string `json:"name,omitempty"` 1128 // Protocol - Possible values include: 'TCP', 'UDP' 1129 Protocol InboundEndpointProtocol `json:"protocol,omitempty"` 1130 // BackendPort - This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. 1131 BackendPort *int32 `json:"backendPort,omitempty"` 1132 // FrontendPortRangeStart - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. 1133 FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` 1134 // FrontendPortRangeEnd - Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. 1135 FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` 1136 // NetworkSecurityGroupRules - The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. 1137 NetworkSecurityGroupRules *[]NetworkSecurityGroupRule `json:"networkSecurityGroupRules,omitempty"` 1138} 1139 1140// KeyVaultReference identifies the Azure key vault associated with a Batch account. 1141type KeyVaultReference struct { 1142 // ID - The resource ID of the Azure key vault associated with the Batch account. 1143 ID *string `json:"id,omitempty"` 1144 // URL - The URL of the Azure key vault associated with the Batch account. 1145 URL *string `json:"url,omitempty"` 1146} 1147 1148// LinuxUserConfiguration ... 1149type LinuxUserConfiguration struct { 1150 // UID - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. 1151 UID *int32 `json:"uid,omitempty"` 1152 // Gid - The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. 1153 Gid *int32 `json:"gid,omitempty"` 1154 // SSHPrivateKey - The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done). 1155 SSHPrivateKey *string `json:"sshPrivateKey,omitempty"` 1156} 1157 1158// ListApplicationPackagesResult the result of performing list application packages. 1159type ListApplicationPackagesResult struct { 1160 autorest.Response `json:"-"` 1161 // Value - The list of application packages. 1162 Value *[]ApplicationPackage `json:"value,omitempty"` 1163 // NextLink - The URL to get the next set of results. 1164 NextLink *string `json:"nextLink,omitempty"` 1165} 1166 1167// ListApplicationPackagesResultIterator provides access to a complete listing of ApplicationPackage 1168// values. 1169type ListApplicationPackagesResultIterator struct { 1170 i int 1171 page ListApplicationPackagesResultPage 1172} 1173 1174// NextWithContext advances to the next value. If there was an error making 1175// the request the iterator does not advance and the error is returned. 1176func (iter *ListApplicationPackagesResultIterator) NextWithContext(ctx context.Context) (err error) { 1177 if tracing.IsEnabled() { 1178 ctx = tracing.StartSpan(ctx, fqdn+"/ListApplicationPackagesResultIterator.NextWithContext") 1179 defer func() { 1180 sc := -1 1181 if iter.Response().Response.Response != nil { 1182 sc = iter.Response().Response.Response.StatusCode 1183 } 1184 tracing.EndSpan(ctx, sc, err) 1185 }() 1186 } 1187 iter.i++ 1188 if iter.i < len(iter.page.Values()) { 1189 return nil 1190 } 1191 err = iter.page.NextWithContext(ctx) 1192 if err != nil { 1193 iter.i-- 1194 return err 1195 } 1196 iter.i = 0 1197 return nil 1198} 1199 1200// Next advances to the next value. If there was an error making 1201// the request the iterator does not advance and the error is returned. 1202// Deprecated: Use NextWithContext() instead. 1203func (iter *ListApplicationPackagesResultIterator) Next() error { 1204 return iter.NextWithContext(context.Background()) 1205} 1206 1207// NotDone returns true if the enumeration should be started or is not yet complete. 1208func (iter ListApplicationPackagesResultIterator) NotDone() bool { 1209 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1210} 1211 1212// Response returns the raw server response from the last page request. 1213func (iter ListApplicationPackagesResultIterator) Response() ListApplicationPackagesResult { 1214 return iter.page.Response() 1215} 1216 1217// Value returns the current value or a zero-initialized value if the 1218// iterator has advanced beyond the end of the collection. 1219func (iter ListApplicationPackagesResultIterator) Value() ApplicationPackage { 1220 if !iter.page.NotDone() { 1221 return ApplicationPackage{} 1222 } 1223 return iter.page.Values()[iter.i] 1224} 1225 1226// Creates a new instance of the ListApplicationPackagesResultIterator type. 1227func NewListApplicationPackagesResultIterator(page ListApplicationPackagesResultPage) ListApplicationPackagesResultIterator { 1228 return ListApplicationPackagesResultIterator{page: page} 1229} 1230 1231// IsEmpty returns true if the ListResult contains no values. 1232func (lapr ListApplicationPackagesResult) IsEmpty() bool { 1233 return lapr.Value == nil || len(*lapr.Value) == 0 1234} 1235 1236// hasNextLink returns true if the NextLink is not empty. 1237func (lapr ListApplicationPackagesResult) hasNextLink() bool { 1238 return lapr.NextLink != nil && len(*lapr.NextLink) != 0 1239} 1240 1241// listApplicationPackagesResultPreparer prepares a request to retrieve the next set of results. 1242// It returns nil if no more results exist. 1243func (lapr ListApplicationPackagesResult) listApplicationPackagesResultPreparer(ctx context.Context) (*http.Request, error) { 1244 if !lapr.hasNextLink() { 1245 return nil, nil 1246 } 1247 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1248 autorest.AsJSON(), 1249 autorest.AsGet(), 1250 autorest.WithBaseURL(to.String(lapr.NextLink))) 1251} 1252 1253// ListApplicationPackagesResultPage contains a page of ApplicationPackage values. 1254type ListApplicationPackagesResultPage struct { 1255 fn func(context.Context, ListApplicationPackagesResult) (ListApplicationPackagesResult, error) 1256 lapr ListApplicationPackagesResult 1257} 1258 1259// NextWithContext advances to the next page of values. If there was an error making 1260// the request the page does not advance and the error is returned. 1261func (page *ListApplicationPackagesResultPage) NextWithContext(ctx context.Context) (err error) { 1262 if tracing.IsEnabled() { 1263 ctx = tracing.StartSpan(ctx, fqdn+"/ListApplicationPackagesResultPage.NextWithContext") 1264 defer func() { 1265 sc := -1 1266 if page.Response().Response.Response != nil { 1267 sc = page.Response().Response.Response.StatusCode 1268 } 1269 tracing.EndSpan(ctx, sc, err) 1270 }() 1271 } 1272 for { 1273 next, err := page.fn(ctx, page.lapr) 1274 if err != nil { 1275 return err 1276 } 1277 page.lapr = next 1278 if !next.hasNextLink() || !next.IsEmpty() { 1279 break 1280 } 1281 } 1282 return nil 1283} 1284 1285// Next advances to the next page of values. If there was an error making 1286// the request the page does not advance and the error is returned. 1287// Deprecated: Use NextWithContext() instead. 1288func (page *ListApplicationPackagesResultPage) Next() error { 1289 return page.NextWithContext(context.Background()) 1290} 1291 1292// NotDone returns true if the page enumeration should be started or is not yet complete. 1293func (page ListApplicationPackagesResultPage) NotDone() bool { 1294 return !page.lapr.IsEmpty() 1295} 1296 1297// Response returns the raw server response from the last page request. 1298func (page ListApplicationPackagesResultPage) Response() ListApplicationPackagesResult { 1299 return page.lapr 1300} 1301 1302// Values returns the slice of values for the current page or nil if there are no values. 1303func (page ListApplicationPackagesResultPage) Values() []ApplicationPackage { 1304 if page.lapr.IsEmpty() { 1305 return nil 1306 } 1307 return *page.lapr.Value 1308} 1309 1310// Creates a new instance of the ListApplicationPackagesResultPage type. 1311func NewListApplicationPackagesResultPage(cur ListApplicationPackagesResult, getNextPage func(context.Context, ListApplicationPackagesResult) (ListApplicationPackagesResult, error)) ListApplicationPackagesResultPage { 1312 return ListApplicationPackagesResultPage{ 1313 fn: getNextPage, 1314 lapr: cur, 1315 } 1316} 1317 1318// ListApplicationsResult the result of performing list applications. 1319type ListApplicationsResult struct { 1320 autorest.Response `json:"-"` 1321 // Value - The list of applications. 1322 Value *[]Application `json:"value,omitempty"` 1323 // NextLink - The URL to get the next set of results. 1324 NextLink *string `json:"nextLink,omitempty"` 1325} 1326 1327// ListApplicationsResultIterator provides access to a complete listing of Application values. 1328type ListApplicationsResultIterator struct { 1329 i int 1330 page ListApplicationsResultPage 1331} 1332 1333// NextWithContext advances to the next value. If there was an error making 1334// the request the iterator does not advance and the error is returned. 1335func (iter *ListApplicationsResultIterator) NextWithContext(ctx context.Context) (err error) { 1336 if tracing.IsEnabled() { 1337 ctx = tracing.StartSpan(ctx, fqdn+"/ListApplicationsResultIterator.NextWithContext") 1338 defer func() { 1339 sc := -1 1340 if iter.Response().Response.Response != nil { 1341 sc = iter.Response().Response.Response.StatusCode 1342 } 1343 tracing.EndSpan(ctx, sc, err) 1344 }() 1345 } 1346 iter.i++ 1347 if iter.i < len(iter.page.Values()) { 1348 return nil 1349 } 1350 err = iter.page.NextWithContext(ctx) 1351 if err != nil { 1352 iter.i-- 1353 return err 1354 } 1355 iter.i = 0 1356 return nil 1357} 1358 1359// Next advances to the next value. If there was an error making 1360// the request the iterator does not advance and the error is returned. 1361// Deprecated: Use NextWithContext() instead. 1362func (iter *ListApplicationsResultIterator) Next() error { 1363 return iter.NextWithContext(context.Background()) 1364} 1365 1366// NotDone returns true if the enumeration should be started or is not yet complete. 1367func (iter ListApplicationsResultIterator) NotDone() bool { 1368 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1369} 1370 1371// Response returns the raw server response from the last page request. 1372func (iter ListApplicationsResultIterator) Response() ListApplicationsResult { 1373 return iter.page.Response() 1374} 1375 1376// Value returns the current value or a zero-initialized value if the 1377// iterator has advanced beyond the end of the collection. 1378func (iter ListApplicationsResultIterator) Value() Application { 1379 if !iter.page.NotDone() { 1380 return Application{} 1381 } 1382 return iter.page.Values()[iter.i] 1383} 1384 1385// Creates a new instance of the ListApplicationsResultIterator type. 1386func NewListApplicationsResultIterator(page ListApplicationsResultPage) ListApplicationsResultIterator { 1387 return ListApplicationsResultIterator{page: page} 1388} 1389 1390// IsEmpty returns true if the ListResult contains no values. 1391func (lar ListApplicationsResult) IsEmpty() bool { 1392 return lar.Value == nil || len(*lar.Value) == 0 1393} 1394 1395// hasNextLink returns true if the NextLink is not empty. 1396func (lar ListApplicationsResult) hasNextLink() bool { 1397 return lar.NextLink != nil && len(*lar.NextLink) != 0 1398} 1399 1400// listApplicationsResultPreparer prepares a request to retrieve the next set of results. 1401// It returns nil if no more results exist. 1402func (lar ListApplicationsResult) listApplicationsResultPreparer(ctx context.Context) (*http.Request, error) { 1403 if !lar.hasNextLink() { 1404 return nil, nil 1405 } 1406 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1407 autorest.AsJSON(), 1408 autorest.AsGet(), 1409 autorest.WithBaseURL(to.String(lar.NextLink))) 1410} 1411 1412// ListApplicationsResultPage contains a page of Application values. 1413type ListApplicationsResultPage struct { 1414 fn func(context.Context, ListApplicationsResult) (ListApplicationsResult, error) 1415 lar ListApplicationsResult 1416} 1417 1418// NextWithContext advances to the next page of values. If there was an error making 1419// the request the page does not advance and the error is returned. 1420func (page *ListApplicationsResultPage) NextWithContext(ctx context.Context) (err error) { 1421 if tracing.IsEnabled() { 1422 ctx = tracing.StartSpan(ctx, fqdn+"/ListApplicationsResultPage.NextWithContext") 1423 defer func() { 1424 sc := -1 1425 if page.Response().Response.Response != nil { 1426 sc = page.Response().Response.Response.StatusCode 1427 } 1428 tracing.EndSpan(ctx, sc, err) 1429 }() 1430 } 1431 for { 1432 next, err := page.fn(ctx, page.lar) 1433 if err != nil { 1434 return err 1435 } 1436 page.lar = next 1437 if !next.hasNextLink() || !next.IsEmpty() { 1438 break 1439 } 1440 } 1441 return nil 1442} 1443 1444// Next advances to the next page of values. If there was an error making 1445// the request the page does not advance and the error is returned. 1446// Deprecated: Use NextWithContext() instead. 1447func (page *ListApplicationsResultPage) Next() error { 1448 return page.NextWithContext(context.Background()) 1449} 1450 1451// NotDone returns true if the page enumeration should be started or is not yet complete. 1452func (page ListApplicationsResultPage) NotDone() bool { 1453 return !page.lar.IsEmpty() 1454} 1455 1456// Response returns the raw server response from the last page request. 1457func (page ListApplicationsResultPage) Response() ListApplicationsResult { 1458 return page.lar 1459} 1460 1461// Values returns the slice of values for the current page or nil if there are no values. 1462func (page ListApplicationsResultPage) Values() []Application { 1463 if page.lar.IsEmpty() { 1464 return nil 1465 } 1466 return *page.lar.Value 1467} 1468 1469// Creates a new instance of the ListApplicationsResultPage type. 1470func NewListApplicationsResultPage(cur ListApplicationsResult, getNextPage func(context.Context, ListApplicationsResult) (ListApplicationsResult, error)) ListApplicationsResultPage { 1471 return ListApplicationsResultPage{ 1472 fn: getNextPage, 1473 lar: cur, 1474 } 1475} 1476 1477// ListCertificatesResult values returned by the List operation. 1478type ListCertificatesResult struct { 1479 autorest.Response `json:"-"` 1480 // Value - The collection of returned certificates. 1481 Value *[]Certificate `json:"value,omitempty"` 1482 // NextLink - The continuation token. 1483 NextLink *string `json:"nextLink,omitempty"` 1484} 1485 1486// ListCertificatesResultIterator provides access to a complete listing of Certificate values. 1487type ListCertificatesResultIterator struct { 1488 i int 1489 page ListCertificatesResultPage 1490} 1491 1492// NextWithContext advances to the next value. If there was an error making 1493// the request the iterator does not advance and the error is returned. 1494func (iter *ListCertificatesResultIterator) NextWithContext(ctx context.Context) (err error) { 1495 if tracing.IsEnabled() { 1496 ctx = tracing.StartSpan(ctx, fqdn+"/ListCertificatesResultIterator.NextWithContext") 1497 defer func() { 1498 sc := -1 1499 if iter.Response().Response.Response != nil { 1500 sc = iter.Response().Response.Response.StatusCode 1501 } 1502 tracing.EndSpan(ctx, sc, err) 1503 }() 1504 } 1505 iter.i++ 1506 if iter.i < len(iter.page.Values()) { 1507 return nil 1508 } 1509 err = iter.page.NextWithContext(ctx) 1510 if err != nil { 1511 iter.i-- 1512 return err 1513 } 1514 iter.i = 0 1515 return nil 1516} 1517 1518// Next advances to the next value. If there was an error making 1519// the request the iterator does not advance and the error is returned. 1520// Deprecated: Use NextWithContext() instead. 1521func (iter *ListCertificatesResultIterator) Next() error { 1522 return iter.NextWithContext(context.Background()) 1523} 1524 1525// NotDone returns true if the enumeration should be started or is not yet complete. 1526func (iter ListCertificatesResultIterator) NotDone() bool { 1527 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1528} 1529 1530// Response returns the raw server response from the last page request. 1531func (iter ListCertificatesResultIterator) Response() ListCertificatesResult { 1532 return iter.page.Response() 1533} 1534 1535// Value returns the current value or a zero-initialized value if the 1536// iterator has advanced beyond the end of the collection. 1537func (iter ListCertificatesResultIterator) Value() Certificate { 1538 if !iter.page.NotDone() { 1539 return Certificate{} 1540 } 1541 return iter.page.Values()[iter.i] 1542} 1543 1544// Creates a new instance of the ListCertificatesResultIterator type. 1545func NewListCertificatesResultIterator(page ListCertificatesResultPage) ListCertificatesResultIterator { 1546 return ListCertificatesResultIterator{page: page} 1547} 1548 1549// IsEmpty returns true if the ListResult contains no values. 1550func (lcr ListCertificatesResult) IsEmpty() bool { 1551 return lcr.Value == nil || len(*lcr.Value) == 0 1552} 1553 1554// hasNextLink returns true if the NextLink is not empty. 1555func (lcr ListCertificatesResult) hasNextLink() bool { 1556 return lcr.NextLink != nil && len(*lcr.NextLink) != 0 1557} 1558 1559// listCertificatesResultPreparer prepares a request to retrieve the next set of results. 1560// It returns nil if no more results exist. 1561func (lcr ListCertificatesResult) listCertificatesResultPreparer(ctx context.Context) (*http.Request, error) { 1562 if !lcr.hasNextLink() { 1563 return nil, nil 1564 } 1565 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1566 autorest.AsJSON(), 1567 autorest.AsGet(), 1568 autorest.WithBaseURL(to.String(lcr.NextLink))) 1569} 1570 1571// ListCertificatesResultPage contains a page of Certificate values. 1572type ListCertificatesResultPage struct { 1573 fn func(context.Context, ListCertificatesResult) (ListCertificatesResult, error) 1574 lcr ListCertificatesResult 1575} 1576 1577// NextWithContext advances to the next page of values. If there was an error making 1578// the request the page does not advance and the error is returned. 1579func (page *ListCertificatesResultPage) NextWithContext(ctx context.Context) (err error) { 1580 if tracing.IsEnabled() { 1581 ctx = tracing.StartSpan(ctx, fqdn+"/ListCertificatesResultPage.NextWithContext") 1582 defer func() { 1583 sc := -1 1584 if page.Response().Response.Response != nil { 1585 sc = page.Response().Response.Response.StatusCode 1586 } 1587 tracing.EndSpan(ctx, sc, err) 1588 }() 1589 } 1590 for { 1591 next, err := page.fn(ctx, page.lcr) 1592 if err != nil { 1593 return err 1594 } 1595 page.lcr = next 1596 if !next.hasNextLink() || !next.IsEmpty() { 1597 break 1598 } 1599 } 1600 return nil 1601} 1602 1603// Next advances to the next page of values. If there was an error making 1604// the request the page does not advance and the error is returned. 1605// Deprecated: Use NextWithContext() instead. 1606func (page *ListCertificatesResultPage) Next() error { 1607 return page.NextWithContext(context.Background()) 1608} 1609 1610// NotDone returns true if the page enumeration should be started or is not yet complete. 1611func (page ListCertificatesResultPage) NotDone() bool { 1612 return !page.lcr.IsEmpty() 1613} 1614 1615// Response returns the raw server response from the last page request. 1616func (page ListCertificatesResultPage) Response() ListCertificatesResult { 1617 return page.lcr 1618} 1619 1620// Values returns the slice of values for the current page or nil if there are no values. 1621func (page ListCertificatesResultPage) Values() []Certificate { 1622 if page.lcr.IsEmpty() { 1623 return nil 1624 } 1625 return *page.lcr.Value 1626} 1627 1628// Creates a new instance of the ListCertificatesResultPage type. 1629func NewListCertificatesResultPage(cur ListCertificatesResult, getNextPage func(context.Context, ListCertificatesResult) (ListCertificatesResult, error)) ListCertificatesResultPage { 1630 return ListCertificatesResultPage{ 1631 fn: getNextPage, 1632 lcr: cur, 1633 } 1634} 1635 1636// ListPoolsResult values returned by the List operation. 1637type ListPoolsResult struct { 1638 autorest.Response `json:"-"` 1639 // Value - The collection of returned pools. 1640 Value *[]Pool `json:"value,omitempty"` 1641 // NextLink - The continuation token. 1642 NextLink *string `json:"nextLink,omitempty"` 1643} 1644 1645// ListPoolsResultIterator provides access to a complete listing of Pool values. 1646type ListPoolsResultIterator struct { 1647 i int 1648 page ListPoolsResultPage 1649} 1650 1651// NextWithContext advances to the next value. If there was an error making 1652// the request the iterator does not advance and the error is returned. 1653func (iter *ListPoolsResultIterator) NextWithContext(ctx context.Context) (err error) { 1654 if tracing.IsEnabled() { 1655 ctx = tracing.StartSpan(ctx, fqdn+"/ListPoolsResultIterator.NextWithContext") 1656 defer func() { 1657 sc := -1 1658 if iter.Response().Response.Response != nil { 1659 sc = iter.Response().Response.Response.StatusCode 1660 } 1661 tracing.EndSpan(ctx, sc, err) 1662 }() 1663 } 1664 iter.i++ 1665 if iter.i < len(iter.page.Values()) { 1666 return nil 1667 } 1668 err = iter.page.NextWithContext(ctx) 1669 if err != nil { 1670 iter.i-- 1671 return err 1672 } 1673 iter.i = 0 1674 return nil 1675} 1676 1677// Next advances to the next value. If there was an error making 1678// the request the iterator does not advance and the error is returned. 1679// Deprecated: Use NextWithContext() instead. 1680func (iter *ListPoolsResultIterator) Next() error { 1681 return iter.NextWithContext(context.Background()) 1682} 1683 1684// NotDone returns true if the enumeration should be started or is not yet complete. 1685func (iter ListPoolsResultIterator) NotDone() bool { 1686 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1687} 1688 1689// Response returns the raw server response from the last page request. 1690func (iter ListPoolsResultIterator) Response() ListPoolsResult { 1691 return iter.page.Response() 1692} 1693 1694// Value returns the current value or a zero-initialized value if the 1695// iterator has advanced beyond the end of the collection. 1696func (iter ListPoolsResultIterator) Value() Pool { 1697 if !iter.page.NotDone() { 1698 return Pool{} 1699 } 1700 return iter.page.Values()[iter.i] 1701} 1702 1703// Creates a new instance of the ListPoolsResultIterator type. 1704func NewListPoolsResultIterator(page ListPoolsResultPage) ListPoolsResultIterator { 1705 return ListPoolsResultIterator{page: page} 1706} 1707 1708// IsEmpty returns true if the ListResult contains no values. 1709func (lpr ListPoolsResult) IsEmpty() bool { 1710 return lpr.Value == nil || len(*lpr.Value) == 0 1711} 1712 1713// hasNextLink returns true if the NextLink is not empty. 1714func (lpr ListPoolsResult) hasNextLink() bool { 1715 return lpr.NextLink != nil && len(*lpr.NextLink) != 0 1716} 1717 1718// listPoolsResultPreparer prepares a request to retrieve the next set of results. 1719// It returns nil if no more results exist. 1720func (lpr ListPoolsResult) listPoolsResultPreparer(ctx context.Context) (*http.Request, error) { 1721 if !lpr.hasNextLink() { 1722 return nil, nil 1723 } 1724 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1725 autorest.AsJSON(), 1726 autorest.AsGet(), 1727 autorest.WithBaseURL(to.String(lpr.NextLink))) 1728} 1729 1730// ListPoolsResultPage contains a page of Pool values. 1731type ListPoolsResultPage struct { 1732 fn func(context.Context, ListPoolsResult) (ListPoolsResult, error) 1733 lpr ListPoolsResult 1734} 1735 1736// NextWithContext advances to the next page of values. If there was an error making 1737// the request the page does not advance and the error is returned. 1738func (page *ListPoolsResultPage) NextWithContext(ctx context.Context) (err error) { 1739 if tracing.IsEnabled() { 1740 ctx = tracing.StartSpan(ctx, fqdn+"/ListPoolsResultPage.NextWithContext") 1741 defer func() { 1742 sc := -1 1743 if page.Response().Response.Response != nil { 1744 sc = page.Response().Response.Response.StatusCode 1745 } 1746 tracing.EndSpan(ctx, sc, err) 1747 }() 1748 } 1749 for { 1750 next, err := page.fn(ctx, page.lpr) 1751 if err != nil { 1752 return err 1753 } 1754 page.lpr = next 1755 if !next.hasNextLink() || !next.IsEmpty() { 1756 break 1757 } 1758 } 1759 return nil 1760} 1761 1762// Next advances to the next page of values. If there was an error making 1763// the request the page does not advance and the error is returned. 1764// Deprecated: Use NextWithContext() instead. 1765func (page *ListPoolsResultPage) Next() error { 1766 return page.NextWithContext(context.Background()) 1767} 1768 1769// NotDone returns true if the page enumeration should be started or is not yet complete. 1770func (page ListPoolsResultPage) NotDone() bool { 1771 return !page.lpr.IsEmpty() 1772} 1773 1774// Response returns the raw server response from the last page request. 1775func (page ListPoolsResultPage) Response() ListPoolsResult { 1776 return page.lpr 1777} 1778 1779// Values returns the slice of values for the current page or nil if there are no values. 1780func (page ListPoolsResultPage) Values() []Pool { 1781 if page.lpr.IsEmpty() { 1782 return nil 1783 } 1784 return *page.lpr.Value 1785} 1786 1787// Creates a new instance of the ListPoolsResultPage type. 1788func NewListPoolsResultPage(cur ListPoolsResult, getNextPage func(context.Context, ListPoolsResult) (ListPoolsResult, error)) ListPoolsResultPage { 1789 return ListPoolsResultPage{ 1790 fn: getNextPage, 1791 lpr: cur, 1792 } 1793} 1794 1795// LocationQuota quotas associated with a Batch region for a particular subscription. 1796type LocationQuota struct { 1797 autorest.Response `json:"-"` 1798 // AccountQuota - READ-ONLY; The number of Batch accounts that may be created under the subscription in the specified region. 1799 AccountQuota *int32 `json:"accountQuota,omitempty"` 1800} 1801 1802// MetadataItem the Batch service does not assign any meaning to this metadata; it is solely for the use of 1803// user code. 1804type MetadataItem struct { 1805 Name *string `json:"name,omitempty"` 1806 Value *string `json:"value,omitempty"` 1807} 1808 1809// NetworkConfiguration the network configuration for a pool. 1810type NetworkConfiguration struct { 1811 // SubnetID - The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created via virtualMachineConfiguration the Batch account must have poolAllocationMode userSubscription in order to use a VNet. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration 1812 SubnetID *string `json:"subnetId,omitempty"` 1813 // EndpointConfiguration - Pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. 1814 EndpointConfiguration *PoolEndpointConfiguration `json:"endpointConfiguration,omitempty"` 1815} 1816 1817// NetworkSecurityGroupRule ... 1818type NetworkSecurityGroupRule struct { 1819 // Priority - Priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 3500. If any reserved or duplicate values are provided the request fails with HTTP status code 400. 1820 Priority *int32 `json:"priority,omitempty"` 1821 // Access - Possible values include: 'Allow', 'Deny' 1822 Access NetworkSecurityGroupRuleAccess `json:"access,omitempty"` 1823 // SourceAddressPrefix - Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. 1824 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 1825} 1826 1827// Operation ... 1828type Operation struct { 1829 // Name - This is of the format {provider}/{resource}/{operation} 1830 Name *string `json:"name,omitempty"` 1831 Display *OperationDisplay `json:"display,omitempty"` 1832 Origin *string `json:"origin,omitempty"` 1833 Properties interface{} `json:"properties,omitempty"` 1834} 1835 1836// OperationDisplay ... 1837type OperationDisplay struct { 1838 Provider *string `json:"provider,omitempty"` 1839 // Operation - For example: read, write, delete, or listKeys/action 1840 Operation *string `json:"operation,omitempty"` 1841 Resource *string `json:"resource,omitempty"` 1842 Description *string `json:"description,omitempty"` 1843} 1844 1845// OperationListResult ... 1846type OperationListResult struct { 1847 autorest.Response `json:"-"` 1848 Value *[]Operation `json:"value,omitempty"` 1849 NextLink *string `json:"nextLink,omitempty"` 1850} 1851 1852// OperationListResultIterator provides access to a complete listing of Operation values. 1853type OperationListResultIterator struct { 1854 i int 1855 page OperationListResultPage 1856} 1857 1858// NextWithContext advances to the next value. If there was an error making 1859// the request the iterator does not advance and the error is returned. 1860func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 1861 if tracing.IsEnabled() { 1862 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 1863 defer func() { 1864 sc := -1 1865 if iter.Response().Response.Response != nil { 1866 sc = iter.Response().Response.Response.StatusCode 1867 } 1868 tracing.EndSpan(ctx, sc, err) 1869 }() 1870 } 1871 iter.i++ 1872 if iter.i < len(iter.page.Values()) { 1873 return nil 1874 } 1875 err = iter.page.NextWithContext(ctx) 1876 if err != nil { 1877 iter.i-- 1878 return err 1879 } 1880 iter.i = 0 1881 return nil 1882} 1883 1884// Next advances to the next value. If there was an error making 1885// the request the iterator does not advance and the error is returned. 1886// Deprecated: Use NextWithContext() instead. 1887func (iter *OperationListResultIterator) Next() error { 1888 return iter.NextWithContext(context.Background()) 1889} 1890 1891// NotDone returns true if the enumeration should be started or is not yet complete. 1892func (iter OperationListResultIterator) NotDone() bool { 1893 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1894} 1895 1896// Response returns the raw server response from the last page request. 1897func (iter OperationListResultIterator) Response() OperationListResult { 1898 return iter.page.Response() 1899} 1900 1901// Value returns the current value or a zero-initialized value if the 1902// iterator has advanced beyond the end of the collection. 1903func (iter OperationListResultIterator) Value() Operation { 1904 if !iter.page.NotDone() { 1905 return Operation{} 1906 } 1907 return iter.page.Values()[iter.i] 1908} 1909 1910// Creates a new instance of the OperationListResultIterator type. 1911func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 1912 return OperationListResultIterator{page: page} 1913} 1914 1915// IsEmpty returns true if the ListResult contains no values. 1916func (olr OperationListResult) IsEmpty() bool { 1917 return olr.Value == nil || len(*olr.Value) == 0 1918} 1919 1920// hasNextLink returns true if the NextLink is not empty. 1921func (olr OperationListResult) hasNextLink() bool { 1922 return olr.NextLink != nil && len(*olr.NextLink) != 0 1923} 1924 1925// operationListResultPreparer prepares a request to retrieve the next set of results. 1926// It returns nil if no more results exist. 1927func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 1928 if !olr.hasNextLink() { 1929 return nil, nil 1930 } 1931 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1932 autorest.AsJSON(), 1933 autorest.AsGet(), 1934 autorest.WithBaseURL(to.String(olr.NextLink))) 1935} 1936 1937// OperationListResultPage contains a page of Operation values. 1938type OperationListResultPage struct { 1939 fn func(context.Context, OperationListResult) (OperationListResult, error) 1940 olr OperationListResult 1941} 1942 1943// NextWithContext advances to the next page of values. If there was an error making 1944// the request the page does not advance and the error is returned. 1945func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 1946 if tracing.IsEnabled() { 1947 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 1948 defer func() { 1949 sc := -1 1950 if page.Response().Response.Response != nil { 1951 sc = page.Response().Response.Response.StatusCode 1952 } 1953 tracing.EndSpan(ctx, sc, err) 1954 }() 1955 } 1956 for { 1957 next, err := page.fn(ctx, page.olr) 1958 if err != nil { 1959 return err 1960 } 1961 page.olr = next 1962 if !next.hasNextLink() || !next.IsEmpty() { 1963 break 1964 } 1965 } 1966 return nil 1967} 1968 1969// Next advances to the next page of values. If there was an error making 1970// the request the page does not advance and the error is returned. 1971// Deprecated: Use NextWithContext() instead. 1972func (page *OperationListResultPage) Next() error { 1973 return page.NextWithContext(context.Background()) 1974} 1975 1976// NotDone returns true if the page enumeration should be started or is not yet complete. 1977func (page OperationListResultPage) NotDone() bool { 1978 return !page.olr.IsEmpty() 1979} 1980 1981// Response returns the raw server response from the last page request. 1982func (page OperationListResultPage) Response() OperationListResult { 1983 return page.olr 1984} 1985 1986// Values returns the slice of values for the current page or nil if there are no values. 1987func (page OperationListResultPage) Values() []Operation { 1988 if page.olr.IsEmpty() { 1989 return nil 1990 } 1991 return *page.olr.Value 1992} 1993 1994// Creates a new instance of the OperationListResultPage type. 1995func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 1996 return OperationListResultPage{ 1997 fn: getNextPage, 1998 olr: cur, 1999 } 2000} 2001 2002// Pool contains information about a pool. 2003type Pool struct { 2004 autorest.Response `json:"-"` 2005 // PoolProperties - The properties associated with the pool. 2006 *PoolProperties `json:"properties,omitempty"` 2007 // ID - READ-ONLY; The ID of the resource. 2008 ID *string `json:"id,omitempty"` 2009 // Name - READ-ONLY; The name of the resource. 2010 Name *string `json:"name,omitempty"` 2011 // Type - READ-ONLY; The type of the resource. 2012 Type *string `json:"type,omitempty"` 2013 // Etag - READ-ONLY; The ETag of the resource, used for concurrency statements. 2014 Etag *string `json:"etag,omitempty"` 2015} 2016 2017// MarshalJSON is the custom marshaler for Pool. 2018func (p Pool) MarshalJSON() ([]byte, error) { 2019 objectMap := make(map[string]interface{}) 2020 if p.PoolProperties != nil { 2021 objectMap["properties"] = p.PoolProperties 2022 } 2023 return json.Marshal(objectMap) 2024} 2025 2026// UnmarshalJSON is the custom unmarshaler for Pool struct. 2027func (p *Pool) UnmarshalJSON(body []byte) error { 2028 var m map[string]*json.RawMessage 2029 err := json.Unmarshal(body, &m) 2030 if err != nil { 2031 return err 2032 } 2033 for k, v := range m { 2034 switch k { 2035 case "properties": 2036 if v != nil { 2037 var poolProperties PoolProperties 2038 err = json.Unmarshal(*v, &poolProperties) 2039 if err != nil { 2040 return err 2041 } 2042 p.PoolProperties = &poolProperties 2043 } 2044 case "id": 2045 if v != nil { 2046 var ID string 2047 err = json.Unmarshal(*v, &ID) 2048 if err != nil { 2049 return err 2050 } 2051 p.ID = &ID 2052 } 2053 case "name": 2054 if v != nil { 2055 var name string 2056 err = json.Unmarshal(*v, &name) 2057 if err != nil { 2058 return err 2059 } 2060 p.Name = &name 2061 } 2062 case "type": 2063 if v != nil { 2064 var typeVar string 2065 err = json.Unmarshal(*v, &typeVar) 2066 if err != nil { 2067 return err 2068 } 2069 p.Type = &typeVar 2070 } 2071 case "etag": 2072 if v != nil { 2073 var etag string 2074 err = json.Unmarshal(*v, &etag) 2075 if err != nil { 2076 return err 2077 } 2078 p.Etag = &etag 2079 } 2080 } 2081 } 2082 2083 return nil 2084} 2085 2086// PoolCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2087type PoolCreateFuture struct { 2088 azure.FutureAPI 2089 // Result returns the result of the asynchronous operation. 2090 // If the operation has not completed it will return an error. 2091 Result func(PoolClient) (Pool, error) 2092} 2093 2094// PoolDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 2095type PoolDeleteFuture struct { 2096 azure.FutureAPI 2097 // Result returns the result of the asynchronous operation. 2098 // If the operation has not completed it will return an error. 2099 Result func(PoolClient) (autorest.Response, error) 2100} 2101 2102// PoolEndpointConfiguration ... 2103type PoolEndpointConfiguration struct { 2104 // InboundNatPools - The maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400. 2105 InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` 2106} 2107 2108// PoolProperties pool properties. 2109type PoolProperties struct { 2110 // DisplayName - The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. 2111 DisplayName *string `json:"displayName,omitempty"` 2112 // LastModified - READ-ONLY; This is the last time at which the pool level data, such as the targetDedicatedNodes or autoScaleSettings, changed. It does not factor in node-level changes such as a compute node changing state. 2113 LastModified *date.Time `json:"lastModified,omitempty"` 2114 // CreationTime - READ-ONLY 2115 CreationTime *date.Time `json:"creationTime,omitempty"` 2116 // ProvisioningState - READ-ONLY; Possible values include: 'PoolProvisioningStateSucceeded', 'PoolProvisioningStateDeleting' 2117 ProvisioningState PoolProvisioningState `json:"provisioningState,omitempty"` 2118 // ProvisioningStateTransitionTime - READ-ONLY 2119 ProvisioningStateTransitionTime *date.Time `json:"provisioningStateTransitionTime,omitempty"` 2120 // AllocationState - READ-ONLY; Possible values include: 'Steady', 'Resizing', 'Stopping' 2121 AllocationState AllocationState `json:"allocationState,omitempty"` 2122 // AllocationStateTransitionTime - READ-ONLY 2123 AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` 2124 // VMSize - For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). 2125 VMSize *string `json:"vmSize,omitempty"` 2126 // DeploymentConfiguration - Using CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS), while VirtualMachineConfiguration uses Azure Virtual Machines (IaaS). 2127 DeploymentConfiguration *DeploymentConfiguration `json:"deploymentConfiguration,omitempty"` 2128 // CurrentDedicatedNodes - READ-ONLY 2129 CurrentDedicatedNodes *int32 `json:"currentDedicatedNodes,omitempty"` 2130 // CurrentLowPriorityNodes - READ-ONLY 2131 CurrentLowPriorityNodes *int32 `json:"currentLowPriorityNodes,omitempty"` 2132 ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` 2133 // AutoScaleRun - READ-ONLY; This property is set only if the pool automatically scales, i.e. autoScaleSettings are used. 2134 AutoScaleRun *AutoScaleRun `json:"autoScaleRun,omitempty"` 2135 // InterNodeCommunication - This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. Possible values include: 'Enabled', 'Disabled' 2136 InterNodeCommunication InterNodeCommunicationState `json:"interNodeCommunication,omitempty"` 2137 NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` 2138 // MaxTasksPerNode - The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. 2139 MaxTasksPerNode *int32 `json:"maxTasksPerNode,omitempty"` 2140 // TaskSchedulingPolicy - If not specified, the default is spread. 2141 TaskSchedulingPolicy *TaskSchedulingPolicy `json:"taskSchedulingPolicy,omitempty"` 2142 UserAccounts *[]UserAccount `json:"userAccounts,omitempty"` 2143 // Metadata - The Batch service does not assign any meaning to metadata; it is solely for the use of user code. 2144 Metadata *[]MetadataItem `json:"metadata,omitempty"` 2145 // StartTask - In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. 2146 StartTask *StartTask `json:"startTask,omitempty"` 2147 // Certificates - For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. 2148 Certificates *[]CertificateReference `json:"certificates,omitempty"` 2149 // ApplicationPackages - Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. There is a maximum of 10 application package references on any given pool. 2150 ApplicationPackages *[]ApplicationPackageReference `json:"applicationPackages,omitempty"` 2151 // ApplicationLicenses - The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. 2152 ApplicationLicenses *[]string `json:"applicationLicenses,omitempty"` 2153 // ResizeOperationStatus - READ-ONLY 2154 ResizeOperationStatus *ResizeOperationStatus `json:"resizeOperationStatus,omitempty"` 2155} 2156 2157// MarshalJSON is the custom marshaler for PoolProperties. 2158func (pp PoolProperties) MarshalJSON() ([]byte, error) { 2159 objectMap := make(map[string]interface{}) 2160 if pp.DisplayName != nil { 2161 objectMap["displayName"] = pp.DisplayName 2162 } 2163 if pp.VMSize != nil { 2164 objectMap["vmSize"] = pp.VMSize 2165 } 2166 if pp.DeploymentConfiguration != nil { 2167 objectMap["deploymentConfiguration"] = pp.DeploymentConfiguration 2168 } 2169 if pp.ScaleSettings != nil { 2170 objectMap["scaleSettings"] = pp.ScaleSettings 2171 } 2172 if pp.InterNodeCommunication != "" { 2173 objectMap["interNodeCommunication"] = pp.InterNodeCommunication 2174 } 2175 if pp.NetworkConfiguration != nil { 2176 objectMap["networkConfiguration"] = pp.NetworkConfiguration 2177 } 2178 if pp.MaxTasksPerNode != nil { 2179 objectMap["maxTasksPerNode"] = pp.MaxTasksPerNode 2180 } 2181 if pp.TaskSchedulingPolicy != nil { 2182 objectMap["taskSchedulingPolicy"] = pp.TaskSchedulingPolicy 2183 } 2184 if pp.UserAccounts != nil { 2185 objectMap["userAccounts"] = pp.UserAccounts 2186 } 2187 if pp.Metadata != nil { 2188 objectMap["metadata"] = pp.Metadata 2189 } 2190 if pp.StartTask != nil { 2191 objectMap["startTask"] = pp.StartTask 2192 } 2193 if pp.Certificates != nil { 2194 objectMap["certificates"] = pp.Certificates 2195 } 2196 if pp.ApplicationPackages != nil { 2197 objectMap["applicationPackages"] = pp.ApplicationPackages 2198 } 2199 if pp.ApplicationLicenses != nil { 2200 objectMap["applicationLicenses"] = pp.ApplicationLicenses 2201 } 2202 return json.Marshal(objectMap) 2203} 2204 2205// ProxyResource a definition of an Azure resource. 2206type ProxyResource struct { 2207 // ID - READ-ONLY; The ID of the resource. 2208 ID *string `json:"id,omitempty"` 2209 // Name - READ-ONLY; The name of the resource. 2210 Name *string `json:"name,omitempty"` 2211 // Type - READ-ONLY; The type of the resource. 2212 Type *string `json:"type,omitempty"` 2213 // Etag - READ-ONLY; The ETag of the resource, used for concurrency statements. 2214 Etag *string `json:"etag,omitempty"` 2215} 2216 2217// ResizeError ... 2218type ResizeError struct { 2219 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 2220 Code *string `json:"code,omitempty"` 2221 // Message - A message describing the error, intended to be suitable for display in a user interface. 2222 Message *string `json:"message,omitempty"` 2223 Details *[]ResizeError `json:"details,omitempty"` 2224} 2225 2226// ResizeOperationStatus describes either the current operation (if the pool AllocationState is Resizing) 2227// or the previously completed operation (if the AllocationState is Steady). 2228type ResizeOperationStatus struct { 2229 TargetDedicatedNodes *int32 `json:"targetDedicatedNodes,omitempty"` 2230 TargetLowPriorityNodes *int32 `json:"targetLowPriorityNodes,omitempty"` 2231 // ResizeTimeout - The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). 2232 ResizeTimeout *string `json:"resizeTimeout,omitempty"` 2233 // NodeDeallocationOption - The default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' 2234 NodeDeallocationOption ComputeNodeDeallocationOption `json:"nodeDeallocationOption,omitempty"` 2235 StartTime *date.Time `json:"startTime,omitempty"` 2236 // Errors - This property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady. 2237 Errors *[]ResizeError `json:"errors,omitempty"` 2238} 2239 2240// Resource a definition of an Azure resource. 2241type Resource struct { 2242 // ID - READ-ONLY; The ID of the resource. 2243 ID *string `json:"id,omitempty"` 2244 // Name - READ-ONLY; The name of the resource. 2245 Name *string `json:"name,omitempty"` 2246 // Type - READ-ONLY; The type of the resource. 2247 Type *string `json:"type,omitempty"` 2248 // Location - READ-ONLY; The location of the resource. 2249 Location *string `json:"location,omitempty"` 2250 // Tags - READ-ONLY; The tags of the resource. 2251 Tags map[string]*string `json:"tags"` 2252} 2253 2254// MarshalJSON is the custom marshaler for Resource. 2255func (r Resource) MarshalJSON() ([]byte, error) { 2256 objectMap := make(map[string]interface{}) 2257 return json.Marshal(objectMap) 2258} 2259 2260// ResourceFile ... 2261type ResourceFile struct { 2262 // AutoStorageContainerName - The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. 2263 AutoStorageContainerName *string `json:"autoStorageContainerName,omitempty"` 2264 // StorageContainerURL - The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. This URL must be readable and listable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read and list permissions on the blob, or set the ACL for the blob or its container to allow public access. 2265 StorageContainerURL *string `json:"storageContainerUrl,omitempty"` 2266 // HTTPURL - The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. If the URL is Azure Blob Storage, it must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access. 2267 HTTPURL *string `json:"httpUrl,omitempty"` 2268 // BlobPrefix - The property is valid only when autoStorageContainerName or storageContainerUrl is used. This prefix can be a partial filename or a subdirectory. If a prefix is not specified, all the files in the container will be downloaded. 2269 BlobPrefix *string `json:"blobPrefix,omitempty"` 2270 // FilePath - If the httpUrl property is specified, the filePath is required and describes the path which the file will be downloaded to, including the filename. Otherwise, if the autoStorageContainerName or storageContainerUrl property is specified, filePath is optional and is the directory to download the files to. In the case where filePath is used as a directory, any directory structure already associated with the input data will be retained in full and appended to the specified filePath directory. The specified relative path cannot break out of the task's working directory (for example by using '..'). 2271 FilePath *string `json:"filePath,omitempty"` 2272 // FileMode - This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. 2273 FileMode *string `json:"fileMode,omitempty"` 2274} 2275 2276// ScaleSettings defines the desired size of the pool. This can either be 'fixedScale' where the requested 2277// targetDedicatedNodes is specified, or 'autoScale' which defines a formula which is periodically 2278// reevaluated. If this property is not specified, the pool will have a fixed scale with 0 2279// targetDedicatedNodes. 2280type ScaleSettings struct { 2281 // FixedScale - This property and autoScale are mutually exclusive and one of the properties must be specified. 2282 FixedScale *FixedScaleSettings `json:"fixedScale,omitempty"` 2283 // AutoScale - This property and fixedScale are mutually exclusive and one of the properties must be specified. 2284 AutoScale *AutoScaleSettings `json:"autoScale,omitempty"` 2285} 2286 2287// StartTask in some cases the start task may be re-run even though the node was not rebooted. Due to this, 2288// start tasks should be idempotent and exit gracefully if the setup they're performing has already been 2289// done. Special care should be taken to avoid start tasks which create breakaway process or install/launch 2290// services from the start task working directory, as this will block Batch from being able to re-run the 2291// start task. 2292type StartTask struct { 2293 // CommandLine - The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. Required if any other properties of the startTask are specified. 2294 CommandLine *string `json:"commandLine,omitempty"` 2295 ResourceFiles *[]ResourceFile `json:"resourceFiles,omitempty"` 2296 EnvironmentSettings *[]EnvironmentSetting `json:"environmentSettings,omitempty"` 2297 // UserIdentity - If omitted, the task runs as a non-administrative user unique to the task. 2298 UserIdentity *UserIdentity `json:"userIdentity,omitempty"` 2299 // MaxTaskRetryCount - The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. 2300 MaxTaskRetryCount *int32 `json:"maxTaskRetryCount,omitempty"` 2301 // WaitForSuccess - If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. 2302 WaitForSuccess *bool `json:"waitForSuccess,omitempty"` 2303 // ContainerSettings - When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. 2304 ContainerSettings *TaskContainerSettings `json:"containerSettings,omitempty"` 2305} 2306 2307// TaskContainerSettings ... 2308type TaskContainerSettings struct { 2309 // ContainerRunOptions - These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. 2310 ContainerRunOptions *string `json:"containerRunOptions,omitempty"` 2311 // ImageName - This is the full image reference, as would be specified to "docker pull". If no tag is provided as part of the image name, the tag ":latest" is used as a default. 2312 ImageName *string `json:"imageName,omitempty"` 2313 // Registry - This setting can be omitted if was already provided at pool creation. 2314 Registry *ContainerRegistry `json:"registry,omitempty"` 2315} 2316 2317// TaskSchedulingPolicy ... 2318type TaskSchedulingPolicy struct { 2319 // NodeFillType - Possible values include: 'Spread', 'Pack' 2320 NodeFillType ComputeNodeFillType `json:"nodeFillType,omitempty"` 2321} 2322 2323// UserAccount ... 2324type UserAccount struct { 2325 Name *string `json:"name,omitempty"` 2326 Password *string `json:"password,omitempty"` 2327 // ElevationLevel - nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin' 2328 ElevationLevel ElevationLevel `json:"elevationLevel,omitempty"` 2329 // LinuxUserConfiguration - This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. 2330 LinuxUserConfiguration *LinuxUserConfiguration `json:"linuxUserConfiguration,omitempty"` 2331 // WindowsUserConfiguration - This property can only be specified if the user is on a Windows pool. If not specified and on a Windows pool, the user is created with the default options. 2332 WindowsUserConfiguration *WindowsUserConfiguration `json:"windowsUserConfiguration,omitempty"` 2333} 2334 2335// UserIdentity specify either the userName or autoUser property, but not both. 2336type UserIdentity struct { 2337 // UserName - The userName and autoUser properties are mutually exclusive; you must specify one but not both. 2338 UserName *string `json:"userName,omitempty"` 2339 // AutoUser - The userName and autoUser properties are mutually exclusive; you must specify one but not both. 2340 AutoUser *AutoUserSpecification `json:"autoUser,omitempty"` 2341} 2342 2343// VirtualMachineConfiguration ... 2344type VirtualMachineConfiguration struct { 2345 ImageReference *ImageReference `json:"imageReference,omitempty"` 2346 // NodeAgentSkuID - The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. 2347 NodeAgentSkuID *string `json:"nodeAgentSkuId,omitempty"` 2348 // WindowsConfiguration - This property must not be specified if the imageReference specifies a Linux OS image. 2349 WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` 2350 // DataDisks - This property must be specified if the compute nodes in the pool need to have empty data disks attached to them. 2351 DataDisks *[]DataDisk `json:"dataDisks,omitempty"` 2352 // LicenseType - This only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: 2353 // Windows_Server - The on-premises license is for Windows Server. 2354 // Windows_Client - The on-premises license is for Windows Client. 2355 LicenseType *string `json:"licenseType,omitempty"` 2356 // ContainerConfiguration - If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular tasks and job manager tasks run on this pool must specify the containerSettings property, and all other tasks may specify it. 2357 ContainerConfiguration *ContainerConfiguration `json:"containerConfiguration,omitempty"` 2358} 2359 2360// VirtualMachineFamilyCoreQuota a VM Family and its associated core quota for the Batch account. 2361type VirtualMachineFamilyCoreQuota struct { 2362 // Name - READ-ONLY; The Virtual Machine family name. 2363 Name *string `json:"name,omitempty"` 2364 // CoreQuota - READ-ONLY; The core quota for the VM family for the Batch account. 2365 CoreQuota *int32 `json:"coreQuota,omitempty"` 2366} 2367 2368// WindowsConfiguration ... 2369type WindowsConfiguration struct { 2370 // EnableAutomaticUpdates - If omitted, the default value is true. 2371 EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` 2372} 2373 2374// WindowsUserConfiguration ... 2375type WindowsUserConfiguration struct { 2376 // LoginMode - Specifies login mode for the user. The default value for VirtualMachineConfiguration pools is interactive mode and for CloudServiceConfiguration pools is batch mode. Possible values include: 'Batch', 'Interactive' 2377 LoginMode LoginMode `json:"loginMode,omitempty"` 2378} 2379