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