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