1package containerinstance 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// ContainerGroupNetworkProtocol enumerates the values for container group network protocol. 30type ContainerGroupNetworkProtocol string 31 32const ( 33 // TCP ... 34 TCP ContainerGroupNetworkProtocol = "TCP" 35 // UDP ... 36 UDP ContainerGroupNetworkProtocol = "UDP" 37) 38 39// PossibleContainerGroupNetworkProtocolValues returns an array of possible values for the ContainerGroupNetworkProtocol const type. 40func PossibleContainerGroupNetworkProtocolValues() []ContainerGroupNetworkProtocol { 41 return []ContainerGroupNetworkProtocol{TCP, UDP} 42} 43 44// ContainerGroupRestartPolicy enumerates the values for container group restart policy. 45type ContainerGroupRestartPolicy string 46 47const ( 48 // Always ... 49 Always ContainerGroupRestartPolicy = "Always" 50 // Never ... 51 Never ContainerGroupRestartPolicy = "Never" 52 // OnFailure ... 53 OnFailure ContainerGroupRestartPolicy = "OnFailure" 54) 55 56// PossibleContainerGroupRestartPolicyValues returns an array of possible values for the ContainerGroupRestartPolicy const type. 57func PossibleContainerGroupRestartPolicyValues() []ContainerGroupRestartPolicy { 58 return []ContainerGroupRestartPolicy{Always, Never, OnFailure} 59} 60 61// ContainerNetworkProtocol enumerates the values for container network protocol. 62type ContainerNetworkProtocol string 63 64const ( 65 // ContainerNetworkProtocolTCP ... 66 ContainerNetworkProtocolTCP ContainerNetworkProtocol = "TCP" 67 // ContainerNetworkProtocolUDP ... 68 ContainerNetworkProtocolUDP ContainerNetworkProtocol = "UDP" 69) 70 71// PossibleContainerNetworkProtocolValues returns an array of possible values for the ContainerNetworkProtocol const type. 72func PossibleContainerNetworkProtocolValues() []ContainerNetworkProtocol { 73 return []ContainerNetworkProtocol{ContainerNetworkProtocolTCP, ContainerNetworkProtocolUDP} 74} 75 76// OperatingSystemTypes enumerates the values for operating system types. 77type OperatingSystemTypes string 78 79const ( 80 // Linux ... 81 Linux OperatingSystemTypes = "Linux" 82 // Windows ... 83 Windows OperatingSystemTypes = "Windows" 84) 85 86// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. 87func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { 88 return []OperatingSystemTypes{Linux, Windows} 89} 90 91// OperationsOrigin enumerates the values for operations origin. 92type OperationsOrigin string 93 94const ( 95 // System ... 96 System OperationsOrigin = "System" 97 // User ... 98 User OperationsOrigin = "User" 99) 100 101// PossibleOperationsOriginValues returns an array of possible values for the OperationsOrigin const type. 102func PossibleOperationsOriginValues() []OperationsOrigin { 103 return []OperationsOrigin{System, User} 104} 105 106// Scheme enumerates the values for scheme. 107type Scheme string 108 109const ( 110 // HTTP ... 111 HTTP Scheme = "http" 112 // HTTPS ... 113 HTTPS Scheme = "https" 114) 115 116// PossibleSchemeValues returns an array of possible values for the Scheme const type. 117func PossibleSchemeValues() []Scheme { 118 return []Scheme{HTTP, HTTPS} 119} 120 121// AzureFileVolume the properties of the Azure File volume. Azure File shares are mounted as volumes. 122type AzureFileVolume struct { 123 // ShareName - The name of the Azure File share to be mounted as a volume. 124 ShareName *string `json:"shareName,omitempty"` 125 // ReadOnly - The flag indicating whether the Azure File shared mounted as a volume is read-only. 126 ReadOnly *bool `json:"readOnly,omitempty"` 127 // StorageAccountName - The name of the storage account that contains the Azure File share. 128 StorageAccountName *string `json:"storageAccountName,omitempty"` 129 // StorageAccountKey - The storage account access key used to access the Azure File share. 130 StorageAccountKey *string `json:"storageAccountKey,omitempty"` 131} 132 133// Container a container instance. 134type Container struct { 135 // Name - The user-provided name of the container instance. 136 Name *string `json:"name,omitempty"` 137 // ContainerProperties - The properties of the container instance. 138 *ContainerProperties `json:"properties,omitempty"` 139} 140 141// MarshalJSON is the custom marshaler for Container. 142func (c Container) MarshalJSON() ([]byte, error) { 143 objectMap := make(map[string]interface{}) 144 if c.Name != nil { 145 objectMap["name"] = c.Name 146 } 147 if c.ContainerProperties != nil { 148 objectMap["properties"] = c.ContainerProperties 149 } 150 return json.Marshal(objectMap) 151} 152 153// UnmarshalJSON is the custom unmarshaler for Container struct. 154func (c *Container) UnmarshalJSON(body []byte) error { 155 var m map[string]*json.RawMessage 156 err := json.Unmarshal(body, &m) 157 if err != nil { 158 return err 159 } 160 for k, v := range m { 161 switch k { 162 case "name": 163 if v != nil { 164 var name string 165 err = json.Unmarshal(*v, &name) 166 if err != nil { 167 return err 168 } 169 c.Name = &name 170 } 171 case "properties": 172 if v != nil { 173 var containerProperties ContainerProperties 174 err = json.Unmarshal(*v, &containerProperties) 175 if err != nil { 176 return err 177 } 178 c.ContainerProperties = &containerProperties 179 } 180 } 181 } 182 183 return nil 184} 185 186// ContainerExec the container execution command, for liveness or readiness probe 187type ContainerExec struct { 188 // Command - The commands to execute within the container. 189 Command *[]string `json:"command,omitempty"` 190} 191 192// ContainerExecRequest the container exec request. 193type ContainerExecRequest struct { 194 // Command - The command to be executed. 195 Command *string `json:"command,omitempty"` 196 // TerminalSize - The size of the terminal. 197 TerminalSize *ContainerExecRequestTerminalSize `json:"terminalSize,omitempty"` 198} 199 200// ContainerExecRequestTerminalSize the size of the terminal. 201type ContainerExecRequestTerminalSize struct { 202 // Rows - The row size of the terminal 203 Rows *int32 `json:"rows,omitempty"` 204 // Cols - The column size of the terminal 205 Cols *int32 `json:"cols,omitempty"` 206} 207 208// ContainerExecResponse the information for the container exec command. 209type ContainerExecResponse struct { 210 autorest.Response `json:"-"` 211 // WebSocketURI - The uri for the exec websocket. 212 WebSocketURI *string `json:"webSocketUri,omitempty"` 213 // Password - The password to start the exec command. 214 Password *string `json:"password,omitempty"` 215} 216 217// ContainerGroup a container group. 218type ContainerGroup struct { 219 autorest.Response `json:"-"` 220 *ContainerGroupProperties `json:"properties,omitempty"` 221 // ID - The resource id. 222 ID *string `json:"id,omitempty"` 223 // Name - The resource name. 224 Name *string `json:"name,omitempty"` 225 // Type - The resource type. 226 Type *string `json:"type,omitempty"` 227 // Location - The resource location. 228 Location *string `json:"location,omitempty"` 229 // Tags - The resource tags. 230 Tags map[string]*string `json:"tags"` 231} 232 233// MarshalJSON is the custom marshaler for ContainerGroup. 234func (cg ContainerGroup) MarshalJSON() ([]byte, error) { 235 objectMap := make(map[string]interface{}) 236 if cg.ContainerGroupProperties != nil { 237 objectMap["properties"] = cg.ContainerGroupProperties 238 } 239 if cg.ID != nil { 240 objectMap["id"] = cg.ID 241 } 242 if cg.Name != nil { 243 objectMap["name"] = cg.Name 244 } 245 if cg.Type != nil { 246 objectMap["type"] = cg.Type 247 } 248 if cg.Location != nil { 249 objectMap["location"] = cg.Location 250 } 251 if cg.Tags != nil { 252 objectMap["tags"] = cg.Tags 253 } 254 return json.Marshal(objectMap) 255} 256 257// UnmarshalJSON is the custom unmarshaler for ContainerGroup struct. 258func (cg *ContainerGroup) UnmarshalJSON(body []byte) error { 259 var m map[string]*json.RawMessage 260 err := json.Unmarshal(body, &m) 261 if err != nil { 262 return err 263 } 264 for k, v := range m { 265 switch k { 266 case "properties": 267 if v != nil { 268 var containerGroupProperties ContainerGroupProperties 269 err = json.Unmarshal(*v, &containerGroupProperties) 270 if err != nil { 271 return err 272 } 273 cg.ContainerGroupProperties = &containerGroupProperties 274 } 275 case "id": 276 if v != nil { 277 var ID string 278 err = json.Unmarshal(*v, &ID) 279 if err != nil { 280 return err 281 } 282 cg.ID = &ID 283 } 284 case "name": 285 if v != nil { 286 var name string 287 err = json.Unmarshal(*v, &name) 288 if err != nil { 289 return err 290 } 291 cg.Name = &name 292 } 293 case "type": 294 if v != nil { 295 var typeVar string 296 err = json.Unmarshal(*v, &typeVar) 297 if err != nil { 298 return err 299 } 300 cg.Type = &typeVar 301 } 302 case "location": 303 if v != nil { 304 var location string 305 err = json.Unmarshal(*v, &location) 306 if err != nil { 307 return err 308 } 309 cg.Location = &location 310 } 311 case "tags": 312 if v != nil { 313 var tags map[string]*string 314 err = json.Unmarshal(*v, &tags) 315 if err != nil { 316 return err 317 } 318 cg.Tags = tags 319 } 320 } 321 } 322 323 return nil 324} 325 326// ContainerGroupDiagnostics container group diagnostic information. 327type ContainerGroupDiagnostics struct { 328 // LogAnalytics - Container group log analytics information. 329 LogAnalytics *LogAnalytics `json:"logAnalytics,omitempty"` 330} 331 332// ContainerGroupListResult the container group list response that contains the container group properties. 333type ContainerGroupListResult struct { 334 autorest.Response `json:"-"` 335 // Value - The list of container groups. 336 Value *[]ContainerGroup `json:"value,omitempty"` 337 // NextLink - The URI to fetch the next page of container groups. 338 NextLink *string `json:"nextLink,omitempty"` 339} 340 341// ContainerGroupListResultIterator provides access to a complete listing of ContainerGroup values. 342type ContainerGroupListResultIterator struct { 343 i int 344 page ContainerGroupListResultPage 345} 346 347// Next advances to the next value. If there was an error making 348// the request the iterator does not advance and the error is returned. 349func (iter *ContainerGroupListResultIterator) Next() error { 350 iter.i++ 351 if iter.i < len(iter.page.Values()) { 352 return nil 353 } 354 err := iter.page.Next() 355 if err != nil { 356 iter.i-- 357 return err 358 } 359 iter.i = 0 360 return nil 361} 362 363// NotDone returns true if the enumeration should be started or is not yet complete. 364func (iter ContainerGroupListResultIterator) NotDone() bool { 365 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 366} 367 368// Response returns the raw server response from the last page request. 369func (iter ContainerGroupListResultIterator) Response() ContainerGroupListResult { 370 return iter.page.Response() 371} 372 373// Value returns the current value or a zero-initialized value if the 374// iterator has advanced beyond the end of the collection. 375func (iter ContainerGroupListResultIterator) Value() ContainerGroup { 376 if !iter.page.NotDone() { 377 return ContainerGroup{} 378 } 379 return iter.page.Values()[iter.i] 380} 381 382// IsEmpty returns true if the ListResult contains no values. 383func (cglr ContainerGroupListResult) IsEmpty() bool { 384 return cglr.Value == nil || len(*cglr.Value) == 0 385} 386 387// containerGroupListResultPreparer prepares a request to retrieve the next set of results. 388// It returns nil if no more results exist. 389func (cglr ContainerGroupListResult) containerGroupListResultPreparer() (*http.Request, error) { 390 if cglr.NextLink == nil || len(to.String(cglr.NextLink)) < 1 { 391 return nil, nil 392 } 393 return autorest.Prepare(&http.Request{}, 394 autorest.AsJSON(), 395 autorest.AsGet(), 396 autorest.WithBaseURL(to.String(cglr.NextLink))) 397} 398 399// ContainerGroupListResultPage contains a page of ContainerGroup values. 400type ContainerGroupListResultPage struct { 401 fn func(ContainerGroupListResult) (ContainerGroupListResult, error) 402 cglr ContainerGroupListResult 403} 404 405// Next advances to the next page of values. If there was an error making 406// the request the page does not advance and the error is returned. 407func (page *ContainerGroupListResultPage) Next() error { 408 next, err := page.fn(page.cglr) 409 if err != nil { 410 return err 411 } 412 page.cglr = next 413 return nil 414} 415 416// NotDone returns true if the page enumeration should be started or is not yet complete. 417func (page ContainerGroupListResultPage) NotDone() bool { 418 return !page.cglr.IsEmpty() 419} 420 421// Response returns the raw server response from the last page request. 422func (page ContainerGroupListResultPage) Response() ContainerGroupListResult { 423 return page.cglr 424} 425 426// Values returns the slice of values for the current page or nil if there are no values. 427func (page ContainerGroupListResultPage) Values() []ContainerGroup { 428 if page.cglr.IsEmpty() { 429 return nil 430 } 431 return *page.cglr.Value 432} 433 434// ContainerGroupProperties ... 435type ContainerGroupProperties struct { 436 // ProvisioningState - The provisioning state of the container group. This only appears in the response. 437 ProvisioningState *string `json:"provisioningState,omitempty"` 438 // Containers - The containers within the container group. 439 Containers *[]Container `json:"containers,omitempty"` 440 // ImageRegistryCredentials - The image registry credentials by which the container group is created from. 441 ImageRegistryCredentials *[]ImageRegistryCredential `json:"imageRegistryCredentials,omitempty"` 442 // RestartPolicy - Restart policy for all containers within the container group. 443 // - `Always` Always restart 444 // - `OnFailure` Restart on failure 445 // - `Never` Never restart 446 // . Possible values include: 'Always', 'OnFailure', 'Never' 447 RestartPolicy ContainerGroupRestartPolicy `json:"restartPolicy,omitempty"` 448 // IPAddress - The IP address type of the container group. 449 IPAddress *IPAddress `json:"ipAddress,omitempty"` 450 // OsType - The operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux' 451 OsType OperatingSystemTypes `json:"osType,omitempty"` 452 // Volumes - The list of volumes that can be mounted by containers in this container group. 453 Volumes *[]Volume `json:"volumes,omitempty"` 454 // InstanceView - The instance view of the container group. Only valid in response. 455 InstanceView *ContainerGroupPropertiesInstanceView `json:"instanceView,omitempty"` 456 // Diagnostics - The diagnostic information for a container group. 457 Diagnostics *ContainerGroupDiagnostics `json:"diagnostics,omitempty"` 458} 459 460// ContainerGroupPropertiesInstanceView the instance view of the container group. Only valid in response. 461type ContainerGroupPropertiesInstanceView struct { 462 // Events - The events of this container group. 463 Events *[]Event `json:"events,omitempty"` 464 // State - The state of the container group. Only valid in response. 465 State *string `json:"state,omitempty"` 466} 467 468// ContainerGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 469// operation. 470type ContainerGroupsCreateOrUpdateFuture struct { 471 azure.Future 472} 473 474// Result returns the result of the asynchronous operation. 475// If the operation has not completed it will return an error. 476func (future *ContainerGroupsCreateOrUpdateFuture) Result(client ContainerGroupsClient) (cg ContainerGroup, err error) { 477 var done bool 478 done, err = future.Done(client) 479 if err != nil { 480 err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 481 return 482 } 483 if !done { 484 err = azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsCreateOrUpdateFuture") 485 return 486 } 487 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 488 if cg.Response.Response, err = future.GetResult(sender); err == nil && cg.Response.Response.StatusCode != http.StatusNoContent { 489 cg, err = client.CreateOrUpdateResponder(cg.Response.Response) 490 if err != nil { 491 err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsCreateOrUpdateFuture", "Result", cg.Response.Response, "Failure responding to request") 492 } 493 } 494 return 495} 496 497// ContainerGroupsRestartFuture an abstraction for monitoring and retrieving the results of a long-running 498// operation. 499type ContainerGroupsRestartFuture struct { 500 azure.Future 501} 502 503// Result returns the result of the asynchronous operation. 504// If the operation has not completed it will return an error. 505func (future *ContainerGroupsRestartFuture) Result(client ContainerGroupsClient) (ar autorest.Response, err error) { 506 var done bool 507 done, err = future.Done(client) 508 if err != nil { 509 err = autorest.NewErrorWithError(err, "containerinstance.ContainerGroupsRestartFuture", "Result", future.Response(), "Polling failure") 510 return 511 } 512 if !done { 513 err = azure.NewAsyncOpIncompleteError("containerinstance.ContainerGroupsRestartFuture") 514 return 515 } 516 ar.Response = future.Response() 517 return 518} 519 520// ContainerHTTPGet the container Http Get settings, for liveness or readiness probe 521type ContainerHTTPGet struct { 522 // Path - The path to probe. 523 Path *string `json:"path,omitempty"` 524 // Port - The port number to probe. 525 Port *int32 `json:"port,omitempty"` 526 // Scheme - The scheme. Possible values include: 'HTTP', 'HTTPS' 527 Scheme Scheme `json:"scheme,omitempty"` 528} 529 530// ContainerPort the port exposed on the container instance. 531type ContainerPort struct { 532 // Protocol - The protocol associated with the port. Possible values include: 'ContainerNetworkProtocolTCP', 'ContainerNetworkProtocolUDP' 533 Protocol ContainerNetworkProtocol `json:"protocol,omitempty"` 534 // Port - The port number exposed within the container group. 535 Port *int32 `json:"port,omitempty"` 536} 537 538// ContainerProbe the container probe, for liveness or readiness 539type ContainerProbe struct { 540 // Exec - The execution command to probe 541 Exec *ContainerExec `json:"exec,omitempty"` 542 // HTTPGet - The Http Get settings to probe 543 HTTPGet *ContainerHTTPGet `json:"httpGet,omitempty"` 544 // InitialDelaySeconds - The initial delay seconds. 545 InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` 546 // PeriodSeconds - The period seconds. 547 PeriodSeconds *int32 `json:"periodSeconds,omitempty"` 548 // FailureThreshold - The failure threshold. 549 FailureThreshold *int32 `json:"failureThreshold,omitempty"` 550 // SuccessThreshold - The success threshold. 551 SuccessThreshold *int32 `json:"successThreshold,omitempty"` 552 // TimeoutSeconds - The timeout seconds. 553 TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` 554} 555 556// ContainerProperties the container instance properties. 557type ContainerProperties struct { 558 // Image - The name of the image used to create the container instance. 559 Image *string `json:"image,omitempty"` 560 // Command - The commands to execute within the container instance in exec form. 561 Command *[]string `json:"command,omitempty"` 562 // Ports - The exposed ports on the container instance. 563 Ports *[]ContainerPort `json:"ports,omitempty"` 564 // EnvironmentVariables - The environment variables to set in the container instance. 565 EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"` 566 // InstanceView - The instance view of the container instance. Only valid in response. 567 InstanceView *ContainerPropertiesInstanceView `json:"instanceView,omitempty"` 568 // Resources - The resource requirements of the container instance. 569 Resources *ResourceRequirements `json:"resources,omitempty"` 570 // VolumeMounts - The volume mounts available to the container instance. 571 VolumeMounts *[]VolumeMount `json:"volumeMounts,omitempty"` 572 // LivenessProbe - The liveness probe. 573 LivenessProbe *ContainerProbe `json:"livenessProbe,omitempty"` 574 // ReadinessProbe - The readiness probe. 575 ReadinessProbe *ContainerProbe `json:"readinessProbe,omitempty"` 576} 577 578// ContainerPropertiesInstanceView the instance view of the container instance. Only valid in response. 579type ContainerPropertiesInstanceView struct { 580 // RestartCount - The number of times that the container instance has been restarted. 581 RestartCount *int32 `json:"restartCount,omitempty"` 582 // CurrentState - Current container instance state. 583 CurrentState *ContainerState `json:"currentState,omitempty"` 584 // PreviousState - Previous container instance state. 585 PreviousState *ContainerState `json:"previousState,omitempty"` 586 // Events - The events of the container instance. 587 Events *[]Event `json:"events,omitempty"` 588} 589 590// ContainerState the container instance state. 591type ContainerState struct { 592 // State - The state of the container instance. 593 State *string `json:"state,omitempty"` 594 // StartTime - The date-time when the container instance state started. 595 StartTime *date.Time `json:"startTime,omitempty"` 596 // ExitCode - The container instance exit codes correspond to those from the `docker run` command. 597 ExitCode *int32 `json:"exitCode,omitempty"` 598 // FinishTime - The date-time when the container instance state finished. 599 FinishTime *date.Time `json:"finishTime,omitempty"` 600 // DetailStatus - The human-readable status of the container instance state. 601 DetailStatus *string `json:"detailStatus,omitempty"` 602} 603 604// EnvironmentVariable the environment variable to set within the container instance. 605type EnvironmentVariable struct { 606 // Name - The name of the environment variable. 607 Name *string `json:"name,omitempty"` 608 // Value - The value of the environment variable. 609 Value *string `json:"value,omitempty"` 610 // SecureValue - The value of the secure environment variable. 611 SecureValue *string `json:"secureValue,omitempty"` 612} 613 614// Event a container group or container instance event. 615type Event struct { 616 // Count - The count of the event. 617 Count *int32 `json:"count,omitempty"` 618 // FirstTimestamp - The date-time of the earliest logged event. 619 FirstTimestamp *date.Time `json:"firstTimestamp,omitempty"` 620 // LastTimestamp - The date-time of the latest logged event. 621 LastTimestamp *date.Time `json:"lastTimestamp,omitempty"` 622 // Name - The event name. 623 Name *string `json:"name,omitempty"` 624 // Message - The event message. 625 Message *string `json:"message,omitempty"` 626 // Type - The event type. 627 Type *string `json:"type,omitempty"` 628} 629 630// GitRepoVolume represents a volume that is populated with the contents of a git repository 631type GitRepoVolume struct { 632 // Directory - Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. 633 Directory *string `json:"directory,omitempty"` 634 // Repository - Repository URL 635 Repository *string `json:"repository,omitempty"` 636 // Revision - Commit hash for the specified revision. 637 Revision *string `json:"revision,omitempty"` 638} 639 640// ImageRegistryCredential image registry credential. 641type ImageRegistryCredential struct { 642 // Server - The Docker image registry server without a protocol such as "http" and "https". 643 Server *string `json:"server,omitempty"` 644 // Username - The username for the private registry. 645 Username *string `json:"username,omitempty"` 646 // Password - The password for the private registry. 647 Password *string `json:"password,omitempty"` 648} 649 650// IPAddress IP address for the container group. 651type IPAddress struct { 652 // Ports - The list of ports exposed on the container group. 653 Ports *[]Port `json:"ports,omitempty"` 654 // Type - Specifies if the IP is exposed to the public internet. 655 Type *string `json:"type,omitempty"` 656 // IP - The IP exposed to the public internet. 657 IP *string `json:"ip,omitempty"` 658 // DNSNameLabel - The Dns name label for the IP. 659 DNSNameLabel *string `json:"dnsNameLabel,omitempty"` 660 // Fqdn - The FQDN for the IP. 661 Fqdn *string `json:"fqdn,omitempty"` 662} 663 664// LogAnalytics container group log analytics information. 665type LogAnalytics struct { 666 // WorkspaceID - The workspace id for log analytics 667 WorkspaceID *string `json:"workspaceId,omitempty"` 668 // WorkspaceKey - The workspace key for log analytics 669 WorkspaceKey *string `json:"workspaceKey,omitempty"` 670} 671 672// Logs the logs. 673type Logs struct { 674 autorest.Response `json:"-"` 675 // Content - The content of the log. 676 Content *string `json:"content,omitempty"` 677} 678 679// Operation an operation for Azure Container Instance service. 680type Operation struct { 681 // Name - The name of the operation. 682 Name *string `json:"name,omitempty"` 683 // Display - The display information of the operation. 684 Display *OperationDisplay `json:"display,omitempty"` 685 // Origin - The intended executor of the operation. Possible values include: 'User', 'System' 686 Origin OperationsOrigin `json:"origin,omitempty"` 687} 688 689// OperationDisplay the display information of the operation. 690type OperationDisplay struct { 691 // Provider - The name of the provider of the operation. 692 Provider *string `json:"provider,omitempty"` 693 // Resource - The name of the resource type of the operation. 694 Resource *string `json:"resource,omitempty"` 695 // Operation - The friendly name of the operation. 696 Operation *string `json:"operation,omitempty"` 697 // Description - The description of the operation. 698 Description *string `json:"description,omitempty"` 699} 700 701// OperationListResult the operation list response that contains all operations for Azure Container Instance 702// service. 703type OperationListResult struct { 704 autorest.Response `json:"-"` 705 // Value - The list of operations. 706 Value *[]Operation `json:"value,omitempty"` 707 // NextLink - The URI to fetch the next page of operations. 708 NextLink *string `json:"nextLink,omitempty"` 709} 710 711// Port the port exposed on the container group. 712type Port struct { 713 // Protocol - The protocol associated with the port. Possible values include: 'TCP', 'UDP' 714 Protocol ContainerGroupNetworkProtocol `json:"protocol,omitempty"` 715 // Port - The port number. 716 Port *int32 `json:"port,omitempty"` 717} 718 719// Resource the Resource model definition. 720type Resource struct { 721 // ID - The resource id. 722 ID *string `json:"id,omitempty"` 723 // Name - The resource name. 724 Name *string `json:"name,omitempty"` 725 // Type - The resource type. 726 Type *string `json:"type,omitempty"` 727 // Location - The resource location. 728 Location *string `json:"location,omitempty"` 729 // Tags - The resource tags. 730 Tags map[string]*string `json:"tags"` 731} 732 733// MarshalJSON is the custom marshaler for Resource. 734func (r Resource) MarshalJSON() ([]byte, error) { 735 objectMap := make(map[string]interface{}) 736 if r.ID != nil { 737 objectMap["id"] = r.ID 738 } 739 if r.Name != nil { 740 objectMap["name"] = r.Name 741 } 742 if r.Type != nil { 743 objectMap["type"] = r.Type 744 } 745 if r.Location != nil { 746 objectMap["location"] = r.Location 747 } 748 if r.Tags != nil { 749 objectMap["tags"] = r.Tags 750 } 751 return json.Marshal(objectMap) 752} 753 754// ResourceLimits the resource limits. 755type ResourceLimits struct { 756 // MemoryInGB - The memory limit in GB of this container instance. 757 MemoryInGB *float64 `json:"memoryInGB,omitempty"` 758 // CPU - The CPU limit of this container instance. 759 CPU *float64 `json:"cpu,omitempty"` 760} 761 762// ResourceRequests the resource requests. 763type ResourceRequests struct { 764 // MemoryInGB - The memory request in GB of this container instance. 765 MemoryInGB *float64 `json:"memoryInGB,omitempty"` 766 // CPU - The CPU request of this container instance. 767 CPU *float64 `json:"cpu,omitempty"` 768} 769 770// ResourceRequirements the resource requirements. 771type ResourceRequirements struct { 772 // Requests - The resource requests of this container instance. 773 Requests *ResourceRequests `json:"requests,omitempty"` 774 // Limits - The resource limits of this container instance. 775 Limits *ResourceLimits `json:"limits,omitempty"` 776} 777 778// Usage a single usage result 779type Usage struct { 780 // Unit - Unit of the usage result 781 Unit *string `json:"unit,omitempty"` 782 // CurrentValue - The current usage of the resource 783 CurrentValue *int32 `json:"currentValue,omitempty"` 784 // Limit - The maximum permitted usage of the resource. 785 Limit *int32 `json:"limit,omitempty"` 786 // Name - The name object of the resource 787 Name *UsageName `json:"name,omitempty"` 788} 789 790// UsageListResult the response containing the usage data 791type UsageListResult struct { 792 autorest.Response `json:"-"` 793 Value *[]Usage `json:"value,omitempty"` 794} 795 796// UsageName the name object of the resource 797type UsageName struct { 798 // Value - The name of the resource 799 Value *string `json:"value,omitempty"` 800 // LocalizedValue - The localized name of the resource 801 LocalizedValue *string `json:"localizedValue,omitempty"` 802} 803 804// Volume the properties of the volume. 805type Volume struct { 806 // Name - The name of the volume. 807 Name *string `json:"name,omitempty"` 808 // AzureFile - The Azure File volume. 809 AzureFile *AzureFileVolume `json:"azureFile,omitempty"` 810 // EmptyDir - The empty directory volume. 811 EmptyDir interface{} `json:"emptyDir,omitempty"` 812 // Secret - The secret volume. 813 Secret map[string]*string `json:"secret"` 814 // GitRepo - The git repo volume. 815 GitRepo *GitRepoVolume `json:"gitRepo,omitempty"` 816} 817 818// MarshalJSON is the custom marshaler for Volume. 819func (vVar Volume) MarshalJSON() ([]byte, error) { 820 objectMap := make(map[string]interface{}) 821 if vVar.Name != nil { 822 objectMap["name"] = vVar.Name 823 } 824 if vVar.AzureFile != nil { 825 objectMap["azureFile"] = vVar.AzureFile 826 } 827 objectMap["emptyDir"] = vVar.EmptyDir 828 if vVar.Secret != nil { 829 objectMap["secret"] = vVar.Secret 830 } 831 if vVar.GitRepo != nil { 832 objectMap["gitRepo"] = vVar.GitRepo 833 } 834 return json.Marshal(objectMap) 835} 836 837// VolumeMount the properties of the volume mount. 838type VolumeMount struct { 839 // Name - The name of the volume mount. 840 Name *string `json:"name,omitempty"` 841 // MountPath - The path within the container where the volume should be mounted. Must not contain colon (:). 842 MountPath *string `json:"mountPath,omitempty"` 843 // ReadOnly - The flag indicating whether the volume mount is read-only. 844 ReadOnly *bool `json:"readOnly,omitempty"` 845} 846