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