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