1package machinelearningservices 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 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2018-11-19/machinelearningservices" 33 34// AllocationState enumerates the values for allocation state. 35type AllocationState string 36 37const ( 38 // Resizing ... 39 Resizing AllocationState = "Resizing" 40 // Steady ... 41 Steady AllocationState = "Steady" 42) 43 44// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. 45func PossibleAllocationStateValues() []AllocationState { 46 return []AllocationState{Resizing, Steady} 47} 48 49// ComputeType enumerates the values for compute type. 50type ComputeType string 51 52const ( 53 // ComputeTypeAKS ... 54 ComputeTypeAKS ComputeType = "AKS" 55 // ComputeTypeAmlCompute ... 56 ComputeTypeAmlCompute ComputeType = "AmlCompute" 57 // ComputeTypeDatabricks ... 58 ComputeTypeDatabricks ComputeType = "Databricks" 59 // ComputeTypeDataFactory ... 60 ComputeTypeDataFactory ComputeType = "DataFactory" 61 // ComputeTypeDataLakeAnalytics ... 62 ComputeTypeDataLakeAnalytics ComputeType = "DataLakeAnalytics" 63 // ComputeTypeHDInsight ... 64 ComputeTypeHDInsight ComputeType = "HDInsight" 65 // ComputeTypeVirtualMachine ... 66 ComputeTypeVirtualMachine ComputeType = "VirtualMachine" 67) 68 69// PossibleComputeTypeValues returns an array of possible values for the ComputeType const type. 70func PossibleComputeTypeValues() []ComputeType { 71 return []ComputeType{ComputeTypeAKS, ComputeTypeAmlCompute, ComputeTypeDatabricks, ComputeTypeDataFactory, ComputeTypeDataLakeAnalytics, ComputeTypeHDInsight, ComputeTypeVirtualMachine} 72} 73 74// ComputeTypeBasicCompute enumerates the values for compute type basic compute. 75type ComputeTypeBasicCompute string 76 77const ( 78 // ComputeTypeAKS1 ... 79 ComputeTypeAKS1 ComputeTypeBasicCompute = "AKS" 80 // ComputeTypeAmlCompute1 ... 81 ComputeTypeAmlCompute1 ComputeTypeBasicCompute = "AmlCompute" 82 // ComputeTypeCompute ... 83 ComputeTypeCompute ComputeTypeBasicCompute = "Compute" 84 // ComputeTypeDatabricks1 ... 85 ComputeTypeDatabricks1 ComputeTypeBasicCompute = "Databricks" 86 // ComputeTypeDataFactory1 ... 87 ComputeTypeDataFactory1 ComputeTypeBasicCompute = "DataFactory" 88 // ComputeTypeDataLakeAnalytics1 ... 89 ComputeTypeDataLakeAnalytics1 ComputeTypeBasicCompute = "DataLakeAnalytics" 90 // ComputeTypeHDInsight1 ... 91 ComputeTypeHDInsight1 ComputeTypeBasicCompute = "HDInsight" 92 // ComputeTypeVirtualMachine1 ... 93 ComputeTypeVirtualMachine1 ComputeTypeBasicCompute = "VirtualMachine" 94) 95 96// PossibleComputeTypeBasicComputeValues returns an array of possible values for the ComputeTypeBasicCompute const type. 97func PossibleComputeTypeBasicComputeValues() []ComputeTypeBasicCompute { 98 return []ComputeTypeBasicCompute{ComputeTypeAKS1, ComputeTypeAmlCompute1, ComputeTypeCompute, ComputeTypeDatabricks1, ComputeTypeDataFactory1, ComputeTypeDataLakeAnalytics1, ComputeTypeHDInsight1, ComputeTypeVirtualMachine1} 99} 100 101// ComputeTypeBasicComputeNodesInformation enumerates the values for compute type basic compute nodes 102// information. 103type ComputeTypeBasicComputeNodesInformation string 104 105const ( 106 // ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute ... 107 ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute ComputeTypeBasicComputeNodesInformation = "AmlCompute" 108 // ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation ... 109 ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation ComputeTypeBasicComputeNodesInformation = "ComputeNodesInformation" 110) 111 112// PossibleComputeTypeBasicComputeNodesInformationValues returns an array of possible values for the ComputeTypeBasicComputeNodesInformation const type. 113func PossibleComputeTypeBasicComputeNodesInformationValues() []ComputeTypeBasicComputeNodesInformation { 114 return []ComputeTypeBasicComputeNodesInformation{ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute, ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation} 115} 116 117// ComputeTypeBasicComputeSecrets enumerates the values for compute type basic compute secrets. 118type ComputeTypeBasicComputeSecrets string 119 120const ( 121 // ComputeTypeBasicComputeSecretsComputeTypeAKS ... 122 ComputeTypeBasicComputeSecretsComputeTypeAKS ComputeTypeBasicComputeSecrets = "AKS" 123 // ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ... 124 ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ComputeTypeBasicComputeSecrets = "ComputeSecrets" 125 // ComputeTypeBasicComputeSecretsComputeTypeDatabricks ... 126 ComputeTypeBasicComputeSecretsComputeTypeDatabricks ComputeTypeBasicComputeSecrets = "Databricks" 127 // ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ... 128 ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ComputeTypeBasicComputeSecrets = "VirtualMachine" 129) 130 131// PossibleComputeTypeBasicComputeSecretsValues returns an array of possible values for the ComputeTypeBasicComputeSecrets const type. 132func PossibleComputeTypeBasicComputeSecretsValues() []ComputeTypeBasicComputeSecrets { 133 return []ComputeTypeBasicComputeSecrets{ComputeTypeBasicComputeSecretsComputeTypeAKS, ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets, ComputeTypeBasicComputeSecretsComputeTypeDatabricks, ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine} 134} 135 136// ProvisioningState enumerates the values for provisioning state. 137type ProvisioningState string 138 139const ( 140 // Canceled ... 141 Canceled ProvisioningState = "Canceled" 142 // Creating ... 143 Creating ProvisioningState = "Creating" 144 // Deleting ... 145 Deleting ProvisioningState = "Deleting" 146 // Failed ... 147 Failed ProvisioningState = "Failed" 148 // Succeeded ... 149 Succeeded ProvisioningState = "Succeeded" 150 // Unknown ... 151 Unknown ProvisioningState = "Unknown" 152 // Updating ... 153 Updating ProvisioningState = "Updating" 154) 155 156// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. 157func PossibleProvisioningStateValues() []ProvisioningState { 158 return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Unknown, Updating} 159} 160 161// ResourceIdentityType enumerates the values for resource identity type. 162type ResourceIdentityType string 163 164const ( 165 // SystemAssigned ... 166 SystemAssigned ResourceIdentityType = "SystemAssigned" 167) 168 169// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. 170func PossibleResourceIdentityTypeValues() []ResourceIdentityType { 171 return []ResourceIdentityType{SystemAssigned} 172} 173 174// Status enumerates the values for status. 175type Status string 176 177const ( 178 // Disabled ... 179 Disabled Status = "Disabled" 180 // Enabled ... 181 Enabled Status = "Enabled" 182) 183 184// PossibleStatusValues returns an array of possible values for the Status const type. 185func PossibleStatusValues() []Status { 186 return []Status{Disabled, Enabled} 187} 188 189// UnderlyingResourceAction enumerates the values for underlying resource action. 190type UnderlyingResourceAction string 191 192const ( 193 // Delete ... 194 Delete UnderlyingResourceAction = "Delete" 195 // Detach ... 196 Detach UnderlyingResourceAction = "Detach" 197) 198 199// PossibleUnderlyingResourceActionValues returns an array of possible values for the UnderlyingResourceAction const type. 200func PossibleUnderlyingResourceActionValues() []UnderlyingResourceAction { 201 return []UnderlyingResourceAction{Delete, Detach} 202} 203 204// UsageUnit enumerates the values for usage unit. 205type UsageUnit string 206 207const ( 208 // Count ... 209 Count UsageUnit = "Count" 210) 211 212// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. 213func PossibleUsageUnitValues() []UsageUnit { 214 return []UsageUnit{Count} 215} 216 217// VMPriority enumerates the values for vm priority. 218type VMPriority string 219 220const ( 221 // Dedicated ... 222 Dedicated VMPriority = "Dedicated" 223 // LowPriority ... 224 LowPriority VMPriority = "LowPriority" 225) 226 227// PossibleVMPriorityValues returns an array of possible values for the VMPriority const type. 228func PossibleVMPriorityValues() []VMPriority { 229 return []VMPriority{Dedicated, LowPriority} 230} 231 232// AKS a Machine Learning compute based on AKS. 233type AKS struct { 234 // Properties - AKS properties 235 Properties *AKSProperties `json:"properties,omitempty"` 236 // ComputeLocation - Location for the underlying compute 237 ComputeLocation *string `json:"computeLocation,omitempty"` 238 // 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' 239 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 240 // Description - The description of the Machine Learning compute. 241 Description *string `json:"description,omitempty"` 242 // CreatedOn - READ-ONLY; The date and time when the compute was created. 243 CreatedOn *date.Time `json:"createdOn,omitempty"` 244 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 245 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 246 // ResourceID - ARM resource id of the underlying compute 247 ResourceID *string `json:"resourceId,omitempty"` 248 // ProvisioningErrors - READ-ONLY; Errors during provisioning 249 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 250 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 251 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 252 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 253 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 254} 255 256// MarshalJSON is the custom marshaler for AKS. 257func (a AKS) MarshalJSON() ([]byte, error) { 258 a.ComputeType = ComputeTypeAKS1 259 objectMap := make(map[string]interface{}) 260 if a.Properties != nil { 261 objectMap["properties"] = a.Properties 262 } 263 if a.ComputeLocation != nil { 264 objectMap["computeLocation"] = a.ComputeLocation 265 } 266 if a.Description != nil { 267 objectMap["description"] = a.Description 268 } 269 if a.ResourceID != nil { 270 objectMap["resourceId"] = a.ResourceID 271 } 272 if a.ComputeType != "" { 273 objectMap["computeType"] = a.ComputeType 274 } 275 return json.Marshal(objectMap) 276} 277 278// AsAKS is the BasicCompute implementation for AKS. 279func (a AKS) AsAKS() (*AKS, bool) { 280 return &a, true 281} 282 283// AsAmlCompute is the BasicCompute implementation for AKS. 284func (a AKS) AsAmlCompute() (*AmlCompute, bool) { 285 return nil, false 286} 287 288// AsVirtualMachine is the BasicCompute implementation for AKS. 289func (a AKS) AsVirtualMachine() (*VirtualMachine, bool) { 290 return nil, false 291} 292 293// AsHDInsight is the BasicCompute implementation for AKS. 294func (a AKS) AsHDInsight() (*HDInsight, bool) { 295 return nil, false 296} 297 298// AsDataFactory is the BasicCompute implementation for AKS. 299func (a AKS) AsDataFactory() (*DataFactory, bool) { 300 return nil, false 301} 302 303// AsDatabricks is the BasicCompute implementation for AKS. 304func (a AKS) AsDatabricks() (*Databricks, bool) { 305 return nil, false 306} 307 308// AsDataLakeAnalytics is the BasicCompute implementation for AKS. 309func (a AKS) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 310 return nil, false 311} 312 313// AsCompute is the BasicCompute implementation for AKS. 314func (a AKS) AsCompute() (*Compute, bool) { 315 return nil, false 316} 317 318// AsBasicCompute is the BasicCompute implementation for AKS. 319func (a AKS) AsBasicCompute() (BasicCompute, bool) { 320 return &a, true 321} 322 323// AksComputeSecrets secrets related to a Machine Learning compute based on AKS. 324type AksComputeSecrets struct { 325 // UserKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. 326 UserKubeConfig *string `json:"userKubeConfig,omitempty"` 327 // AdminKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. 328 AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` 329 // ImagePullSecretName - Image registry pull secret. 330 ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` 331 // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' 332 ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` 333} 334 335// MarshalJSON is the custom marshaler for AksComputeSecrets. 336func (acs AksComputeSecrets) MarshalJSON() ([]byte, error) { 337 acs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeAKS 338 objectMap := make(map[string]interface{}) 339 if acs.UserKubeConfig != nil { 340 objectMap["userKubeConfig"] = acs.UserKubeConfig 341 } 342 if acs.AdminKubeConfig != nil { 343 objectMap["adminKubeConfig"] = acs.AdminKubeConfig 344 } 345 if acs.ImagePullSecretName != nil { 346 objectMap["imagePullSecretName"] = acs.ImagePullSecretName 347 } 348 if acs.ComputeType != "" { 349 objectMap["computeType"] = acs.ComputeType 350 } 351 return json.Marshal(objectMap) 352} 353 354// AsAksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 355func (acs AksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { 356 return &acs, true 357} 358 359// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 360func (acs AksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { 361 return nil, false 362} 363 364// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 365func (acs AksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { 366 return nil, false 367} 368 369// AsComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 370func (acs AksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { 371 return nil, false 372} 373 374// AsBasicComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 375func (acs AksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { 376 return &acs, true 377} 378 379// AksNetworkingConfiguration advance configuration for AKS networking 380type AksNetworkingConfiguration struct { 381 // SubnetID - Virtual network subnet resource ID the compute nodes belong to 382 SubnetID *string `json:"subnetId,omitempty"` 383 // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. 384 ServiceCidr *string `json:"serviceCidr,omitempty"` 385 // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. 386 DNSServiceIP *string `json:"dnsServiceIP,omitempty"` 387 // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. 388 DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` 389} 390 391// AKSProperties AKS properties 392type AKSProperties struct { 393 // ClusterFqdn - Cluster full qualified domain name 394 ClusterFqdn *string `json:"clusterFqdn,omitempty"` 395 // SystemServices - READ-ONLY; System services 396 SystemServices *[]SystemService `json:"systemServices,omitempty"` 397 // AgentCount - Number of agents 398 AgentCount *int32 `json:"agentCount,omitempty"` 399 // AgentVMSize - Agent virtual machine size 400 AgentVMSize *string `json:"agentVMSize,omitempty"` 401 // SslConfiguration - SSL configuration 402 SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` 403 // AksNetworkingConfiguration - AKS networking configuration for vnet 404 AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` 405} 406 407// AmlCompute an Azure Machine Learning compute. 408type AmlCompute struct { 409 // Properties - AML Compute properties 410 Properties *AmlComputeProperties `json:"properties,omitempty"` 411 // ComputeLocation - Location for the underlying compute 412 ComputeLocation *string `json:"computeLocation,omitempty"` 413 // 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' 414 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 415 // Description - The description of the Machine Learning compute. 416 Description *string `json:"description,omitempty"` 417 // CreatedOn - READ-ONLY; The date and time when the compute was created. 418 CreatedOn *date.Time `json:"createdOn,omitempty"` 419 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 420 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 421 // ResourceID - ARM resource id of the underlying compute 422 ResourceID *string `json:"resourceId,omitempty"` 423 // ProvisioningErrors - READ-ONLY; Errors during provisioning 424 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 425 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 426 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 427 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 428 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 429} 430 431// MarshalJSON is the custom marshaler for AmlCompute. 432func (ac AmlCompute) MarshalJSON() ([]byte, error) { 433 ac.ComputeType = ComputeTypeAmlCompute1 434 objectMap := make(map[string]interface{}) 435 if ac.Properties != nil { 436 objectMap["properties"] = ac.Properties 437 } 438 if ac.ComputeLocation != nil { 439 objectMap["computeLocation"] = ac.ComputeLocation 440 } 441 if ac.Description != nil { 442 objectMap["description"] = ac.Description 443 } 444 if ac.ResourceID != nil { 445 objectMap["resourceId"] = ac.ResourceID 446 } 447 if ac.ComputeType != "" { 448 objectMap["computeType"] = ac.ComputeType 449 } 450 return json.Marshal(objectMap) 451} 452 453// AsAKS is the BasicCompute implementation for AmlCompute. 454func (ac AmlCompute) AsAKS() (*AKS, bool) { 455 return nil, false 456} 457 458// AsAmlCompute is the BasicCompute implementation for AmlCompute. 459func (ac AmlCompute) AsAmlCompute() (*AmlCompute, bool) { 460 return &ac, true 461} 462 463// AsVirtualMachine is the BasicCompute implementation for AmlCompute. 464func (ac AmlCompute) AsVirtualMachine() (*VirtualMachine, bool) { 465 return nil, false 466} 467 468// AsHDInsight is the BasicCompute implementation for AmlCompute. 469func (ac AmlCompute) AsHDInsight() (*HDInsight, bool) { 470 return nil, false 471} 472 473// AsDataFactory is the BasicCompute implementation for AmlCompute. 474func (ac AmlCompute) AsDataFactory() (*DataFactory, bool) { 475 return nil, false 476} 477 478// AsDatabricks is the BasicCompute implementation for AmlCompute. 479func (ac AmlCompute) AsDatabricks() (*Databricks, bool) { 480 return nil, false 481} 482 483// AsDataLakeAnalytics is the BasicCompute implementation for AmlCompute. 484func (ac AmlCompute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 485 return nil, false 486} 487 488// AsCompute is the BasicCompute implementation for AmlCompute. 489func (ac AmlCompute) AsCompute() (*Compute, bool) { 490 return nil, false 491} 492 493// AsBasicCompute is the BasicCompute implementation for AmlCompute. 494func (ac AmlCompute) AsBasicCompute() (BasicCompute, bool) { 495 return &ac, true 496} 497 498// AmlComputeNodeInformation compute node information related to a AmlCompute. 499type AmlComputeNodeInformation struct { 500 // NodeID - READ-ONLY; ID of the compute node. 501 NodeID *string `json:"nodeId,omitempty"` 502 // IPAddress - READ-ONLY; Public IP address of the compute node. 503 IPAddress *string `json:"ipAddress,omitempty"` 504 // Port - READ-ONLY; SSH port number of the node. 505 Port *float64 `json:"port,omitempty"` 506} 507 508// AmlComputeNodesInformation compute node information related to a AmlCompute. 509type AmlComputeNodesInformation struct { 510 autorest.Response `json:"-"` 511 // Nodes - READ-ONLY; The collection of returned AmlCompute nodes details. 512 Nodes *[]AmlComputeNodeInformation `json:"nodes,omitempty"` 513 // NextLink - READ-ONLY; The continuation token. 514 NextLink *string `json:"nextLink,omitempty"` 515 // ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute' 516 ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"` 517} 518 519// MarshalJSON is the custom marshaler for AmlComputeNodesInformation. 520func (acni AmlComputeNodesInformation) MarshalJSON() ([]byte, error) { 521 acni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute 522 objectMap := make(map[string]interface{}) 523 if acni.ComputeType != "" { 524 objectMap["computeType"] = acni.ComputeType 525 } 526 return json.Marshal(objectMap) 527} 528 529// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. 530func (acni AmlComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) { 531 return &acni, true 532} 533 534// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. 535func (acni AmlComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) { 536 return nil, false 537} 538 539// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. 540func (acni AmlComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) { 541 return &acni, true 542} 543 544// AmlComputeNodesInformationIterator provides access to a complete listing of AmlComputeNodeInformation 545// values. 546type AmlComputeNodesInformationIterator struct { 547 i int 548 page AmlComputeNodesInformationPage 549} 550 551// NextWithContext advances to the next value. If there was an error making 552// the request the iterator does not advance and the error is returned. 553func (iter *AmlComputeNodesInformationIterator) NextWithContext(ctx context.Context) (err error) { 554 if tracing.IsEnabled() { 555 ctx = tracing.StartSpan(ctx, fqdn+"/AmlComputeNodesInformationIterator.NextWithContext") 556 defer func() { 557 sc := -1 558 if iter.Response().Response.Response != nil { 559 sc = iter.Response().Response.Response.StatusCode 560 } 561 tracing.EndSpan(ctx, sc, err) 562 }() 563 } 564 iter.i++ 565 if iter.i < len(iter.page.Values()) { 566 return nil 567 } 568 err = iter.page.NextWithContext(ctx) 569 if err != nil { 570 iter.i-- 571 return err 572 } 573 iter.i = 0 574 return nil 575} 576 577// Next advances to the next value. If there was an error making 578// the request the iterator does not advance and the error is returned. 579// Deprecated: Use NextWithContext() instead. 580func (iter *AmlComputeNodesInformationIterator) Next() error { 581 return iter.NextWithContext(context.Background()) 582} 583 584// NotDone returns true if the enumeration should be started or is not yet complete. 585func (iter AmlComputeNodesInformationIterator) NotDone() bool { 586 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 587} 588 589// Response returns the raw server response from the last page request. 590func (iter AmlComputeNodesInformationIterator) Response() AmlComputeNodesInformation { 591 return iter.page.Response() 592} 593 594// Value returns the current value or a zero-initialized value if the 595// iterator has advanced beyond the end of the collection. 596func (iter AmlComputeNodesInformationIterator) Value() AmlComputeNodeInformation { 597 if !iter.page.NotDone() { 598 return AmlComputeNodeInformation{} 599 } 600 return iter.page.Values()[iter.i] 601} 602 603// Creates a new instance of the AmlComputeNodesInformationIterator type. 604func NewAmlComputeNodesInformationIterator(page AmlComputeNodesInformationPage) AmlComputeNodesInformationIterator { 605 return AmlComputeNodesInformationIterator{page: page} 606} 607 608// IsEmpty returns true if the ListResult contains no values. 609func (acni AmlComputeNodesInformation) IsEmpty() bool { 610 return acni.Nodes == nil || len(*acni.Nodes) == 0 611} 612 613// amlComputeNodesInformationPreparer prepares a request to retrieve the next set of results. 614// It returns nil if no more results exist. 615func (acni AmlComputeNodesInformation) amlComputeNodesInformationPreparer(ctx context.Context) (*http.Request, error) { 616 if acni.NextLink == nil || len(to.String(acni.NextLink)) < 1 { 617 return nil, nil 618 } 619 return autorest.Prepare((&http.Request{}).WithContext(ctx), 620 autorest.AsJSON(), 621 autorest.AsGet(), 622 autorest.WithBaseURL(to.String(acni.NextLink))) 623} 624 625// AmlComputeNodesInformationPage contains a page of AmlComputeNodeInformation values. 626type AmlComputeNodesInformationPage struct { 627 fn func(context.Context, AmlComputeNodesInformation) (AmlComputeNodesInformation, error) 628 acni AmlComputeNodesInformation 629} 630 631// NextWithContext advances to the next page of values. If there was an error making 632// the request the page does not advance and the error is returned. 633func (page *AmlComputeNodesInformationPage) NextWithContext(ctx context.Context) (err error) { 634 if tracing.IsEnabled() { 635 ctx = tracing.StartSpan(ctx, fqdn+"/AmlComputeNodesInformationPage.NextWithContext") 636 defer func() { 637 sc := -1 638 if page.Response().Response.Response != nil { 639 sc = page.Response().Response.Response.StatusCode 640 } 641 tracing.EndSpan(ctx, sc, err) 642 }() 643 } 644 next, err := page.fn(ctx, page.acni) 645 if err != nil { 646 return err 647 } 648 page.acni = next 649 return nil 650} 651 652// Next advances to the next page of values. If there was an error making 653// the request the page does not advance and the error is returned. 654// Deprecated: Use NextWithContext() instead. 655func (page *AmlComputeNodesInformationPage) Next() error { 656 return page.NextWithContext(context.Background()) 657} 658 659// NotDone returns true if the page enumeration should be started or is not yet complete. 660func (page AmlComputeNodesInformationPage) NotDone() bool { 661 return !page.acni.IsEmpty() 662} 663 664// Response returns the raw server response from the last page request. 665func (page AmlComputeNodesInformationPage) Response() AmlComputeNodesInformation { 666 return page.acni 667} 668 669// Values returns the slice of values for the current page or nil if there are no values. 670func (page AmlComputeNodesInformationPage) Values() []AmlComputeNodeInformation { 671 if page.acni.IsEmpty() { 672 return nil 673 } 674 return *page.acni.Nodes 675} 676 677// Creates a new instance of the AmlComputeNodesInformationPage type. 678func NewAmlComputeNodesInformationPage(getNextPage func(context.Context, AmlComputeNodesInformation) (AmlComputeNodesInformation, error)) AmlComputeNodesInformationPage { 679 return AmlComputeNodesInformationPage{fn: getNextPage} 680} 681 682// AmlComputeProperties AML Compute properties 683type AmlComputeProperties struct { 684 // VMSize - Virtual Machine Size 685 VMSize *string `json:"vmSize,omitempty"` 686 // VMPriority - Virtual Machine priority. Possible values include: 'Dedicated', 'LowPriority' 687 VMPriority VMPriority `json:"vmPriority,omitempty"` 688 // ScaleSettings - Scale settings for AML Compute 689 ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` 690 // UserAccountCredentials - Credentials for an administrator user account that will be created on each compute node. 691 UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` 692 // Subnet - Virtual network subnet resource ID the compute nodes belong to. 693 Subnet *ResourceID `json:"subnet,omitempty"` 694 // AllocationState - READ-ONLY; Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. Possible values include: 'Steady', 'Resizing' 695 AllocationState AllocationState `json:"allocationState,omitempty"` 696 // AllocationStateTransitionTime - READ-ONLY; The time at which the compute entered its current allocation state. 697 AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` 698 // Errors - READ-ONLY; Collection of errors encountered by various compute nodes during node setup. 699 Errors *[]Error `json:"errors,omitempty"` 700 // CurrentNodeCount - READ-ONLY; The number of compute nodes currently assigned to the compute. 701 CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"` 702 // TargetNodeCount - READ-ONLY; The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation. 703 TargetNodeCount *int32 `json:"targetNodeCount,omitempty"` 704 // NodeStateCounts - READ-ONLY; Counts of various node states on the compute. 705 NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"` 706} 707 708// ClusterUpdateParameters amlCompute update parameters. 709type ClusterUpdateParameters struct { 710 // ClusterUpdateProperties - The properties of the amlCompute. 711 *ClusterUpdateProperties `json:"properties,omitempty"` 712} 713 714// MarshalJSON is the custom marshaler for ClusterUpdateParameters. 715func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) { 716 objectMap := make(map[string]interface{}) 717 if cup.ClusterUpdateProperties != nil { 718 objectMap["properties"] = cup.ClusterUpdateProperties 719 } 720 return json.Marshal(objectMap) 721} 722 723// UnmarshalJSON is the custom unmarshaler for ClusterUpdateParameters struct. 724func (cup *ClusterUpdateParameters) UnmarshalJSON(body []byte) error { 725 var m map[string]*json.RawMessage 726 err := json.Unmarshal(body, &m) 727 if err != nil { 728 return err 729 } 730 for k, v := range m { 731 switch k { 732 case "properties": 733 if v != nil { 734 var clusterUpdateProperties ClusterUpdateProperties 735 err = json.Unmarshal(*v, &clusterUpdateProperties) 736 if err != nil { 737 return err 738 } 739 cup.ClusterUpdateProperties = &clusterUpdateProperties 740 } 741 } 742 } 743 744 return nil 745} 746 747// ClusterUpdateProperties the properties of a amlCompute that need to be updated. 748type ClusterUpdateProperties struct { 749 // ScaleSettings - Desired scale settings for the amlCompute. 750 ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` 751} 752 753// BasicCompute machine Learning compute object. 754type BasicCompute interface { 755 AsAKS() (*AKS, bool) 756 AsAmlCompute() (*AmlCompute, bool) 757 AsVirtualMachine() (*VirtualMachine, bool) 758 AsHDInsight() (*HDInsight, bool) 759 AsDataFactory() (*DataFactory, bool) 760 AsDatabricks() (*Databricks, bool) 761 AsDataLakeAnalytics() (*DataLakeAnalytics, bool) 762 AsCompute() (*Compute, bool) 763} 764 765// Compute machine Learning compute object. 766type Compute struct { 767 // ComputeLocation - Location for the underlying compute 768 ComputeLocation *string `json:"computeLocation,omitempty"` 769 // 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' 770 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 771 // Description - The description of the Machine Learning compute. 772 Description *string `json:"description,omitempty"` 773 // CreatedOn - READ-ONLY; The date and time when the compute was created. 774 CreatedOn *date.Time `json:"createdOn,omitempty"` 775 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 776 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 777 // ResourceID - ARM resource id of the underlying compute 778 ResourceID *string `json:"resourceId,omitempty"` 779 // ProvisioningErrors - READ-ONLY; Errors during provisioning 780 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 781 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 782 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 783 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 784 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 785} 786 787func unmarshalBasicCompute(body []byte) (BasicCompute, error) { 788 var m map[string]interface{} 789 err := json.Unmarshal(body, &m) 790 if err != nil { 791 return nil, err 792 } 793 794 switch m["computeType"] { 795 case string(ComputeTypeAKS1): 796 var a AKS 797 err := json.Unmarshal(body, &a) 798 return a, err 799 case string(ComputeTypeAmlCompute1): 800 var ac AmlCompute 801 err := json.Unmarshal(body, &ac) 802 return ac, err 803 case string(ComputeTypeVirtualMachine1): 804 var VM VirtualMachine 805 err := json.Unmarshal(body, &VM) 806 return VM, err 807 case string(ComputeTypeHDInsight1): 808 var hi HDInsight 809 err := json.Unmarshal(body, &hi) 810 return hi, err 811 case string(ComputeTypeDataFactory1): 812 var df DataFactory 813 err := json.Unmarshal(body, &df) 814 return df, err 815 case string(ComputeTypeDatabricks1): 816 var d Databricks 817 err := json.Unmarshal(body, &d) 818 return d, err 819 case string(ComputeTypeDataLakeAnalytics1): 820 var dla DataLakeAnalytics 821 err := json.Unmarshal(body, &dla) 822 return dla, err 823 default: 824 var c Compute 825 err := json.Unmarshal(body, &c) 826 return c, err 827 } 828} 829func unmarshalBasicComputeArray(body []byte) ([]BasicCompute, error) { 830 var rawMessages []*json.RawMessage 831 err := json.Unmarshal(body, &rawMessages) 832 if err != nil { 833 return nil, err 834 } 835 836 cArray := make([]BasicCompute, len(rawMessages)) 837 838 for index, rawMessage := range rawMessages { 839 c, err := unmarshalBasicCompute(*rawMessage) 840 if err != nil { 841 return nil, err 842 } 843 cArray[index] = c 844 } 845 return cArray, nil 846} 847 848// MarshalJSON is the custom marshaler for Compute. 849func (c Compute) MarshalJSON() ([]byte, error) { 850 c.ComputeType = ComputeTypeCompute 851 objectMap := make(map[string]interface{}) 852 if c.ComputeLocation != nil { 853 objectMap["computeLocation"] = c.ComputeLocation 854 } 855 if c.Description != nil { 856 objectMap["description"] = c.Description 857 } 858 if c.ResourceID != nil { 859 objectMap["resourceId"] = c.ResourceID 860 } 861 if c.ComputeType != "" { 862 objectMap["computeType"] = c.ComputeType 863 } 864 return json.Marshal(objectMap) 865} 866 867// AsAKS is the BasicCompute implementation for Compute. 868func (c Compute) AsAKS() (*AKS, bool) { 869 return nil, false 870} 871 872// AsAmlCompute is the BasicCompute implementation for Compute. 873func (c Compute) AsAmlCompute() (*AmlCompute, bool) { 874 return nil, false 875} 876 877// AsVirtualMachine is the BasicCompute implementation for Compute. 878func (c Compute) AsVirtualMachine() (*VirtualMachine, bool) { 879 return nil, false 880} 881 882// AsHDInsight is the BasicCompute implementation for Compute. 883func (c Compute) AsHDInsight() (*HDInsight, bool) { 884 return nil, false 885} 886 887// AsDataFactory is the BasicCompute implementation for Compute. 888func (c Compute) AsDataFactory() (*DataFactory, bool) { 889 return nil, false 890} 891 892// AsDatabricks is the BasicCompute implementation for Compute. 893func (c Compute) AsDatabricks() (*Databricks, bool) { 894 return nil, false 895} 896 897// AsDataLakeAnalytics is the BasicCompute implementation for Compute. 898func (c Compute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 899 return nil, false 900} 901 902// AsCompute is the BasicCompute implementation for Compute. 903func (c Compute) AsCompute() (*Compute, bool) { 904 return &c, true 905} 906 907// AsBasicCompute is the BasicCompute implementation for Compute. 908func (c Compute) AsBasicCompute() (BasicCompute, bool) { 909 return &c, true 910} 911 912// BasicComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for every 913// type of compute. 914type BasicComputeNodesInformation interface { 915 AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) 916 AsComputeNodesInformation() (*ComputeNodesInformation, bool) 917} 918 919// ComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for 920// every type of compute. 921type ComputeNodesInformation struct { 922 // NextLink - READ-ONLY; The continuation token. 923 NextLink *string `json:"nextLink,omitempty"` 924 // ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute' 925 ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"` 926} 927 928func unmarshalBasicComputeNodesInformation(body []byte) (BasicComputeNodesInformation, error) { 929 var m map[string]interface{} 930 err := json.Unmarshal(body, &m) 931 if err != nil { 932 return nil, err 933 } 934 935 switch m["computeType"] { 936 case string(ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute): 937 var acni AmlComputeNodesInformation 938 err := json.Unmarshal(body, &acni) 939 return acni, err 940 default: 941 var cni ComputeNodesInformation 942 err := json.Unmarshal(body, &cni) 943 return cni, err 944 } 945} 946func unmarshalBasicComputeNodesInformationArray(body []byte) ([]BasicComputeNodesInformation, error) { 947 var rawMessages []*json.RawMessage 948 err := json.Unmarshal(body, &rawMessages) 949 if err != nil { 950 return nil, err 951 } 952 953 cniArray := make([]BasicComputeNodesInformation, len(rawMessages)) 954 955 for index, rawMessage := range rawMessages { 956 cni, err := unmarshalBasicComputeNodesInformation(*rawMessage) 957 if err != nil { 958 return nil, err 959 } 960 cniArray[index] = cni 961 } 962 return cniArray, nil 963} 964 965// MarshalJSON is the custom marshaler for ComputeNodesInformation. 966func (cni ComputeNodesInformation) MarshalJSON() ([]byte, error) { 967 cni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation 968 objectMap := make(map[string]interface{}) 969 if cni.ComputeType != "" { 970 objectMap["computeType"] = cni.ComputeType 971 } 972 return json.Marshal(objectMap) 973} 974 975// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. 976func (cni ComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) { 977 return nil, false 978} 979 980// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. 981func (cni ComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) { 982 return &cni, true 983} 984 985// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. 986func (cni ComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) { 987 return &cni, true 988} 989 990// ComputeResource machine Learning compute object wrapped into ARM resource envelope. 991type ComputeResource struct { 992 autorest.Response `json:"-"` 993 // Properties - Compute properties 994 Properties BasicCompute `json:"properties,omitempty"` 995 // ID - READ-ONLY; Specifies the resource ID. 996 ID *string `json:"id,omitempty"` 997 // Name - READ-ONLY; Specifies the name of the resource. 998 Name *string `json:"name,omitempty"` 999 // Identity - READ-ONLY; The identity of the resource. 1000 Identity *Identity `json:"identity,omitempty"` 1001 // Location - Specifies the location of the resource. 1002 Location *string `json:"location,omitempty"` 1003 // Type - READ-ONLY; Specifies the type of the resource. 1004 Type *string `json:"type,omitempty"` 1005 // Tags - Contains resource tags defined as key/value pairs. 1006 Tags map[string]*string `json:"tags"` 1007} 1008 1009// MarshalJSON is the custom marshaler for ComputeResource. 1010func (cr ComputeResource) MarshalJSON() ([]byte, error) { 1011 objectMap := make(map[string]interface{}) 1012 objectMap["properties"] = cr.Properties 1013 if cr.Location != nil { 1014 objectMap["location"] = cr.Location 1015 } 1016 if cr.Tags != nil { 1017 objectMap["tags"] = cr.Tags 1018 } 1019 return json.Marshal(objectMap) 1020} 1021 1022// UnmarshalJSON is the custom unmarshaler for ComputeResource struct. 1023func (cr *ComputeResource) UnmarshalJSON(body []byte) error { 1024 var m map[string]*json.RawMessage 1025 err := json.Unmarshal(body, &m) 1026 if err != nil { 1027 return err 1028 } 1029 for k, v := range m { 1030 switch k { 1031 case "properties": 1032 if v != nil { 1033 properties, err := unmarshalBasicCompute(*v) 1034 if err != nil { 1035 return err 1036 } 1037 cr.Properties = properties 1038 } 1039 case "id": 1040 if v != nil { 1041 var ID string 1042 err = json.Unmarshal(*v, &ID) 1043 if err != nil { 1044 return err 1045 } 1046 cr.ID = &ID 1047 } 1048 case "name": 1049 if v != nil { 1050 var name string 1051 err = json.Unmarshal(*v, &name) 1052 if err != nil { 1053 return err 1054 } 1055 cr.Name = &name 1056 } 1057 case "identity": 1058 if v != nil { 1059 var identity Identity 1060 err = json.Unmarshal(*v, &identity) 1061 if err != nil { 1062 return err 1063 } 1064 cr.Identity = &identity 1065 } 1066 case "location": 1067 if v != nil { 1068 var location string 1069 err = json.Unmarshal(*v, &location) 1070 if err != nil { 1071 return err 1072 } 1073 cr.Location = &location 1074 } 1075 case "type": 1076 if v != nil { 1077 var typeVar string 1078 err = json.Unmarshal(*v, &typeVar) 1079 if err != nil { 1080 return err 1081 } 1082 cr.Type = &typeVar 1083 } 1084 case "tags": 1085 if v != nil { 1086 var tags map[string]*string 1087 err = json.Unmarshal(*v, &tags) 1088 if err != nil { 1089 return err 1090 } 1091 cr.Tags = tags 1092 } 1093 } 1094 } 1095 1096 return nil 1097} 1098 1099// BasicComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. 1100type BasicComputeSecrets interface { 1101 AsAksComputeSecrets() (*AksComputeSecrets, bool) 1102 AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) 1103 AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) 1104 AsComputeSecrets() (*ComputeSecrets, bool) 1105} 1106 1107// ComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. 1108type ComputeSecrets struct { 1109 autorest.Response `json:"-"` 1110 // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' 1111 ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` 1112} 1113 1114func unmarshalBasicComputeSecrets(body []byte) (BasicComputeSecrets, error) { 1115 var m map[string]interface{} 1116 err := json.Unmarshal(body, &m) 1117 if err != nil { 1118 return nil, err 1119 } 1120 1121 switch m["computeType"] { 1122 case string(ComputeTypeBasicComputeSecretsComputeTypeAKS): 1123 var acs AksComputeSecrets 1124 err := json.Unmarshal(body, &acs) 1125 return acs, err 1126 case string(ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine): 1127 var vms VirtualMachineSecrets 1128 err := json.Unmarshal(body, &vms) 1129 return vms, err 1130 case string(ComputeTypeBasicComputeSecretsComputeTypeDatabricks): 1131 var dcs DatabricksComputeSecrets 1132 err := json.Unmarshal(body, &dcs) 1133 return dcs, err 1134 default: 1135 var cs ComputeSecrets 1136 err := json.Unmarshal(body, &cs) 1137 return cs, err 1138 } 1139} 1140func unmarshalBasicComputeSecretsArray(body []byte) ([]BasicComputeSecrets, error) { 1141 var rawMessages []*json.RawMessage 1142 err := json.Unmarshal(body, &rawMessages) 1143 if err != nil { 1144 return nil, err 1145 } 1146 1147 csArray := make([]BasicComputeSecrets, len(rawMessages)) 1148 1149 for index, rawMessage := range rawMessages { 1150 cs, err := unmarshalBasicComputeSecrets(*rawMessage) 1151 if err != nil { 1152 return nil, err 1153 } 1154 csArray[index] = cs 1155 } 1156 return csArray, nil 1157} 1158 1159// MarshalJSON is the custom marshaler for ComputeSecrets. 1160func (cs ComputeSecrets) MarshalJSON() ([]byte, error) { 1161 cs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets 1162 objectMap := make(map[string]interface{}) 1163 if cs.ComputeType != "" { 1164 objectMap["computeType"] = cs.ComputeType 1165 } 1166 return json.Marshal(objectMap) 1167} 1168 1169// AsAksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 1170func (cs ComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { 1171 return nil, false 1172} 1173 1174// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 1175func (cs ComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { 1176 return nil, false 1177} 1178 1179// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 1180func (cs ComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { 1181 return nil, false 1182} 1183 1184// AsComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 1185func (cs ComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { 1186 return &cs, true 1187} 1188 1189// AsBasicComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 1190func (cs ComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { 1191 return &cs, true 1192} 1193 1194// ComputeSecretsModel ... 1195type ComputeSecretsModel struct { 1196 autorest.Response `json:"-"` 1197 Value BasicComputeSecrets `json:"value,omitempty"` 1198} 1199 1200// UnmarshalJSON is the custom unmarshaler for ComputeSecretsModel struct. 1201func (csm *ComputeSecretsModel) UnmarshalJSON(body []byte) error { 1202 cs, err := unmarshalBasicComputeSecrets(body) 1203 if err != nil { 1204 return err 1205 } 1206 csm.Value = cs 1207 1208 return nil 1209} 1210 1211// Databricks a DataFactory compute. 1212type Databricks struct { 1213 Properties *DatabricksProperties `json:"properties,omitempty"` 1214 // ComputeLocation - Location for the underlying compute 1215 ComputeLocation *string `json:"computeLocation,omitempty"` 1216 // 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' 1217 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1218 // Description - The description of the Machine Learning compute. 1219 Description *string `json:"description,omitempty"` 1220 // CreatedOn - READ-ONLY; The date and time when the compute was created. 1221 CreatedOn *date.Time `json:"createdOn,omitempty"` 1222 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 1223 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 1224 // ResourceID - ARM resource id of the underlying compute 1225 ResourceID *string `json:"resourceId,omitempty"` 1226 // ProvisioningErrors - READ-ONLY; Errors during provisioning 1227 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 1228 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 1229 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 1230 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 1231 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 1232} 1233 1234// MarshalJSON is the custom marshaler for Databricks. 1235func (d Databricks) MarshalJSON() ([]byte, error) { 1236 d.ComputeType = ComputeTypeDatabricks1 1237 objectMap := make(map[string]interface{}) 1238 if d.Properties != nil { 1239 objectMap["properties"] = d.Properties 1240 } 1241 if d.ComputeLocation != nil { 1242 objectMap["computeLocation"] = d.ComputeLocation 1243 } 1244 if d.Description != nil { 1245 objectMap["description"] = d.Description 1246 } 1247 if d.ResourceID != nil { 1248 objectMap["resourceId"] = d.ResourceID 1249 } 1250 if d.ComputeType != "" { 1251 objectMap["computeType"] = d.ComputeType 1252 } 1253 return json.Marshal(objectMap) 1254} 1255 1256// AsAKS is the BasicCompute implementation for Databricks. 1257func (d Databricks) AsAKS() (*AKS, bool) { 1258 return nil, false 1259} 1260 1261// AsAmlCompute is the BasicCompute implementation for Databricks. 1262func (d Databricks) AsAmlCompute() (*AmlCompute, bool) { 1263 return nil, false 1264} 1265 1266// AsVirtualMachine is the BasicCompute implementation for Databricks. 1267func (d Databricks) AsVirtualMachine() (*VirtualMachine, bool) { 1268 return nil, false 1269} 1270 1271// AsHDInsight is the BasicCompute implementation for Databricks. 1272func (d Databricks) AsHDInsight() (*HDInsight, bool) { 1273 return nil, false 1274} 1275 1276// AsDataFactory is the BasicCompute implementation for Databricks. 1277func (d Databricks) AsDataFactory() (*DataFactory, bool) { 1278 return nil, false 1279} 1280 1281// AsDatabricks is the BasicCompute implementation for Databricks. 1282func (d Databricks) AsDatabricks() (*Databricks, bool) { 1283 return &d, true 1284} 1285 1286// AsDataLakeAnalytics is the BasicCompute implementation for Databricks. 1287func (d Databricks) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 1288 return nil, false 1289} 1290 1291// AsCompute is the BasicCompute implementation for Databricks. 1292func (d Databricks) AsCompute() (*Compute, bool) { 1293 return nil, false 1294} 1295 1296// AsBasicCompute is the BasicCompute implementation for Databricks. 1297func (d Databricks) AsBasicCompute() (BasicCompute, bool) { 1298 return &d, true 1299} 1300 1301// DatabricksComputeSecrets secrets related to a Machine Learning compute based on Databricks. 1302type DatabricksComputeSecrets struct { 1303 // DatabricksAccessToken - access token for databricks account. 1304 DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` 1305 // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' 1306 ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` 1307} 1308 1309// MarshalJSON is the custom marshaler for DatabricksComputeSecrets. 1310func (dcs DatabricksComputeSecrets) MarshalJSON() ([]byte, error) { 1311 dcs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeDatabricks 1312 objectMap := make(map[string]interface{}) 1313 if dcs.DatabricksAccessToken != nil { 1314 objectMap["databricksAccessToken"] = dcs.DatabricksAccessToken 1315 } 1316 if dcs.ComputeType != "" { 1317 objectMap["computeType"] = dcs.ComputeType 1318 } 1319 return json.Marshal(objectMap) 1320} 1321 1322// AsAksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. 1323func (dcs DatabricksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { 1324 return nil, false 1325} 1326 1327// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. 1328func (dcs DatabricksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { 1329 return nil, false 1330} 1331 1332// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. 1333func (dcs DatabricksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { 1334 return &dcs, true 1335} 1336 1337// AsComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. 1338func (dcs DatabricksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { 1339 return nil, false 1340} 1341 1342// AsBasicComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. 1343func (dcs DatabricksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { 1344 return &dcs, true 1345} 1346 1347// DatabricksProperties ... 1348type DatabricksProperties struct { 1349 // DatabricksAccessToken - Databricks access token 1350 DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` 1351} 1352 1353// DataFactory a DataFactory compute. 1354type DataFactory struct { 1355 // ComputeLocation - Location for the underlying compute 1356 ComputeLocation *string `json:"computeLocation,omitempty"` 1357 // 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' 1358 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1359 // Description - The description of the Machine Learning compute. 1360 Description *string `json:"description,omitempty"` 1361 // CreatedOn - READ-ONLY; The date and time when the compute was created. 1362 CreatedOn *date.Time `json:"createdOn,omitempty"` 1363 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 1364 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 1365 // ResourceID - ARM resource id of the underlying compute 1366 ResourceID *string `json:"resourceId,omitempty"` 1367 // ProvisioningErrors - READ-ONLY; Errors during provisioning 1368 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 1369 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 1370 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 1371 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 1372 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 1373} 1374 1375// MarshalJSON is the custom marshaler for DataFactory. 1376func (df DataFactory) MarshalJSON() ([]byte, error) { 1377 df.ComputeType = ComputeTypeDataFactory1 1378 objectMap := make(map[string]interface{}) 1379 if df.ComputeLocation != nil { 1380 objectMap["computeLocation"] = df.ComputeLocation 1381 } 1382 if df.Description != nil { 1383 objectMap["description"] = df.Description 1384 } 1385 if df.ResourceID != nil { 1386 objectMap["resourceId"] = df.ResourceID 1387 } 1388 if df.ComputeType != "" { 1389 objectMap["computeType"] = df.ComputeType 1390 } 1391 return json.Marshal(objectMap) 1392} 1393 1394// AsAKS is the BasicCompute implementation for DataFactory. 1395func (df DataFactory) AsAKS() (*AKS, bool) { 1396 return nil, false 1397} 1398 1399// AsAmlCompute is the BasicCompute implementation for DataFactory. 1400func (df DataFactory) AsAmlCompute() (*AmlCompute, bool) { 1401 return nil, false 1402} 1403 1404// AsVirtualMachine is the BasicCompute implementation for DataFactory. 1405func (df DataFactory) AsVirtualMachine() (*VirtualMachine, bool) { 1406 return nil, false 1407} 1408 1409// AsHDInsight is the BasicCompute implementation for DataFactory. 1410func (df DataFactory) AsHDInsight() (*HDInsight, bool) { 1411 return nil, false 1412} 1413 1414// AsDataFactory is the BasicCompute implementation for DataFactory. 1415func (df DataFactory) AsDataFactory() (*DataFactory, bool) { 1416 return &df, true 1417} 1418 1419// AsDatabricks is the BasicCompute implementation for DataFactory. 1420func (df DataFactory) AsDatabricks() (*Databricks, bool) { 1421 return nil, false 1422} 1423 1424// AsDataLakeAnalytics is the BasicCompute implementation for DataFactory. 1425func (df DataFactory) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 1426 return nil, false 1427} 1428 1429// AsCompute is the BasicCompute implementation for DataFactory. 1430func (df DataFactory) AsCompute() (*Compute, bool) { 1431 return nil, false 1432} 1433 1434// AsBasicCompute is the BasicCompute implementation for DataFactory. 1435func (df DataFactory) AsBasicCompute() (BasicCompute, bool) { 1436 return &df, true 1437} 1438 1439// DataLakeAnalytics a DataLakeAnalytics compute. 1440type DataLakeAnalytics struct { 1441 Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"` 1442 // ComputeLocation - Location for the underlying compute 1443 ComputeLocation *string `json:"computeLocation,omitempty"` 1444 // 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' 1445 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1446 // Description - The description of the Machine Learning compute. 1447 Description *string `json:"description,omitempty"` 1448 // CreatedOn - READ-ONLY; The date and time when the compute was created. 1449 CreatedOn *date.Time `json:"createdOn,omitempty"` 1450 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 1451 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 1452 // ResourceID - ARM resource id of the underlying compute 1453 ResourceID *string `json:"resourceId,omitempty"` 1454 // ProvisioningErrors - READ-ONLY; Errors during provisioning 1455 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 1456 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 1457 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 1458 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 1459 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 1460} 1461 1462// MarshalJSON is the custom marshaler for DataLakeAnalytics. 1463func (dla DataLakeAnalytics) MarshalJSON() ([]byte, error) { 1464 dla.ComputeType = ComputeTypeDataLakeAnalytics1 1465 objectMap := make(map[string]interface{}) 1466 if dla.Properties != nil { 1467 objectMap["properties"] = dla.Properties 1468 } 1469 if dla.ComputeLocation != nil { 1470 objectMap["computeLocation"] = dla.ComputeLocation 1471 } 1472 if dla.Description != nil { 1473 objectMap["description"] = dla.Description 1474 } 1475 if dla.ResourceID != nil { 1476 objectMap["resourceId"] = dla.ResourceID 1477 } 1478 if dla.ComputeType != "" { 1479 objectMap["computeType"] = dla.ComputeType 1480 } 1481 return json.Marshal(objectMap) 1482} 1483 1484// AsAKS is the BasicCompute implementation for DataLakeAnalytics. 1485func (dla DataLakeAnalytics) AsAKS() (*AKS, bool) { 1486 return nil, false 1487} 1488 1489// AsAmlCompute is the BasicCompute implementation for DataLakeAnalytics. 1490func (dla DataLakeAnalytics) AsAmlCompute() (*AmlCompute, bool) { 1491 return nil, false 1492} 1493 1494// AsVirtualMachine is the BasicCompute implementation for DataLakeAnalytics. 1495func (dla DataLakeAnalytics) AsVirtualMachine() (*VirtualMachine, bool) { 1496 return nil, false 1497} 1498 1499// AsHDInsight is the BasicCompute implementation for DataLakeAnalytics. 1500func (dla DataLakeAnalytics) AsHDInsight() (*HDInsight, bool) { 1501 return nil, false 1502} 1503 1504// AsDataFactory is the BasicCompute implementation for DataLakeAnalytics. 1505func (dla DataLakeAnalytics) AsDataFactory() (*DataFactory, bool) { 1506 return nil, false 1507} 1508 1509// AsDatabricks is the BasicCompute implementation for DataLakeAnalytics. 1510func (dla DataLakeAnalytics) AsDatabricks() (*Databricks, bool) { 1511 return nil, false 1512} 1513 1514// AsDataLakeAnalytics is the BasicCompute implementation for DataLakeAnalytics. 1515func (dla DataLakeAnalytics) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 1516 return &dla, true 1517} 1518 1519// AsCompute is the BasicCompute implementation for DataLakeAnalytics. 1520func (dla DataLakeAnalytics) AsCompute() (*Compute, bool) { 1521 return nil, false 1522} 1523 1524// AsBasicCompute is the BasicCompute implementation for DataLakeAnalytics. 1525func (dla DataLakeAnalytics) AsBasicCompute() (BasicCompute, bool) { 1526 return &dla, true 1527} 1528 1529// DataLakeAnalyticsProperties ... 1530type DataLakeAnalyticsProperties struct { 1531 // DataLakeStoreAccountName - DataLake Store Account Name 1532 DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` 1533} 1534 1535// Error wrapper for error response to follow ARM guidelines. 1536type Error struct { 1537 // Error - READ-ONLY; The error response. 1538 Error *ErrorResponse `json:"error,omitempty"` 1539} 1540 1541// ErrorDetail error detail information. 1542type ErrorDetail struct { 1543 // Code - Error code. 1544 Code *string `json:"code,omitempty"` 1545 // Message - Error message. 1546 Message *string `json:"message,omitempty"` 1547} 1548 1549// ErrorResponse error response information. 1550type ErrorResponse struct { 1551 // Code - READ-ONLY; Error code. 1552 Code *string `json:"code,omitempty"` 1553 // Message - READ-ONLY; Error message. 1554 Message *string `json:"message,omitempty"` 1555 // Details - READ-ONLY; An array of error detail objects. 1556 Details *[]ErrorDetail `json:"details,omitempty"` 1557} 1558 1559// HDInsight a HDInsight compute. 1560type HDInsight struct { 1561 Properties *HDInsightProperties `json:"properties,omitempty"` 1562 // ComputeLocation - Location for the underlying compute 1563 ComputeLocation *string `json:"computeLocation,omitempty"` 1564 // 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' 1565 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1566 // Description - The description of the Machine Learning compute. 1567 Description *string `json:"description,omitempty"` 1568 // CreatedOn - READ-ONLY; The date and time when the compute was created. 1569 CreatedOn *date.Time `json:"createdOn,omitempty"` 1570 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 1571 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 1572 // ResourceID - ARM resource id of the underlying compute 1573 ResourceID *string `json:"resourceId,omitempty"` 1574 // ProvisioningErrors - READ-ONLY; Errors during provisioning 1575 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 1576 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 1577 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 1578 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 1579 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 1580} 1581 1582// MarshalJSON is the custom marshaler for HDInsight. 1583func (hi HDInsight) MarshalJSON() ([]byte, error) { 1584 hi.ComputeType = ComputeTypeHDInsight1 1585 objectMap := make(map[string]interface{}) 1586 if hi.Properties != nil { 1587 objectMap["properties"] = hi.Properties 1588 } 1589 if hi.ComputeLocation != nil { 1590 objectMap["computeLocation"] = hi.ComputeLocation 1591 } 1592 if hi.Description != nil { 1593 objectMap["description"] = hi.Description 1594 } 1595 if hi.ResourceID != nil { 1596 objectMap["resourceId"] = hi.ResourceID 1597 } 1598 if hi.ComputeType != "" { 1599 objectMap["computeType"] = hi.ComputeType 1600 } 1601 return json.Marshal(objectMap) 1602} 1603 1604// AsAKS is the BasicCompute implementation for HDInsight. 1605func (hi HDInsight) AsAKS() (*AKS, bool) { 1606 return nil, false 1607} 1608 1609// AsAmlCompute is the BasicCompute implementation for HDInsight. 1610func (hi HDInsight) AsAmlCompute() (*AmlCompute, bool) { 1611 return nil, false 1612} 1613 1614// AsVirtualMachine is the BasicCompute implementation for HDInsight. 1615func (hi HDInsight) AsVirtualMachine() (*VirtualMachine, bool) { 1616 return nil, false 1617} 1618 1619// AsHDInsight is the BasicCompute implementation for HDInsight. 1620func (hi HDInsight) AsHDInsight() (*HDInsight, bool) { 1621 return &hi, true 1622} 1623 1624// AsDataFactory is the BasicCompute implementation for HDInsight. 1625func (hi HDInsight) AsDataFactory() (*DataFactory, bool) { 1626 return nil, false 1627} 1628 1629// AsDatabricks is the BasicCompute implementation for HDInsight. 1630func (hi HDInsight) AsDatabricks() (*Databricks, bool) { 1631 return nil, false 1632} 1633 1634// AsDataLakeAnalytics is the BasicCompute implementation for HDInsight. 1635func (hi HDInsight) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 1636 return nil, false 1637} 1638 1639// AsCompute is the BasicCompute implementation for HDInsight. 1640func (hi HDInsight) AsCompute() (*Compute, bool) { 1641 return nil, false 1642} 1643 1644// AsBasicCompute is the BasicCompute implementation for HDInsight. 1645func (hi HDInsight) AsBasicCompute() (BasicCompute, bool) { 1646 return &hi, true 1647} 1648 1649// HDInsightProperties ... 1650type HDInsightProperties struct { 1651 // SSHPort - Port open for ssh connections on the master node of the cluster. 1652 SSHPort *int32 `json:"sshPort,omitempty"` 1653 // Address - Public IP address of the master node of the cluster. 1654 Address *string `json:"address,omitempty"` 1655 // AdministratorAccount - Admin credentials for master node of the cluster 1656 AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` 1657} 1658 1659// Identity identity for the resource. 1660type Identity struct { 1661 // PrincipalID - READ-ONLY; The principal ID of resource identity. 1662 PrincipalID *string `json:"principalId,omitempty"` 1663 // TenantID - READ-ONLY; The tenant ID of resource. 1664 TenantID *string `json:"tenantId,omitempty"` 1665 // Type - The identity type. Possible values include: 'SystemAssigned' 1666 Type ResourceIdentityType `json:"type,omitempty"` 1667} 1668 1669// ListUsagesResult the List Usages operation response. 1670type ListUsagesResult struct { 1671 autorest.Response `json:"-"` 1672 // Value - READ-ONLY; The list of AML resource usages. 1673 Value *[]Usage `json:"value,omitempty"` 1674 // NextLink - READ-ONLY; The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information. 1675 NextLink *string `json:"nextLink,omitempty"` 1676} 1677 1678// ListUsagesResultIterator provides access to a complete listing of Usage values. 1679type ListUsagesResultIterator struct { 1680 i int 1681 page ListUsagesResultPage 1682} 1683 1684// NextWithContext advances to the next value. If there was an error making 1685// the request the iterator does not advance and the error is returned. 1686func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { 1687 if tracing.IsEnabled() { 1688 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") 1689 defer func() { 1690 sc := -1 1691 if iter.Response().Response.Response != nil { 1692 sc = iter.Response().Response.Response.StatusCode 1693 } 1694 tracing.EndSpan(ctx, sc, err) 1695 }() 1696 } 1697 iter.i++ 1698 if iter.i < len(iter.page.Values()) { 1699 return nil 1700 } 1701 err = iter.page.NextWithContext(ctx) 1702 if err != nil { 1703 iter.i-- 1704 return err 1705 } 1706 iter.i = 0 1707 return nil 1708} 1709 1710// Next advances to the next value. If there was an error making 1711// the request the iterator does not advance and the error is returned. 1712// Deprecated: Use NextWithContext() instead. 1713func (iter *ListUsagesResultIterator) Next() error { 1714 return iter.NextWithContext(context.Background()) 1715} 1716 1717// NotDone returns true if the enumeration should be started or is not yet complete. 1718func (iter ListUsagesResultIterator) NotDone() bool { 1719 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1720} 1721 1722// Response returns the raw server response from the last page request. 1723func (iter ListUsagesResultIterator) Response() ListUsagesResult { 1724 return iter.page.Response() 1725} 1726 1727// Value returns the current value or a zero-initialized value if the 1728// iterator has advanced beyond the end of the collection. 1729func (iter ListUsagesResultIterator) Value() Usage { 1730 if !iter.page.NotDone() { 1731 return Usage{} 1732 } 1733 return iter.page.Values()[iter.i] 1734} 1735 1736// Creates a new instance of the ListUsagesResultIterator type. 1737func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { 1738 return ListUsagesResultIterator{page: page} 1739} 1740 1741// IsEmpty returns true if the ListResult contains no values. 1742func (lur ListUsagesResult) IsEmpty() bool { 1743 return lur.Value == nil || len(*lur.Value) == 0 1744} 1745 1746// listUsagesResultPreparer prepares a request to retrieve the next set of results. 1747// It returns nil if no more results exist. 1748func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { 1749 if lur.NextLink == nil || len(to.String(lur.NextLink)) < 1 { 1750 return nil, nil 1751 } 1752 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1753 autorest.AsJSON(), 1754 autorest.AsGet(), 1755 autorest.WithBaseURL(to.String(lur.NextLink))) 1756} 1757 1758// ListUsagesResultPage contains a page of Usage values. 1759type ListUsagesResultPage struct { 1760 fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) 1761 lur ListUsagesResult 1762} 1763 1764// NextWithContext advances to the next page of values. If there was an error making 1765// the request the page does not advance and the error is returned. 1766func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { 1767 if tracing.IsEnabled() { 1768 ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") 1769 defer func() { 1770 sc := -1 1771 if page.Response().Response.Response != nil { 1772 sc = page.Response().Response.Response.StatusCode 1773 } 1774 tracing.EndSpan(ctx, sc, err) 1775 }() 1776 } 1777 next, err := page.fn(ctx, page.lur) 1778 if err != nil { 1779 return err 1780 } 1781 page.lur = next 1782 return nil 1783} 1784 1785// Next advances to the next page of values. If there was an error making 1786// the request the page does not advance and the error is returned. 1787// Deprecated: Use NextWithContext() instead. 1788func (page *ListUsagesResultPage) Next() error { 1789 return page.NextWithContext(context.Background()) 1790} 1791 1792// NotDone returns true if the page enumeration should be started or is not yet complete. 1793func (page ListUsagesResultPage) NotDone() bool { 1794 return !page.lur.IsEmpty() 1795} 1796 1797// Response returns the raw server response from the last page request. 1798func (page ListUsagesResultPage) Response() ListUsagesResult { 1799 return page.lur 1800} 1801 1802// Values returns the slice of values for the current page or nil if there are no values. 1803func (page ListUsagesResultPage) Values() []Usage { 1804 if page.lur.IsEmpty() { 1805 return nil 1806 } 1807 return *page.lur.Value 1808} 1809 1810// Creates a new instance of the ListUsagesResultPage type. 1811func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { 1812 return ListUsagesResultPage{fn: getNextPage} 1813} 1814 1815// ListWorkspaceKeysResult ... 1816type ListWorkspaceKeysResult struct { 1817 autorest.Response `json:"-"` 1818 // UserStorageKey - READ-ONLY 1819 UserStorageKey *string `json:"userStorageKey,omitempty"` 1820 // UserStorageResourceID - READ-ONLY 1821 UserStorageResourceID *string `json:"userStorageResourceId,omitempty"` 1822 // AppInsightsInstrumentationKey - READ-ONLY 1823 AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` 1824 // ContainerRegistryCredentials - READ-ONLY 1825 ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` 1826} 1827 1828// MachineLearningComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1829// long-running operation. 1830type MachineLearningComputeCreateOrUpdateFuture struct { 1831 azure.Future 1832} 1833 1834// Result returns the result of the asynchronous operation. 1835// If the operation has not completed it will return an error. 1836func (future *MachineLearningComputeCreateOrUpdateFuture) Result(client MachineLearningComputeClient) (cr ComputeResource, err error) { 1837 var done bool 1838 done, err = future.DoneWithContext(context.Background(), client) 1839 if err != nil { 1840 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1841 return 1842 } 1843 if !done { 1844 err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeCreateOrUpdateFuture") 1845 return 1846 } 1847 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1848 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 1849 cr, err = client.CreateOrUpdateResponder(cr.Response.Response) 1850 if err != nil { 1851 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 1852 } 1853 } 1854 return 1855} 1856 1857// MachineLearningComputeDeleteFuture an abstraction for monitoring and retrieving the results of a 1858// long-running operation. 1859type MachineLearningComputeDeleteFuture struct { 1860 azure.Future 1861} 1862 1863// Result returns the result of the asynchronous operation. 1864// If the operation has not completed it will return an error. 1865func (future *MachineLearningComputeDeleteFuture) Result(client MachineLearningComputeClient) (ar autorest.Response, err error) { 1866 var done bool 1867 done, err = future.DoneWithContext(context.Background(), client) 1868 if err != nil { 1869 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeDeleteFuture", "Result", future.Response(), "Polling failure") 1870 return 1871 } 1872 if !done { 1873 err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeDeleteFuture") 1874 return 1875 } 1876 ar.Response = future.Response() 1877 return 1878} 1879 1880// MachineLearningComputeUpdateFuture an abstraction for monitoring and retrieving the results of a 1881// long-running operation. 1882type MachineLearningComputeUpdateFuture struct { 1883 azure.Future 1884} 1885 1886// Result returns the result of the asynchronous operation. 1887// If the operation has not completed it will return an error. 1888func (future *MachineLearningComputeUpdateFuture) Result(client MachineLearningComputeClient) (cr ComputeResource, err error) { 1889 var done bool 1890 done, err = future.DoneWithContext(context.Background(), client) 1891 if err != nil { 1892 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", future.Response(), "Polling failure") 1893 return 1894 } 1895 if !done { 1896 err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeUpdateFuture") 1897 return 1898 } 1899 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1900 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 1901 cr, err = client.UpdateResponder(cr.Response.Response) 1902 if err != nil { 1903 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 1904 } 1905 } 1906 return 1907} 1908 1909// NodeStateCounts counts of various compute node states on the amlCompute. 1910type NodeStateCounts struct { 1911 // IdleNodeCount - READ-ONLY; Number of compute nodes in idle state. 1912 IdleNodeCount *int32 `json:"idleNodeCount,omitempty"` 1913 // RunningNodeCount - READ-ONLY; Number of compute nodes which are running jobs. 1914 RunningNodeCount *int32 `json:"runningNodeCount,omitempty"` 1915 // PreparingNodeCount - READ-ONLY; Number of compute nodes which are being prepared. 1916 PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty"` 1917 // UnusableNodeCount - READ-ONLY; Number of compute nodes which are in unusable state. 1918 UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"` 1919 // LeavingNodeCount - READ-ONLY; Number of compute nodes which are leaving the amlCompute. 1920 LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"` 1921 // PreemptedNodeCount - READ-ONLY; Number of compute nodes which are in preempted state. 1922 PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty"` 1923} 1924 1925// Operation azure Machine Learning workspace REST API operation 1926type Operation struct { 1927 // Name - Operation name: {provider}/{resource}/{operation} 1928 Name *string `json:"name,omitempty"` 1929 // Display - Display name of operation 1930 Display *OperationDisplay `json:"display,omitempty"` 1931} 1932 1933// OperationDisplay display name of operation 1934type OperationDisplay struct { 1935 // Provider - The resource provider name: Microsoft.MachineLearningExperimentation 1936 Provider *string `json:"provider,omitempty"` 1937 // Resource - The resource on which the operation is performed. 1938 Resource *string `json:"resource,omitempty"` 1939 // Operation - The operation that users can perform. 1940 Operation *string `json:"operation,omitempty"` 1941 // Description - The description for the operation. 1942 Description *string `json:"description,omitempty"` 1943} 1944 1945// OperationListResult an array of operations supported by the resource provider. 1946type OperationListResult struct { 1947 autorest.Response `json:"-"` 1948 // Value - List of AML workspace operations supported by the AML workspace resource provider. 1949 Value *[]Operation `json:"value,omitempty"` 1950} 1951 1952// PaginatedComputeResourcesList paginated list of Machine Learning compute objects wrapped in ARM resource 1953// envelope. 1954type PaginatedComputeResourcesList struct { 1955 autorest.Response `json:"-"` 1956 // Value - An array of Machine Learning compute objects wrapped in ARM resource envelope. 1957 Value *[]ComputeResource `json:"value,omitempty"` 1958 // NextLink - A continuation link (absolute URI) to the next page of results in the list. 1959 NextLink *string `json:"nextLink,omitempty"` 1960} 1961 1962// PaginatedComputeResourcesListIterator provides access to a complete listing of ComputeResource values. 1963type PaginatedComputeResourcesListIterator struct { 1964 i int 1965 page PaginatedComputeResourcesListPage 1966} 1967 1968// NextWithContext advances to the next value. If there was an error making 1969// the request the iterator does not advance and the error is returned. 1970func (iter *PaginatedComputeResourcesListIterator) NextWithContext(ctx context.Context) (err error) { 1971 if tracing.IsEnabled() { 1972 ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListIterator.NextWithContext") 1973 defer func() { 1974 sc := -1 1975 if iter.Response().Response.Response != nil { 1976 sc = iter.Response().Response.Response.StatusCode 1977 } 1978 tracing.EndSpan(ctx, sc, err) 1979 }() 1980 } 1981 iter.i++ 1982 if iter.i < len(iter.page.Values()) { 1983 return nil 1984 } 1985 err = iter.page.NextWithContext(ctx) 1986 if err != nil { 1987 iter.i-- 1988 return err 1989 } 1990 iter.i = 0 1991 return nil 1992} 1993 1994// Next advances to the next value. If there was an error making 1995// the request the iterator does not advance and the error is returned. 1996// Deprecated: Use NextWithContext() instead. 1997func (iter *PaginatedComputeResourcesListIterator) Next() error { 1998 return iter.NextWithContext(context.Background()) 1999} 2000 2001// NotDone returns true if the enumeration should be started or is not yet complete. 2002func (iter PaginatedComputeResourcesListIterator) NotDone() bool { 2003 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2004} 2005 2006// Response returns the raw server response from the last page request. 2007func (iter PaginatedComputeResourcesListIterator) Response() PaginatedComputeResourcesList { 2008 return iter.page.Response() 2009} 2010 2011// Value returns the current value or a zero-initialized value if the 2012// iterator has advanced beyond the end of the collection. 2013func (iter PaginatedComputeResourcesListIterator) Value() ComputeResource { 2014 if !iter.page.NotDone() { 2015 return ComputeResource{} 2016 } 2017 return iter.page.Values()[iter.i] 2018} 2019 2020// Creates a new instance of the PaginatedComputeResourcesListIterator type. 2021func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator { 2022 return PaginatedComputeResourcesListIterator{page: page} 2023} 2024 2025// IsEmpty returns true if the ListResult contains no values. 2026func (pcrl PaginatedComputeResourcesList) IsEmpty() bool { 2027 return pcrl.Value == nil || len(*pcrl.Value) == 0 2028} 2029 2030// paginatedComputeResourcesListPreparer prepares a request to retrieve the next set of results. 2031// It returns nil if no more results exist. 2032func (pcrl PaginatedComputeResourcesList) paginatedComputeResourcesListPreparer(ctx context.Context) (*http.Request, error) { 2033 if pcrl.NextLink == nil || len(to.String(pcrl.NextLink)) < 1 { 2034 return nil, nil 2035 } 2036 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2037 autorest.AsJSON(), 2038 autorest.AsGet(), 2039 autorest.WithBaseURL(to.String(pcrl.NextLink))) 2040} 2041 2042// PaginatedComputeResourcesListPage contains a page of ComputeResource values. 2043type PaginatedComputeResourcesListPage struct { 2044 fn func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error) 2045 pcrl PaginatedComputeResourcesList 2046} 2047 2048// NextWithContext advances to the next page of values. If there was an error making 2049// the request the page does not advance and the error is returned. 2050func (page *PaginatedComputeResourcesListPage) NextWithContext(ctx context.Context) (err error) { 2051 if tracing.IsEnabled() { 2052 ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListPage.NextWithContext") 2053 defer func() { 2054 sc := -1 2055 if page.Response().Response.Response != nil { 2056 sc = page.Response().Response.Response.StatusCode 2057 } 2058 tracing.EndSpan(ctx, sc, err) 2059 }() 2060 } 2061 next, err := page.fn(ctx, page.pcrl) 2062 if err != nil { 2063 return err 2064 } 2065 page.pcrl = next 2066 return nil 2067} 2068 2069// Next advances to the next page of values. If there was an error making 2070// the request the page does not advance and the error is returned. 2071// Deprecated: Use NextWithContext() instead. 2072func (page *PaginatedComputeResourcesListPage) Next() error { 2073 return page.NextWithContext(context.Background()) 2074} 2075 2076// NotDone returns true if the page enumeration should be started or is not yet complete. 2077func (page PaginatedComputeResourcesListPage) NotDone() bool { 2078 return !page.pcrl.IsEmpty() 2079} 2080 2081// Response returns the raw server response from the last page request. 2082func (page PaginatedComputeResourcesListPage) Response() PaginatedComputeResourcesList { 2083 return page.pcrl 2084} 2085 2086// Values returns the slice of values for the current page or nil if there are no values. 2087func (page PaginatedComputeResourcesListPage) Values() []ComputeResource { 2088 if page.pcrl.IsEmpty() { 2089 return nil 2090 } 2091 return *page.pcrl.Value 2092} 2093 2094// Creates a new instance of the PaginatedComputeResourcesListPage type. 2095func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { 2096 return PaginatedComputeResourcesListPage{fn: getNextPage} 2097} 2098 2099// Password ... 2100type Password struct { 2101 // Name - READ-ONLY 2102 Name *string `json:"name,omitempty"` 2103 // Value - READ-ONLY 2104 Value *string `json:"value,omitempty"` 2105} 2106 2107// RegistryListCredentialsResult ... 2108type RegistryListCredentialsResult struct { 2109 // Location - READ-ONLY 2110 Location *string `json:"location,omitempty"` 2111 // Username - READ-ONLY 2112 Username *string `json:"username,omitempty"` 2113 Passwords *[]Password `json:"passwords,omitempty"` 2114} 2115 2116// Resource azure Resource Manager resource envelope. 2117type Resource struct { 2118 // ID - READ-ONLY; Specifies the resource ID. 2119 ID *string `json:"id,omitempty"` 2120 // Name - READ-ONLY; Specifies the name of the resource. 2121 Name *string `json:"name,omitempty"` 2122 // Identity - READ-ONLY; The identity of the resource. 2123 Identity *Identity `json:"identity,omitempty"` 2124 // Location - Specifies the location of the resource. 2125 Location *string `json:"location,omitempty"` 2126 // Type - READ-ONLY; Specifies the type of the resource. 2127 Type *string `json:"type,omitempty"` 2128 // Tags - Contains resource tags defined as key/value pairs. 2129 Tags map[string]*string `json:"tags"` 2130} 2131 2132// MarshalJSON is the custom marshaler for Resource. 2133func (r Resource) MarshalJSON() ([]byte, error) { 2134 objectMap := make(map[string]interface{}) 2135 if r.Location != nil { 2136 objectMap["location"] = r.Location 2137 } 2138 if r.Tags != nil { 2139 objectMap["tags"] = r.Tags 2140 } 2141 return json.Marshal(objectMap) 2142} 2143 2144// ResourceID represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. 2145type ResourceID struct { 2146 // ID - The ID of the resource 2147 ID *string `json:"id,omitempty"` 2148} 2149 2150// ScaleSettings scale settings for AML Compute 2151type ScaleSettings struct { 2152 // MaxNodeCount - Max number of nodes to use 2153 MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` 2154 // MinNodeCount - Min number of nodes to use 2155 MinNodeCount *int32 `json:"minNodeCount,omitempty"` 2156 // NodeIdleTimeBeforeScaleDown - Node Idle Time before scaling down amlCompute 2157 NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` 2158} 2159 2160// ServicePrincipalCredentials service principal credentials. 2161type ServicePrincipalCredentials struct { 2162 // ClientID - Client Id 2163 ClientID *string `json:"clientId,omitempty"` 2164 // ClientSecret - Client secret 2165 ClientSecret *string `json:"clientSecret,omitempty"` 2166} 2167 2168// SslConfiguration the ssl configuration for scoring 2169type SslConfiguration struct { 2170 // Status - Enable or disable ssl for scoring. Possible values include: 'Disabled', 'Enabled' 2171 Status Status `json:"status,omitempty"` 2172 // Cert - Cert data 2173 Cert *string `json:"cert,omitempty"` 2174 // Key - Key data 2175 Key *string `json:"key,omitempty"` 2176 // Cname - CNAME of the cert 2177 Cname *string `json:"cname,omitempty"` 2178} 2179 2180// SystemService a system service running on a compute. 2181type SystemService struct { 2182 // SystemServiceType - READ-ONLY; The type of this system service. 2183 SystemServiceType *string `json:"systemServiceType,omitempty"` 2184 // PublicIPAddress - READ-ONLY; Public IP address 2185 PublicIPAddress *string `json:"publicIpAddress,omitempty"` 2186 // Version - READ-ONLY; The version for this type. 2187 Version *string `json:"version,omitempty"` 2188} 2189 2190// Usage describes AML Resource Usage. 2191type Usage struct { 2192 // Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'Count' 2193 Unit UsageUnit `json:"unit,omitempty"` 2194 // CurrentValue - READ-ONLY; The current usage of the resource. 2195 CurrentValue *int64 `json:"currentValue,omitempty"` 2196 // Limit - READ-ONLY; The maximum permitted usage of the resource. 2197 Limit *int64 `json:"limit,omitempty"` 2198 // Name - READ-ONLY; The name of the type of usage. 2199 Name *UsageName `json:"name,omitempty"` 2200} 2201 2202// UsageName the Usage Names. 2203type UsageName struct { 2204 // Value - READ-ONLY; The name of the resource. 2205 Value *string `json:"value,omitempty"` 2206 // LocalizedValue - READ-ONLY; The localized name of the resource. 2207 LocalizedValue *string `json:"localizedValue,omitempty"` 2208} 2209 2210// UserAccountCredentials settings for user account that gets created on each on the nodes of a compute. 2211type UserAccountCredentials struct { 2212 // AdminUserName - Name of the administrator user account which can be used to SSH to nodes. 2213 AdminUserName *string `json:"adminUserName,omitempty"` 2214 // AdminUserSSHPublicKey - SSH public key of the administrator user account. 2215 AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"` 2216 // AdminUserPassword - Password of the administrator user account. 2217 AdminUserPassword *string `json:"adminUserPassword,omitempty"` 2218} 2219 2220// VirtualMachine a Machine Learning compute based on Azure Virtual Machines. 2221type VirtualMachine struct { 2222 Properties *VirtualMachineProperties `json:"properties,omitempty"` 2223 // ComputeLocation - Location for the underlying compute 2224 ComputeLocation *string `json:"computeLocation,omitempty"` 2225 // 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' 2226 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2227 // Description - The description of the Machine Learning compute. 2228 Description *string `json:"description,omitempty"` 2229 // CreatedOn - READ-ONLY; The date and time when the compute was created. 2230 CreatedOn *date.Time `json:"createdOn,omitempty"` 2231 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 2232 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 2233 // ResourceID - ARM resource id of the underlying compute 2234 ResourceID *string `json:"resourceId,omitempty"` 2235 // ProvisioningErrors - READ-ONLY; Errors during provisioning 2236 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 2237 // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. 2238 IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` 2239 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' 2240 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 2241} 2242 2243// MarshalJSON is the custom marshaler for VirtualMachine. 2244func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 2245 VM.ComputeType = ComputeTypeVirtualMachine1 2246 objectMap := make(map[string]interface{}) 2247 if VM.Properties != nil { 2248 objectMap["properties"] = VM.Properties 2249 } 2250 if VM.ComputeLocation != nil { 2251 objectMap["computeLocation"] = VM.ComputeLocation 2252 } 2253 if VM.Description != nil { 2254 objectMap["description"] = VM.Description 2255 } 2256 if VM.ResourceID != nil { 2257 objectMap["resourceId"] = VM.ResourceID 2258 } 2259 if VM.ComputeType != "" { 2260 objectMap["computeType"] = VM.ComputeType 2261 } 2262 return json.Marshal(objectMap) 2263} 2264 2265// AsAKS is the BasicCompute implementation for VirtualMachine. 2266func (VM VirtualMachine) AsAKS() (*AKS, bool) { 2267 return nil, false 2268} 2269 2270// AsAmlCompute is the BasicCompute implementation for VirtualMachine. 2271func (VM VirtualMachine) AsAmlCompute() (*AmlCompute, bool) { 2272 return nil, false 2273} 2274 2275// AsVirtualMachine is the BasicCompute implementation for VirtualMachine. 2276func (VM VirtualMachine) AsVirtualMachine() (*VirtualMachine, bool) { 2277 return &VM, true 2278} 2279 2280// AsHDInsight is the BasicCompute implementation for VirtualMachine. 2281func (VM VirtualMachine) AsHDInsight() (*HDInsight, bool) { 2282 return nil, false 2283} 2284 2285// AsDataFactory is the BasicCompute implementation for VirtualMachine. 2286func (VM VirtualMachine) AsDataFactory() (*DataFactory, bool) { 2287 return nil, false 2288} 2289 2290// AsDatabricks is the BasicCompute implementation for VirtualMachine. 2291func (VM VirtualMachine) AsDatabricks() (*Databricks, bool) { 2292 return nil, false 2293} 2294 2295// AsDataLakeAnalytics is the BasicCompute implementation for VirtualMachine. 2296func (VM VirtualMachine) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { 2297 return nil, false 2298} 2299 2300// AsCompute is the BasicCompute implementation for VirtualMachine. 2301func (VM VirtualMachine) AsCompute() (*Compute, bool) { 2302 return nil, false 2303} 2304 2305// AsBasicCompute is the BasicCompute implementation for VirtualMachine. 2306func (VM VirtualMachine) AsBasicCompute() (BasicCompute, bool) { 2307 return &VM, true 2308} 2309 2310// VirtualMachineProperties ... 2311type VirtualMachineProperties struct { 2312 // VirtualMachineSize - Virtual Machine size 2313 VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` 2314 // SSHPort - Port open for ssh connections. 2315 SSHPort *int32 `json:"sshPort,omitempty"` 2316 // Address - Public IP address of the virtual machine. 2317 Address *string `json:"address,omitempty"` 2318 // AdministratorAccount - Admin credentials for virtual machine 2319 AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` 2320} 2321 2322// VirtualMachineSecrets secrets related to a Machine Learning compute based on AKS. 2323type VirtualMachineSecrets struct { 2324 // AdministratorAccount - Admin credentials for virtual machine. 2325 AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` 2326 // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' 2327 ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` 2328} 2329 2330// MarshalJSON is the custom marshaler for VirtualMachineSecrets. 2331func (vms VirtualMachineSecrets) MarshalJSON() ([]byte, error) { 2332 vms.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine 2333 objectMap := make(map[string]interface{}) 2334 if vms.AdministratorAccount != nil { 2335 objectMap["administratorAccount"] = vms.AdministratorAccount 2336 } 2337 if vms.ComputeType != "" { 2338 objectMap["computeType"] = vms.ComputeType 2339 } 2340 return json.Marshal(objectMap) 2341} 2342 2343// AsAksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 2344func (vms VirtualMachineSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { 2345 return nil, false 2346} 2347 2348// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 2349func (vms VirtualMachineSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { 2350 return &vms, true 2351} 2352 2353// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 2354func (vms VirtualMachineSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { 2355 return nil, false 2356} 2357 2358// AsComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 2359func (vms VirtualMachineSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { 2360 return nil, false 2361} 2362 2363// AsBasicComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 2364func (vms VirtualMachineSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { 2365 return &vms, true 2366} 2367 2368// VirtualMachineSize describes the properties of a VM size. 2369type VirtualMachineSize struct { 2370 // Name - READ-ONLY; The name of the virtual machine size. 2371 Name *string `json:"name,omitempty"` 2372 // Family - READ-ONLY; The family name of the virtual machine size. 2373 Family *string `json:"family,omitempty"` 2374 // VCPUs - READ-ONLY; The number of vCPUs supported by the virtual machine size. 2375 VCPUs *int32 `json:"vCPUs,omitempty"` 2376 // OsVhdSizeMB - READ-ONLY; The OS VHD disk size, in MB, allowed by the virtual machine size. 2377 OsVhdSizeMB *int32 `json:"osVhdSizeMB,omitempty"` 2378 // MaxResourceVolumeMB - READ-ONLY; The resource volume size, in MB, allowed by the virtual machine size. 2379 MaxResourceVolumeMB *int32 `json:"maxResourceVolumeMB,omitempty"` 2380 // MemoryGB - READ-ONLY; The amount of memory, in GB, supported by the virtual machine size. 2381 MemoryGB *float64 `json:"memoryGB,omitempty"` 2382 // LowPriorityCapable - READ-ONLY; Specifies if the virtual machine size supports low priority VMs. 2383 LowPriorityCapable *bool `json:"lowPriorityCapable,omitempty"` 2384 // PremiumIO - READ-ONLY; Specifies if the virtual machine size supports premium IO. 2385 PremiumIO *bool `json:"premiumIO,omitempty"` 2386} 2387 2388// VirtualMachineSizeListResult the List Virtual Machine size operation response. 2389type VirtualMachineSizeListResult struct { 2390 autorest.Response `json:"-"` 2391 // AmlCompute - The list of virtual machine sizes supported by AmlCompute. 2392 AmlCompute *[]VirtualMachineSize `json:"amlCompute,omitempty"` 2393} 2394 2395// VirtualMachineSSHCredentials admin credentials for virtual machine 2396type VirtualMachineSSHCredentials struct { 2397 // Username - Username of admin account 2398 Username *string `json:"username,omitempty"` 2399 // Password - Password of admin account 2400 Password *string `json:"password,omitempty"` 2401 // PublicKeyData - Public key data 2402 PublicKeyData *string `json:"publicKeyData,omitempty"` 2403 // PrivateKeyData - Private key data 2404 PrivateKeyData *string `json:"privateKeyData,omitempty"` 2405} 2406 2407// Workspace an object that represents a machine learning workspace. 2408type Workspace struct { 2409 autorest.Response `json:"-"` 2410 // WorkspaceProperties - The properties of the machine learning workspace. 2411 *WorkspaceProperties `json:"properties,omitempty"` 2412 // ID - READ-ONLY; Specifies the resource ID. 2413 ID *string `json:"id,omitempty"` 2414 // Name - READ-ONLY; Specifies the name of the resource. 2415 Name *string `json:"name,omitempty"` 2416 // Identity - READ-ONLY; The identity of the resource. 2417 Identity *Identity `json:"identity,omitempty"` 2418 // Location - Specifies the location of the resource. 2419 Location *string `json:"location,omitempty"` 2420 // Type - READ-ONLY; Specifies the type of the resource. 2421 Type *string `json:"type,omitempty"` 2422 // Tags - Contains resource tags defined as key/value pairs. 2423 Tags map[string]*string `json:"tags"` 2424} 2425 2426// MarshalJSON is the custom marshaler for Workspace. 2427func (w Workspace) MarshalJSON() ([]byte, error) { 2428 objectMap := make(map[string]interface{}) 2429 if w.WorkspaceProperties != nil { 2430 objectMap["properties"] = w.WorkspaceProperties 2431 } 2432 if w.Location != nil { 2433 objectMap["location"] = w.Location 2434 } 2435 if w.Tags != nil { 2436 objectMap["tags"] = w.Tags 2437 } 2438 return json.Marshal(objectMap) 2439} 2440 2441// UnmarshalJSON is the custom unmarshaler for Workspace struct. 2442func (w *Workspace) UnmarshalJSON(body []byte) error { 2443 var m map[string]*json.RawMessage 2444 err := json.Unmarshal(body, &m) 2445 if err != nil { 2446 return err 2447 } 2448 for k, v := range m { 2449 switch k { 2450 case "properties": 2451 if v != nil { 2452 var workspaceProperties WorkspaceProperties 2453 err = json.Unmarshal(*v, &workspaceProperties) 2454 if err != nil { 2455 return err 2456 } 2457 w.WorkspaceProperties = &workspaceProperties 2458 } 2459 case "id": 2460 if v != nil { 2461 var ID string 2462 err = json.Unmarshal(*v, &ID) 2463 if err != nil { 2464 return err 2465 } 2466 w.ID = &ID 2467 } 2468 case "name": 2469 if v != nil { 2470 var name string 2471 err = json.Unmarshal(*v, &name) 2472 if err != nil { 2473 return err 2474 } 2475 w.Name = &name 2476 } 2477 case "identity": 2478 if v != nil { 2479 var identity Identity 2480 err = json.Unmarshal(*v, &identity) 2481 if err != nil { 2482 return err 2483 } 2484 w.Identity = &identity 2485 } 2486 case "location": 2487 if v != nil { 2488 var location string 2489 err = json.Unmarshal(*v, &location) 2490 if err != nil { 2491 return err 2492 } 2493 w.Location = &location 2494 } 2495 case "type": 2496 if v != nil { 2497 var typeVar string 2498 err = json.Unmarshal(*v, &typeVar) 2499 if err != nil { 2500 return err 2501 } 2502 w.Type = &typeVar 2503 } 2504 case "tags": 2505 if v != nil { 2506 var tags map[string]*string 2507 err = json.Unmarshal(*v, &tags) 2508 if err != nil { 2509 return err 2510 } 2511 w.Tags = tags 2512 } 2513 } 2514 } 2515 2516 return nil 2517} 2518 2519// WorkspaceListResult the result of a request to list machine learning workspaces. 2520type WorkspaceListResult struct { 2521 autorest.Response `json:"-"` 2522 // Value - The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. 2523 Value *[]Workspace `json:"value,omitempty"` 2524 // NextLink - The URI that can be used to request the next list of machine learning workspaces. 2525 NextLink *string `json:"nextLink,omitempty"` 2526} 2527 2528// WorkspaceListResultIterator provides access to a complete listing of Workspace values. 2529type WorkspaceListResultIterator struct { 2530 i int 2531 page WorkspaceListResultPage 2532} 2533 2534// NextWithContext advances to the next value. If there was an error making 2535// the request the iterator does not advance and the error is returned. 2536func (iter *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) { 2537 if tracing.IsEnabled() { 2538 ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.NextWithContext") 2539 defer func() { 2540 sc := -1 2541 if iter.Response().Response.Response != nil { 2542 sc = iter.Response().Response.Response.StatusCode 2543 } 2544 tracing.EndSpan(ctx, sc, err) 2545 }() 2546 } 2547 iter.i++ 2548 if iter.i < len(iter.page.Values()) { 2549 return nil 2550 } 2551 err = iter.page.NextWithContext(ctx) 2552 if err != nil { 2553 iter.i-- 2554 return err 2555 } 2556 iter.i = 0 2557 return nil 2558} 2559 2560// Next advances to the next value. If there was an error making 2561// the request the iterator does not advance and the error is returned. 2562// Deprecated: Use NextWithContext() instead. 2563func (iter *WorkspaceListResultIterator) Next() error { 2564 return iter.NextWithContext(context.Background()) 2565} 2566 2567// NotDone returns true if the enumeration should be started or is not yet complete. 2568func (iter WorkspaceListResultIterator) NotDone() bool { 2569 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2570} 2571 2572// Response returns the raw server response from the last page request. 2573func (iter WorkspaceListResultIterator) Response() WorkspaceListResult { 2574 return iter.page.Response() 2575} 2576 2577// Value returns the current value or a zero-initialized value if the 2578// iterator has advanced beyond the end of the collection. 2579func (iter WorkspaceListResultIterator) Value() Workspace { 2580 if !iter.page.NotDone() { 2581 return Workspace{} 2582 } 2583 return iter.page.Values()[iter.i] 2584} 2585 2586// Creates a new instance of the WorkspaceListResultIterator type. 2587func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { 2588 return WorkspaceListResultIterator{page: page} 2589} 2590 2591// IsEmpty returns true if the ListResult contains no values. 2592func (wlr WorkspaceListResult) IsEmpty() bool { 2593 return wlr.Value == nil || len(*wlr.Value) == 0 2594} 2595 2596// workspaceListResultPreparer prepares a request to retrieve the next set of results. 2597// It returns nil if no more results exist. 2598func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) { 2599 if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { 2600 return nil, nil 2601 } 2602 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2603 autorest.AsJSON(), 2604 autorest.AsGet(), 2605 autorest.WithBaseURL(to.String(wlr.NextLink))) 2606} 2607 2608// WorkspaceListResultPage contains a page of Workspace values. 2609type WorkspaceListResultPage struct { 2610 fn func(context.Context, WorkspaceListResult) (WorkspaceListResult, error) 2611 wlr WorkspaceListResult 2612} 2613 2614// NextWithContext advances to the next page of values. If there was an error making 2615// the request the page does not advance and the error is returned. 2616func (page *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) { 2617 if tracing.IsEnabled() { 2618 ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext") 2619 defer func() { 2620 sc := -1 2621 if page.Response().Response.Response != nil { 2622 sc = page.Response().Response.Response.StatusCode 2623 } 2624 tracing.EndSpan(ctx, sc, err) 2625 }() 2626 } 2627 next, err := page.fn(ctx, page.wlr) 2628 if err != nil { 2629 return err 2630 } 2631 page.wlr = next 2632 return nil 2633} 2634 2635// Next advances to the next page of values. If there was an error making 2636// the request the page does not advance and the error is returned. 2637// Deprecated: Use NextWithContext() instead. 2638func (page *WorkspaceListResultPage) Next() error { 2639 return page.NextWithContext(context.Background()) 2640} 2641 2642// NotDone returns true if the page enumeration should be started or is not yet complete. 2643func (page WorkspaceListResultPage) NotDone() bool { 2644 return !page.wlr.IsEmpty() 2645} 2646 2647// Response returns the raw server response from the last page request. 2648func (page WorkspaceListResultPage) Response() WorkspaceListResult { 2649 return page.wlr 2650} 2651 2652// Values returns the slice of values for the current page or nil if there are no values. 2653func (page WorkspaceListResultPage) Values() []Workspace { 2654 if page.wlr.IsEmpty() { 2655 return nil 2656 } 2657 return *page.wlr.Value 2658} 2659 2660// Creates a new instance of the WorkspaceListResultPage type. 2661func NewWorkspaceListResultPage(getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage { 2662 return WorkspaceListResultPage{fn: getNextPage} 2663} 2664 2665// WorkspaceProperties the properties of a machine learning workspace. 2666type WorkspaceProperties struct { 2667 // WorkspaceID - READ-ONLY; The immutable id associated with this workspace. 2668 WorkspaceID *string `json:"workspaceId,omitempty"` 2669 // Description - The description of this workspace. 2670 Description *string `json:"description,omitempty"` 2671 // FriendlyName - The friendly name for this workspace. This name in mutable 2672 FriendlyName *string `json:"friendlyName,omitempty"` 2673 // CreationTime - READ-ONLY; The creation time of the machine learning workspace in ISO8601 format. 2674 CreationTime *date.Time `json:"creationTime,omitempty"` 2675 // KeyVault - ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created 2676 KeyVault *string `json:"keyVault,omitempty"` 2677 // ApplicationInsights - ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created 2678 ApplicationInsights *string `json:"applicationInsights,omitempty"` 2679 // ContainerRegistry - ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created 2680 ContainerRegistry *string `json:"containerRegistry,omitempty"` 2681 // StorageAccount - ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created 2682 StorageAccount *string `json:"storageAccount,omitempty"` 2683 // DiscoveryURL - Url for the discovery service to identify regional endpoints for machine learning experimentation services 2684 DiscoveryURL *string `json:"discoveryUrl,omitempty"` 2685 // ProvisioningState - READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 2686 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2687} 2688 2689// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning 2690// workspace. 2691type WorkspacePropertiesUpdateParameters struct { 2692 // Description - The description of this workspace. 2693 Description *string `json:"description,omitempty"` 2694 // FriendlyName - The friendly name for this workspace. 2695 FriendlyName *string `json:"friendlyName,omitempty"` 2696} 2697 2698// WorkspaceUpdateParameters the parameters for updating a machine learning workspace. 2699type WorkspaceUpdateParameters struct { 2700 // Tags - The resource tags for the machine learning workspace. 2701 Tags map[string]*string `json:"tags"` 2702 // WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with. 2703 *WorkspacePropertiesUpdateParameters `json:"properties,omitempty"` 2704} 2705 2706// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters. 2707func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) { 2708 objectMap := make(map[string]interface{}) 2709 if wup.Tags != nil { 2710 objectMap["tags"] = wup.Tags 2711 } 2712 if wup.WorkspacePropertiesUpdateParameters != nil { 2713 objectMap["properties"] = wup.WorkspacePropertiesUpdateParameters 2714 } 2715 return json.Marshal(objectMap) 2716} 2717 2718// UnmarshalJSON is the custom unmarshaler for WorkspaceUpdateParameters struct. 2719func (wup *WorkspaceUpdateParameters) UnmarshalJSON(body []byte) error { 2720 var m map[string]*json.RawMessage 2721 err := json.Unmarshal(body, &m) 2722 if err != nil { 2723 return err 2724 } 2725 for k, v := range m { 2726 switch k { 2727 case "tags": 2728 if v != nil { 2729 var tags map[string]*string 2730 err = json.Unmarshal(*v, &tags) 2731 if err != nil { 2732 return err 2733 } 2734 wup.Tags = tags 2735 } 2736 case "properties": 2737 if v != nil { 2738 var workspacePropertiesUpdateParameters WorkspacePropertiesUpdateParameters 2739 err = json.Unmarshal(*v, &workspacePropertiesUpdateParameters) 2740 if err != nil { 2741 return err 2742 } 2743 wup.WorkspacePropertiesUpdateParameters = &workspacePropertiesUpdateParameters 2744 } 2745 } 2746 } 2747 2748 return nil 2749} 2750