...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2017-08-01-preview/compute/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2017-08-01-preview/compute

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

View as plain text