1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888
|
package compute
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2017-08-01-preview/compute"
// AcsClusterProperties information about the container service backing the cluster
type AcsClusterProperties struct {
// ClusterFqdn - READ-ONLY; The FQDN of the cluster.
ClusterFqdn *string `json:"clusterFqdn,omitempty"`
// OrchestratorType - Type of orchestrator. It cannot be changed once the cluster is created. Possible values include: 'Kubernetes', 'None'
OrchestratorType OrchestratorType `json:"orchestratorType,omitempty"`
// OrchestratorProperties - Orchestrator specific properties
OrchestratorProperties *KubernetesClusterProperties `json:"orchestratorProperties,omitempty"`
// SystemServices - The system services deployed to the cluster
SystemServices *[]SystemService `json:"systemServices,omitempty"`
// MasterCount - The number of master nodes in the container service.
MasterCount *int32 `json:"masterCount,omitempty"`
// AgentCount - The number of agent nodes in the Container Service. This can be changed to scale the cluster.
AgentCount *int32 `json:"agentCount,omitempty"`
// AgentVMSize - The Azure VM size of the agent VM nodes. This cannot be changed once the cluster is created. This list is non exhaustive; refer to https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes for the possible VM sizes. Possible values include: 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5'
AgentVMSize AgentVMSizeTypes `json:"agentVmSize,omitempty"`
}
// MarshalJSON is the custom marshaler for AcsClusterProperties.
func (acp AcsClusterProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if acp.OrchestratorType != "" {
objectMap["orchestratorType"] = acp.OrchestratorType
}
if acp.OrchestratorProperties != nil {
objectMap["orchestratorProperties"] = acp.OrchestratorProperties
}
if acp.SystemServices != nil {
objectMap["systemServices"] = acp.SystemServices
}
if acp.MasterCount != nil {
objectMap["masterCount"] = acp.MasterCount
}
if acp.AgentCount != nil {
objectMap["agentCount"] = acp.AgentCount
}
if acp.AgentVMSize != "" {
objectMap["agentVmSize"] = acp.AgentVMSize
}
return json.Marshal(objectMap)
}
// AppInsightsCredentials appInsights credentials.
type AppInsightsCredentials struct {
// AppID - The AppInsights application ID.
AppID *string `json:"appId,omitempty"`
// InstrumentationKey - The AppInsights instrumentation key. This is not returned in response of GET/PUT on the resource. To see this please call listKeys API.
InstrumentationKey *string `json:"instrumentationKey,omitempty"`
}
// AppInsightsProperties properties of App Insights.
type AppInsightsProperties struct {
// ResourceID - ARM resource ID of the App Insights.
ResourceID *string `json:"resourceId,omitempty"`
}
// AutoScaleConfiguration autoScale configuration properties.
type AutoScaleConfiguration struct {
// Status - If auto-scale is enabled for all services. Each service can turn it off individually. Possible values include: 'Enabled', 'Disabled'
Status Status `json:"status,omitempty"`
// MinReplicas - The minimum number of replicas for each service.
MinReplicas *int32 `json:"minReplicas,omitempty"`
// MaxReplicas - The maximum number of replicas for each service.
MaxReplicas *int32 `json:"maxReplicas,omitempty"`
// TargetUtilization - The target utilization.
TargetUtilization *float64 `json:"targetUtilization,omitempty"`
// RefreshPeriodInSeconds - Refresh period in seconds.
RefreshPeriodInSeconds *int32 `json:"refreshPeriodInSeconds,omitempty"`
}
// AvailableOperations available operation list.
type AvailableOperations struct {
autorest.Response `json:"-"`
// Value - An array of available operations.
Value *[]ResourceOperation `json:"value,omitempty"`
}
// CheckSystemServicesUpdatesAvailableResponse information about updates available for system services in a
// cluster.
type CheckSystemServicesUpdatesAvailableResponse struct {
autorest.Response `json:"-"`
// UpdatesAvailable - READ-ONLY; Yes if updates are available for the system services, No if not. Possible values include: 'Yes', 'No'
UpdatesAvailable UpdatesAvailable `json:"updatesAvailable,omitempty"`
}
// MarshalJSON is the custom marshaler for CheckSystemServicesUpdatesAvailableResponse.
func (cssuar CheckSystemServicesUpdatesAvailableResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ContainerRegistryCredentials information about the Azure Container Registry which contains the images
// deployed to the cluster.
type ContainerRegistryCredentials struct {
// LoginServer - READ-ONLY; The ACR login server name. User name is the first part of the FQDN.
LoginServer *string `json:"loginServer,omitempty"`
// Password - READ-ONLY; The ACR primary password.
Password *string `json:"password,omitempty"`
// Password2 - READ-ONLY; The ACR secondary password.
Password2 *string `json:"password2,omitempty"`
// Username - READ-ONLY; The ACR login username.
Username *string `json:"username,omitempty"`
}
// MarshalJSON is the custom marshaler for ContainerRegistryCredentials.
func (crc ContainerRegistryCredentials) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ContainerRegistryProperties properties of Azure Container Registry.
type ContainerRegistryProperties struct {
// ResourceID - ARM resource ID of the Azure Container Registry used to store Docker images for web services in the cluster. If not provided one will be created. This cannot be changed once the cluster is created.
ResourceID *string `json:"resourceId,omitempty"`
}
// ContainerServiceCredentials information about the Azure Container Registry which contains the images
// deployed to the cluster.
type ContainerServiceCredentials struct {
// AcsKubeConfig - READ-ONLY; The ACS kube config file.
AcsKubeConfig *string `json:"acsKubeConfig,omitempty"`
// ServicePrincipalConfiguration - READ-ONLY; Service principal configuration used by Kubernetes.
ServicePrincipalConfiguration *ServicePrincipalProperties `json:"servicePrincipalConfiguration,omitempty"`
// ImagePullSecretName - READ-ONLY; The ACR image pull secret name which was created in Kubernetes.
ImagePullSecretName *string `json:"imagePullSecretName,omitempty"`
}
// MarshalJSON is the custom marshaler for ContainerServiceCredentials.
func (csc ContainerServiceCredentials) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// ErrorDetail error detail information.
type ErrorDetail struct {
// Code - Error code.
Code *string `json:"code,omitempty"`
// Message - Error message.
Message *string `json:"message,omitempty"`
}
// ErrorResponse error response information.
type ErrorResponse struct {
// Code - Error code.
Code *string `json:"code,omitempty"`
// Message - Error message.
Message *string `json:"message,omitempty"`
// Details - An array of error detail objects.
Details *[]ErrorDetail `json:"details,omitempty"`
}
// ErrorResponseWrapper wrapper for error response to follow ARM guidelines.
type ErrorResponseWrapper struct {
// Error - The error response.
Error *ErrorResponse `json:"error,omitempty"`
}
// GlobalServiceConfiguration global configuration for services in the cluster.
type GlobalServiceConfiguration struct {
// AdditionalProperties - Unmatched properties from the message are deserialized this collection
AdditionalProperties map[string]interface{} `json:""`
// Etag - The configuration ETag for updates.
Etag *string `json:"etag,omitempty"`
// Ssl - The SSL configuration properties
Ssl *SslConfiguration `json:"ssl,omitempty"`
// ServiceAuth - Optional global authorization keys for all user services deployed in cluster. These are used if the service does not have auth keys.
ServiceAuth *ServiceAuthConfiguration `json:"serviceAuth,omitempty"`
// AutoScale - The auto-scale configuration
AutoScale *AutoScaleConfiguration `json:"autoScale,omitempty"`
}
// MarshalJSON is the custom marshaler for GlobalServiceConfiguration.
func (gsc GlobalServiceConfiguration) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if gsc.Etag != nil {
objectMap["etag"] = gsc.Etag
}
if gsc.Ssl != nil {
objectMap["ssl"] = gsc.Ssl
}
if gsc.ServiceAuth != nil {
objectMap["serviceAuth"] = gsc.ServiceAuth
}
if gsc.AutoScale != nil {
objectMap["autoScale"] = gsc.AutoScale
}
for k, v := range gsc.AdditionalProperties {
objectMap[k] = v
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for GlobalServiceConfiguration struct.
func (gsc *GlobalServiceConfiguration) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
default:
if v != nil {
var additionalProperties interface{}
err = json.Unmarshal(*v, &additionalProperties)
if err != nil {
return err
}
if gsc.AdditionalProperties == nil {
gsc.AdditionalProperties = make(map[string]interface{})
}
gsc.AdditionalProperties[k] = additionalProperties
}
case "etag":
if v != nil {
var etag string
err = json.Unmarshal(*v, &etag)
if err != nil {
return err
}
gsc.Etag = &etag
}
case "ssl":
if v != nil {
var ssl SslConfiguration
err = json.Unmarshal(*v, &ssl)
if err != nil {
return err
}
gsc.Ssl = &ssl
}
case "serviceAuth":
if v != nil {
var serviceAuth ServiceAuthConfiguration
err = json.Unmarshal(*v, &serviceAuth)
if err != nil {
return err
}
gsc.ServiceAuth = &serviceAuth
}
case "autoScale":
if v != nil {
var autoScale AutoScaleConfiguration
err = json.Unmarshal(*v, &autoScale)
if err != nil {
return err
}
gsc.AutoScale = &autoScale
}
}
}
return nil
}
// KubernetesClusterProperties kubernetes cluster specific properties
type KubernetesClusterProperties struct {
// ServicePrincipal - The Azure Service Principal used by Kubernetes
ServicePrincipal *ServicePrincipalProperties `json:"servicePrincipal,omitempty"`
}
// OperationalizationCluster instance of an Azure ML Operationalization Cluster resource.
type OperationalizationCluster struct {
autorest.Response `json:"-"`
// OperationalizationClusterProperties - Properties of an operationalization cluster.
*OperationalizationClusterProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Specifies the resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Specifies the name of the resource.
Name *string `json:"name,omitempty"`
// Location - Specifies the location of the resource.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; Specifies the type of the resource.
Type *string `json:"type,omitempty"`
// Tags - Contains resource tags defined as key/value pairs.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for OperationalizationCluster.
func (oc OperationalizationCluster) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if oc.OperationalizationClusterProperties != nil {
objectMap["properties"] = oc.OperationalizationClusterProperties
}
if oc.Location != nil {
objectMap["location"] = oc.Location
}
if oc.Tags != nil {
objectMap["tags"] = oc.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for OperationalizationCluster struct.
func (oc *OperationalizationCluster) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var operationalizationClusterProperties OperationalizationClusterProperties
err = json.Unmarshal(*v, &operationalizationClusterProperties)
if err != nil {
return err
}
oc.OperationalizationClusterProperties = &operationalizationClusterProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
oc.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
oc.Name = &name
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
oc.Location = &location
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
oc.Type = &typeVar
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
oc.Tags = tags
}
}
}
return nil
}
// OperationalizationClusterCredentials credentials to resources in the cluster.
type OperationalizationClusterCredentials struct {
autorest.Response `json:"-"`
// StorageAccount - Credentials for the Storage Account.
StorageAccount *StorageAccountCredentials `json:"storageAccount,omitempty"`
// ContainerRegistry - Credentials for Azure Container Registry.
ContainerRegistry *ContainerRegistryCredentials `json:"containerRegistry,omitempty"`
// ContainerService - Credentials for Azure Container Service.
ContainerService *ContainerServiceCredentials `json:"containerService,omitempty"`
// AppInsights - Credentials for Azure AppInsights.
AppInsights *AppInsightsCredentials `json:"appInsights,omitempty"`
// ServiceAuthConfiguration - Global authorization keys for all user services deployed in cluster. These are used if the service does not have auth keys.
ServiceAuthConfiguration *ServiceAuthConfiguration `json:"serviceAuthConfiguration,omitempty"`
// SslConfiguration - The SSL configuration for the services.
SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"`
}
// OperationalizationClusterProperties properties of an operationalization cluster
type OperationalizationClusterProperties struct {
// Description - The description of the cluster.
Description *string `json:"description,omitempty"`
// CreatedOn - READ-ONLY; The date and time when the cluster was created.
CreatedOn *date.Time `json:"createdOn,omitempty"`
// ModifiedOn - READ-ONLY; The date and time when the cluster was last modified.
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
ProvisioningState OperationStatus `json:"provisioningState,omitempty"`
// ProvisioningErrors - READ-ONLY; List of provisioning errors reported by the resource provider.
ProvisioningErrors *[]ErrorResponseWrapper `json:"provisioningErrors,omitempty"`
// ClusterType - The cluster type. Possible values include: 'ACS', 'Local'
ClusterType ClusterType `json:"clusterType,omitempty"`
// StorageAccount - Storage Account properties.
StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"`
// ContainerRegistry - Container Registry properties.
ContainerRegistry *ContainerRegistryProperties `json:"containerRegistry,omitempty"`
// ContainerService - Parameters for the Azure Container Service cluster.
ContainerService *AcsClusterProperties `json:"containerService,omitempty"`
// AppInsights - AppInsights configuration.
AppInsights *AppInsightsProperties `json:"appInsights,omitempty"`
// GlobalServiceConfiguration - Contains global configuration for the web services in the cluster.
GlobalServiceConfiguration *GlobalServiceConfiguration `json:"globalServiceConfiguration,omitempty"`
}
// MarshalJSON is the custom marshaler for OperationalizationClusterProperties.
func (ocp OperationalizationClusterProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ocp.Description != nil {
objectMap["description"] = ocp.Description
}
if ocp.ClusterType != "" {
objectMap["clusterType"] = ocp.ClusterType
}
if ocp.StorageAccount != nil {
objectMap["storageAccount"] = ocp.StorageAccount
}
if ocp.ContainerRegistry != nil {
objectMap["containerRegistry"] = ocp.ContainerRegistry
}
if ocp.ContainerService != nil {
objectMap["containerService"] = ocp.ContainerService
}
if ocp.AppInsights != nil {
objectMap["appInsights"] = ocp.AppInsights
}
if ocp.GlobalServiceConfiguration != nil {
objectMap["globalServiceConfiguration"] = ocp.GlobalServiceConfiguration
}
return json.Marshal(objectMap)
}
// OperationalizationClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
// of a long-running operation.
type OperationalizationClustersCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(OperationalizationClustersClient) (OperationalizationCluster, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *OperationalizationClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for OperationalizationClustersCreateOrUpdateFuture.Result.
func (future *OperationalizationClustersCreateOrUpdateFuture) result(client OperationalizationClustersClient) (oc OperationalizationCluster, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
oc.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("compute.OperationalizationClustersCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if oc.Response.Response, err = future.GetResult(sender); err == nil && oc.Response.Response.StatusCode != http.StatusNoContent {
oc, err = client.CreateOrUpdateResponder(oc.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersCreateOrUpdateFuture", "Result", oc.Response.Response, "Failure responding to request")
}
}
return
}
// OperationalizationClustersDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type OperationalizationClustersDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(OperationalizationClustersClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *OperationalizationClustersDeleteFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for OperationalizationClustersDeleteFuture.Result.
func (future *OperationalizationClustersDeleteFuture) result(client OperationalizationClustersClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("compute.OperationalizationClustersDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// OperationalizationClustersUpdateSystemServicesFuture an abstraction for monitoring and retrieving the
// results of a long-running operation.
type OperationalizationClustersUpdateSystemServicesFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(OperationalizationClustersClient) (UpdateSystemServicesResponse, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *OperationalizationClustersUpdateSystemServicesFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for OperationalizationClustersUpdateSystemServicesFuture.Result.
func (future *OperationalizationClustersUpdateSystemServicesFuture) result(client OperationalizationClustersClient) (ussr UpdateSystemServicesResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersUpdateSystemServicesFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ussr.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("compute.OperationalizationClustersUpdateSystemServicesFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ussr.Response.Response, err = future.GetResult(sender); err == nil && ussr.Response.Response.StatusCode != http.StatusNoContent {
ussr, err = client.UpdateSystemServicesResponder(ussr.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.OperationalizationClustersUpdateSystemServicesFuture", "Result", ussr.Response.Response, "Failure responding to request")
}
}
return
}
// OperationalizationClusterUpdateParameters parameters for PATCH operation on an operationalization
// cluster
type OperationalizationClusterUpdateParameters struct {
// Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for OperationalizationClusterUpdateParameters.
func (ocup OperationalizationClusterUpdateParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ocup.Tags != nil {
objectMap["tags"] = ocup.Tags
}
return json.Marshal(objectMap)
}
// PaginatedOperationalizationClustersList paginated list of operationalization clusters.
type PaginatedOperationalizationClustersList struct {
autorest.Response `json:"-"`
// Value - An array of cluster objects.
Value *[]OperationalizationCluster `json:"value,omitempty"`
// NextLink - A continuation link (absolute URI) to the next page of results in the list.
NextLink *string `json:"nextLink,omitempty"`
}
// PaginatedOperationalizationClustersListIterator provides access to a complete listing of
// OperationalizationCluster values.
type PaginatedOperationalizationClustersListIterator struct {
i int
page PaginatedOperationalizationClustersListPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *PaginatedOperationalizationClustersListIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedOperationalizationClustersListIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *PaginatedOperationalizationClustersListIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PaginatedOperationalizationClustersListIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter PaginatedOperationalizationClustersListIterator) Response() PaginatedOperationalizationClustersList {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter PaginatedOperationalizationClustersListIterator) Value() OperationalizationCluster {
if !iter.page.NotDone() {
return OperationalizationCluster{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the PaginatedOperationalizationClustersListIterator type.
func NewPaginatedOperationalizationClustersListIterator(page PaginatedOperationalizationClustersListPage) PaginatedOperationalizationClustersListIterator {
return PaginatedOperationalizationClustersListIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (pocl PaginatedOperationalizationClustersList) IsEmpty() bool {
return pocl.Value == nil || len(*pocl.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (pocl PaginatedOperationalizationClustersList) hasNextLink() bool {
return pocl.NextLink != nil && len(*pocl.NextLink) != 0
}
// paginatedOperationalizationClustersListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (pocl PaginatedOperationalizationClustersList) paginatedOperationalizationClustersListPreparer(ctx context.Context) (*http.Request, error) {
if !pocl.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(pocl.NextLink)))
}
// PaginatedOperationalizationClustersListPage contains a page of OperationalizationCluster values.
type PaginatedOperationalizationClustersListPage struct {
fn func(context.Context, PaginatedOperationalizationClustersList) (PaginatedOperationalizationClustersList, error)
pocl PaginatedOperationalizationClustersList
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *PaginatedOperationalizationClustersListPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedOperationalizationClustersListPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.pocl)
if err != nil {
return err
}
page.pocl = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *PaginatedOperationalizationClustersListPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PaginatedOperationalizationClustersListPage) NotDone() bool {
return !page.pocl.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page PaginatedOperationalizationClustersListPage) Response() PaginatedOperationalizationClustersList {
return page.pocl
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page PaginatedOperationalizationClustersListPage) Values() []OperationalizationCluster {
if page.pocl.IsEmpty() {
return nil
}
return *page.pocl.Value
}
// Creates a new instance of the PaginatedOperationalizationClustersListPage type.
func NewPaginatedOperationalizationClustersListPage(cur PaginatedOperationalizationClustersList, getNextPage func(context.Context, PaginatedOperationalizationClustersList) (PaginatedOperationalizationClustersList, error)) PaginatedOperationalizationClustersListPage {
return PaginatedOperationalizationClustersListPage{
fn: getNextPage,
pocl: cur,
}
}
// Resource azure resource
type Resource struct {
// ID - READ-ONLY; Specifies the resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Specifies the name of the resource.
Name *string `json:"name,omitempty"`
// Location - Specifies the location of the resource.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; Specifies the type of the resource.
Type *string `json:"type,omitempty"`
// Tags - Contains resource tags defined as key/value pairs.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if r.Location != nil {
objectMap["location"] = r.Location
}
if r.Tags != nil {
objectMap["tags"] = r.Tags
}
return json.Marshal(objectMap)
}
// ResourceOperation resource operation.
type ResourceOperation struct {
// Name - Name of this operation.
Name *string `json:"name,omitempty"`
// Display - Display of the operation.
Display *ResourceOperationDisplay `json:"display,omitempty"`
// Origin - The operation origin.
Origin *string `json:"origin,omitempty"`
}
// ResourceOperationDisplay display of the operation.
type ResourceOperationDisplay struct {
// Provider - The resource provider name.
Provider *string `json:"provider,omitempty"`
// Resource - The resource name.
Resource *string `json:"resource,omitempty"`
// Operation - The operation.
Operation *string `json:"operation,omitempty"`
// Description - The description of the operation.
Description *string `json:"description,omitempty"`
}
// ServiceAuthConfiguration global service auth configuration properties. These are the data-plane
// authorization keys and are used if a service doesn't define it's own.
type ServiceAuthConfiguration struct {
// PrimaryAuthKeyHash - The primary auth key hash. This is not returned in response of GET/PUT on the resource.. To see this please call listKeys API.
PrimaryAuthKeyHash *string `json:"primaryAuthKeyHash,omitempty"`
// SecondaryAuthKeyHash - The secondary auth key hash. This is not returned in response of GET/PUT on the resource.. To see this please call listKeys API.
SecondaryAuthKeyHash *string `json:"secondaryAuthKeyHash,omitempty"`
}
// ServicePrincipalProperties the Azure service principal used by Kubernetes for configuring load balancers
type ServicePrincipalProperties struct {
// ClientID - The service principal client ID
ClientID *string `json:"clientId,omitempty"`
// Secret - The service principal secret. This is not returned in response of GET/PUT on the resource. To see this please call listKeys.
Secret *string `json:"secret,omitempty"`
}
// SslConfiguration SSL configuration. If configured data-plane calls to user services will be exposed over
// SSL only.
type SslConfiguration struct {
// Status - SSL status. Allowed values are Enabled and Disabled. Possible values include: 'Enabled', 'Disabled'
Status Status `json:"status,omitempty"`
// Cert - The SSL cert data in PEM format.
Cert *string `json:"cert,omitempty"`
// Key - The SSL key data in PEM format. This is not returned in response of GET/PUT on the resource. To see this please call listKeys API.
Key *string `json:"key,omitempty"`
// Cname - The CName of the certificate.
Cname *string `json:"cname,omitempty"`
}
// StorageAccountCredentials access information for the storage account.
type StorageAccountCredentials struct {
// ResourceID - READ-ONLY; The ARM resource ID of the storage account.
ResourceID *string `json:"resourceId,omitempty"`
// PrimaryKey - READ-ONLY; The primary key of the storage account.
PrimaryKey *string `json:"primaryKey,omitempty"`
// SecondaryKey - READ-ONLY; The secondary key of the storage account.
SecondaryKey *string `json:"secondaryKey,omitempty"`
}
// MarshalJSON is the custom marshaler for StorageAccountCredentials.
func (sac StorageAccountCredentials) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// StorageAccountProperties properties of Storage Account.
type StorageAccountProperties struct {
// ResourceID - ARM resource ID of the Azure Storage Account to store CLI specific files. If not provided one will be created. This cannot be changed once the cluster is created.
ResourceID *string `json:"resourceId,omitempty"`
}
// SystemService information about a system service deployed in the cluster
type SystemService struct {
// SystemServiceType - The system service type. Possible values include: 'SystemServiceTypeNone', 'SystemServiceTypeScoringFrontEnd', 'SystemServiceTypeBatchFrontEnd'
SystemServiceType SystemServiceType `json:"systemServiceType,omitempty"`
// PublicIPAddress - READ-ONLY; The public IP address of the system service
PublicIPAddress *string `json:"publicIpAddress,omitempty"`
// Version - READ-ONLY; The state of the system service
Version *string `json:"version,omitempty"`
}
// MarshalJSON is the custom marshaler for SystemService.
func (ss SystemService) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ss.SystemServiceType != "" {
objectMap["systemServiceType"] = ss.SystemServiceType
}
return json.Marshal(objectMap)
}
// UpdateSystemServicesResponse response of the update system services API
type UpdateSystemServicesResponse struct {
autorest.Response `json:"-"`
// UpdateStatus - READ-ONLY; Update status. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
UpdateStatus OperationStatus `json:"updateStatus,omitempty"`
// UpdateStartedOn - READ-ONLY; The date and time when the last system services update was started.
UpdateStartedOn *date.Time `json:"updateStartedOn,omitempty"`
// UpdateCompletedOn - READ-ONLY; The date and time when the last system services update completed.
UpdateCompletedOn *date.Time `json:"updateCompletedOn,omitempty"`
}
// MarshalJSON is the custom marshaler for UpdateSystemServicesResponse.
func (ussr UpdateSystemServicesResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
|