diff --git a/internal/services/machinelearning/client/client.go b/internal/services/machinelearning/client/client.go index 7d912cfb744b..7669fc0481b8 100644 --- a/internal/services/machinelearning/client/client.go +++ b/internal/services/machinelearning/client/client.go @@ -1,20 +1,21 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - ComputeClient *machinelearningservices.ComputeClient - WorkspacesClient *machinelearningservices.WorkspacesClient + ComputeClient *machinelearningcomputes.MachineLearningComputesClient + WorkspacesClient *workspaces.WorkspacesClient } func NewClient(o *common.ClientOptions) *Client { - ComputeClient := machinelearningservices.NewComputeClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + ComputeClient := machinelearningcomputes.NewMachineLearningComputesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&ComputeClient.Client, o.ResourceManagerAuthorizer) - WorkspacesClient := machinelearningservices.NewWorkspacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + WorkspacesClient := workspaces.NewWorkspacesClientWithBaseURI(o.ResourceManagerEndpoint) o.ConfigureClient(&WorkspacesClient.Client, o.ResourceManagerAuthorizer) return &Client{ diff --git a/internal/services/machinelearning/identity.go b/internal/services/machinelearning/identity.go index 0279eb49ae2e..e6c2073d7580 100644 --- a/internal/services/machinelearning/identity.go +++ b/internal/services/machinelearning/identity.go @@ -1,24 +1,18 @@ package machinelearning import ( - "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" "github.com/hashicorp/terraform-provider-azurerm/utils" ) -func expandIdentity(input []interface{}) (*machinelearningservices.Identity, error) { +func expandIdentity(input []interface{}) (*identity.LegacySystemAndUserAssignedMap, error) { expanded, err := identity.ExpandSystemAndUserAssignedMap(input) if err != nil { return nil, err } - out := machinelearningservices.Identity{ - Type: machinelearningservices.ResourceIdentityType(string(expanded.Type)), - } - - // work around the Swagger defining `SystemAssigned,UserAssigned` rather than `SystemAssigned, UserAssigned` - if expanded.Type == identity.TypeSystemAssignedUserAssigned { - out.Type = machinelearningservices.ResourceIdentityTypeSystemAssignedUserAssigned + out := identity.LegacySystemAndUserAssignedMap{ + Type: expanded.Type, } // 'Failed to perform resource identity operation. Status: 'BadRequest'. Response: @@ -27,52 +21,45 @@ func expandIdentity(input []interface{}) (*machinelearningservices.Identity, err // }} // Upstream issue: https://github.com/Azure/azure-rest-api-specs/issues/17650 if len(expanded.IdentityIds) > 0 { - userAssignedIdentities := make(map[string]*machinelearningservices.UserAssignedIdentity) + userAssignedIdentities := make(map[string]identity.UserAssignedIdentityDetails) for id := range expanded.IdentityIds { - userAssignedIdentities[id] = &machinelearningservices.UserAssignedIdentity{} + userAssignedIdentities[id] = identity.UserAssignedIdentityDetails{} } - out.UserAssignedIdentities = userAssignedIdentities + out.IdentityIds = userAssignedIdentities } return &out, nil } -func flattenIdentity(input *machinelearningservices.Identity) (*[]interface{}, error) { +func flattenIdentity(input *identity.LegacySystemAndUserAssignedMap) (*[]interface{}, error) { var config *identity.SystemAndUserAssignedMap if input != nil { config = &identity.SystemAndUserAssignedMap{ - Type: identity.Type(string(input.Type)), + Type: input.Type, IdentityIds: nil, } - // work around the Swagger defining `SystemAssigned,UserAssigned` rather than `SystemAssigned, UserAssigned` - if input.Type == machinelearningservices.ResourceIdentityTypeSystemAssignedUserAssigned { - config.Type = identity.TypeSystemAssignedUserAssigned - } - - if input.PrincipalID != nil { - config.PrincipalId = *input.PrincipalID + if input.PrincipalId != "" { + config.PrincipalId = input.PrincipalId } - if input.TenantID != nil { - config.TenantId = *input.TenantID + if input.TenantId != "nil" { + config.TenantId = input.TenantId } identityIds := make(map[string]identity.UserAssignedIdentityDetails) - for k, v := range input.UserAssignedIdentities { - if v == nil { - continue - } + if input.IdentityIds != nil { + for k, v := range input.IdentityIds { + details := identity.UserAssignedIdentityDetails{} - details := identity.UserAssignedIdentityDetails{} + if v.ClientId != nil { + details.ClientId = utils.String(*v.ClientId) + } + if v.PrincipalId != nil { + details.PrincipalId = utils.String(*v.PrincipalId) + } - if v.ClientID != nil { - details.ClientId = utils.String(*v.ClientID) - } - if v.PrincipalID != nil { - details.PrincipalId = utils.String(*v.PrincipalID) + identityIds[k] = details } - - identityIds[k] = details } config.IdentityIds = identityIds diff --git a/internal/services/machinelearning/machine_learning_compute_cluster_resource.go b/internal/services/machinelearning/machine_learning_compute_cluster_resource.go index 52970dc10b9a..4c6bbcb68fa0 100644 --- a/internal/services/machinelearning/machine_learning_compute_cluster_resource.go +++ b/internal/services/machinelearning/machine_learning_compute_cluster_resource.go @@ -4,13 +4,15 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -59,7 +61,7 @@ func resourceComputeCluster() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{string(machinelearningservices.VMPriorityDedicated), string(machinelearningservices.VMPriorityLowPriority)}, false), + ValidateFunc: validation.StringInSlice([]string{string(machinelearningcomputes.VmPriorityDedicated), string(machinelearningcomputes.VmPriorityLowPriority)}, false), }, "identity": commonschema.SystemAssignedUserAssignedIdentityOptionalForceNew(), @@ -144,7 +146,7 @@ func resourceComputeCluster() *pluginsdk.Resource { ForceNew: true, }, - "tags": tags.ForceNewSchema(), + "tags": commonschema.TagsForceNew(), }, } } @@ -155,40 +157,41 @@ func resourceComputeClusterCreate(d *pluginsdk.ResourceData, meta interface{}) e ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - workspaceID, err := parse.WorkspaceID(d.Get("machine_learning_workspace_id").(string)) + workspaceID, err := workspaces.ParseWorkspaceID(d.Get("machine_learning_workspace_id").(string)) if err != nil { return err } - id := parse.NewComputeClusterID(workspaceID.SubscriptionId, workspaceID.ResourceGroup, workspaceID.Name, d.Get("name").(string)) + id := machinelearningcomputes.NewComputeID(workspaceID.SubscriptionId, workspaceID.ResourceGroupName, workspaceID.WorkspaceName, d.Get("name").(string)) - existing, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName) + existing, err := client.ComputeGet(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for presence of existing %s: %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_machine_learning_compute_cluster", id.ID()) } - computeClusterAmlComputeProperties := machinelearningservices.AmlComputeProperties{ - VMSize: utils.String(d.Get("vm_size").(string)), - VMPriority: machinelearningservices.VMPriority(d.Get("vm_priority").(string)), + vmPriority := machinelearningcomputes.VmPriority(d.Get("vm_priority").(string)) + computeClusterAmlComputeProperties := machinelearningcomputes.AmlComputeProperties{ + VmSize: utils.String(d.Get("vm_size").(string)), + VmPriority: &vmPriority, ScaleSettings: expandScaleSettings(d.Get("scale_settings").([]interface{})), UserAccountCredentials: expandUserAccountCredentials(d.Get("ssh").([]interface{})), } - computeClusterAmlComputeProperties.RemoteLoginPortPublicAccess = machinelearningservices.RemoteLoginPortPublicAccessDisabled + computeClusterAmlComputeProperties.RemoteLoginPortPublicAccess = utils.ToPtr(machinelearningcomputes.RemoteLoginPortPublicAccessDisabled) if d.Get("ssh_public_access_enabled").(bool) { - computeClusterAmlComputeProperties.RemoteLoginPortPublicAccess = machinelearningservices.RemoteLoginPortPublicAccessEnabled + computeClusterAmlComputeProperties.RemoteLoginPortPublicAccess = utils.ToPtr(machinelearningcomputes.RemoteLoginPortPublicAccessEnabled) } if subnetId, ok := d.GetOk("subnet_resource_id"); ok && subnetId.(string) != "" { - computeClusterAmlComputeProperties.Subnet = &machinelearningservices.ResourceID{ID: utils.String(subnetId.(string))} + computeClusterAmlComputeProperties.Subnet = &machinelearningcomputes.ResourceId{Id: subnetId.(string)} } - computeClusterProperties := machinelearningservices.AmlCompute{ + computeClusterProperties := machinelearningcomputes.AmlCompute{ Properties: &computeClusterAmlComputeProperties, ComputeLocation: utils.String(d.Get("location").(string)), Description: utils.String(d.Get("description").(string)), @@ -196,7 +199,7 @@ func resourceComputeClusterCreate(d *pluginsdk.ResourceData, meta interface{}) e } // Get SKU from Workspace - workspace, err := mlWorkspacesClient.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name) + workspace, err := mlWorkspacesClient.Get(ctx, *workspaceID) if err != nil { return err } @@ -206,19 +209,22 @@ func resourceComputeClusterCreate(d *pluginsdk.ResourceData, meta interface{}) e return fmt.Errorf("expanding `identity`: %+v", err) } - computeClusterParameters := machinelearningservices.ComputeResource{ + computeClusterParameters := machinelearningcomputes.ComputeResource{ Properties: computeClusterProperties, Identity: identity, Location: computeClusterProperties.ComputeLocation, Tags: tags.Expand(d.Get("tags").(map[string]interface{})), - Sku: workspace.Sku, + Sku: &machinelearningcomputes.Sku{ + Name: workspace.Model.Sku.Name, + Tier: utils.ToPtr(machinelearningcomputes.SkuTier(*workspace.Model.Sku.Tier)), + }, } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName, computeClusterParameters) + future, err := client.ComputeCreateOrUpdate(ctx, id, computeClusterParameters) if err != nil { return fmt.Errorf("creating %s: %+v", id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err := future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for creation of %s: %+v", id, err) } @@ -232,14 +238,14 @@ func resourceComputeClusterRead(d *pluginsdk.ResourceData, meta interface{}) err ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ComputeClusterID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return fmt.Errorf("parsing Compute Cluster ID `%q`: %+v", d.Id(), err) } - computeResource, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName) + computeResource, err := client.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(computeResource.Response) { + if response.WasNotFound(computeResource.HttpResponse) { d.SetId("") return nil } @@ -248,43 +254,40 @@ func resourceComputeClusterRead(d *pluginsdk.ResourceData, meta interface{}) err d.Set("name", id.ComputeName) - workspaceId := parse.NewWorkspaceID(id.SubscriptionId, id.ResourceGroup, id.WorkspaceName) + workspaceId := workspaces.NewWorkspaceID(id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) d.Set("machine_learning_workspace_id", workspaceId.ID()) // use ComputeResource to get to AKS Cluster ID and other properties - computeCluster, isComputeCluster := machinelearningservices.BasicCompute.AsAmlCompute(computeResource.Properties) - if !isComputeCluster { - return fmt.Errorf("compute resource %s is not an AML Compute cluster", id.ComputeName) - } + computeCluster := computeResource.Model.Properties.(machinelearningcomputes.AmlCompute) if computeCluster.DisableLocalAuth != nil { d.Set("local_auth_enabled", !*computeCluster.DisableLocalAuth) } d.Set("description", computeCluster.Description) if props := computeCluster.Properties; props != nil { - d.Set("vm_size", props.VMSize) - d.Set("vm_priority", props.VMPriority) + d.Set("vm_size", props.VmSize) + d.Set("vm_priority", props.VmPriority) d.Set("scale_settings", flattenScaleSettings(props.ScaleSettings)) d.Set("ssh", flattenUserAccountCredentials(props.UserAccountCredentials)) if props.Subnet != nil { - d.Set("subnet_resource_id", props.Subnet.ID) + d.Set("subnet_resource_id", props.Subnet.Id) } - switch props.RemoteLoginPortPublicAccess { - case machinelearningservices.RemoteLoginPortPublicAccessNotSpecified: + switch *props.RemoteLoginPortPublicAccess { + case machinelearningcomputes.RemoteLoginPortPublicAccessNotSpecified: d.Set("ssh_public_access_enabled", nil) - case machinelearningservices.RemoteLoginPortPublicAccessEnabled: + case machinelearningcomputes.RemoteLoginPortPublicAccessEnabled: d.Set("ssh_public_access_enabled", true) - case machinelearningservices.RemoteLoginPortPublicAccessDisabled: + case machinelearningcomputes.RemoteLoginPortPublicAccessDisabled: d.Set("ssh_public_access_enabled", false) } } - if location := computeResource.Location; location != nil { + if location := computeResource.Model.Location; location != nil { d.Set("location", azure.NormalizeLocation(*location)) } - identity, err := flattenIdentity(computeResource.Identity) + identity, err := flattenIdentity(computeResource.Model.Identity) if err != nil { return fmt.Errorf("flattening `identity`: %+v", err) } @@ -292,7 +295,7 @@ func resourceComputeClusterRead(d *pluginsdk.ResourceData, meta interface{}) err return fmt.Errorf("setting `identity`: %+v", err) } - return tags.FlattenAndSet(d, computeResource.Tags) + return tags.FlattenAndSet(d, computeResource.Model.Tags) } func resourceComputeClusterDelete(d *pluginsdk.ResourceData, meta interface{}) error { @@ -300,53 +303,55 @@ func resourceComputeClusterDelete(d *pluginsdk.ResourceData, meta interface{}) e ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ComputeClusterID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName, machinelearningservices.UnderlyingResourceActionDelete) + future, err := client.ComputeDelete(ctx, *id, machinelearningcomputes.ComputeDeleteOperationOptions{ + UnderlyingResourceAction: utils.ToPtr(machinelearningcomputes.UnderlyingResourceActionDelete), + }) if err != nil { return fmt.Errorf("deleting %s: %+v", *id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err := future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for deletion of %s: %+v", *id, err) } return nil } -func expandScaleSettings(input []interface{}) *machinelearningservices.ScaleSettings { +func expandScaleSettings(input []interface{}) *machinelearningcomputes.ScaleSettings { if len(input) == 0 { return nil } v := input[0].(map[string]interface{}) - maxNodeCount := int32(v["max_node_count"].(int)) - minNodeCount := int32(v["min_node_count"].(int)) + maxNodeCount := int64(v["max_node_count"].(int)) + minNodeCount := int64(v["min_node_count"].(int)) scaleDownNodes := v["scale_down_nodes_after_idle_duration"].(string) - return &machinelearningservices.ScaleSettings{ - MaxNodeCount: &maxNodeCount, + return &machinelearningcomputes.ScaleSettings{ + MaxNodeCount: maxNodeCount, MinNodeCount: &minNodeCount, NodeIdleTimeBeforeScaleDown: &scaleDownNodes, } } -func expandUserAccountCredentials(input []interface{}) *machinelearningservices.UserAccountCredentials { +func expandUserAccountCredentials(input []interface{}) *machinelearningcomputes.UserAccountCredentials { if len(input) == 0 { return nil } v := input[0].(map[string]interface{}) - return &machinelearningservices.UserAccountCredentials{ - AdminUserName: utils.String(v["admin_username"].(string)), + return &machinelearningcomputes.UserAccountCredentials{ + AdminUserName: v["admin_username"].(string), AdminUserPassword: utils.String(v["admin_password"].(string)), - AdminUserSSHPublicKey: utils.String(v["key_value"].(string)), + AdminUserSshPublicKey: utils.String(v["key_value"].(string)), } } -func flattenScaleSettings(scaleSettings *machinelearningservices.ScaleSettings) []interface{} { +func flattenScaleSettings(scaleSettings *machinelearningcomputes.ScaleSettings) []interface{} { if scaleSettings == nil { return []interface{}{} } @@ -360,13 +365,13 @@ func flattenScaleSettings(scaleSettings *machinelearningservices.ScaleSettings) } } -func flattenUserAccountCredentials(credentials *machinelearningservices.UserAccountCredentials) interface{} { +func flattenUserAccountCredentials(credentials *machinelearningcomputes.UserAccountCredentials) interface{} { if credentials == nil { return []interface{}{} } var username string - if credentials.AdminUserName != nil { - username = *credentials.AdminUserName + if credentials.AdminUserName != "" { + username = credentials.AdminUserName } var adminPassword string @@ -375,8 +380,8 @@ func flattenUserAccountCredentials(credentials *machinelearningservices.UserAcco } var sshPublicKey string - if credentials.AdminUserSSHPublicKey != nil { - sshPublicKey = *credentials.AdminUserSSHPublicKey + if credentials.AdminUserSshPublicKey != nil { + sshPublicKey = *credentials.AdminUserSshPublicKey } return []interface{}{ diff --git a/internal/services/machinelearning/machine_learning_compute_cluster_resource_test.go b/internal/services/machinelearning/machine_learning_compute_cluster_resource_test.go index 0b6f2d817f9b..3573ede9dafc 100644 --- a/internal/services/machinelearning/machine_learning_compute_cluster_resource_test.go +++ b/internal/services/machinelearning/machine_learning_compute_cluster_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -148,19 +149,19 @@ func TestAccComputeCluster_identity(t *testing.T) { func (r ComputeClusterResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { computeClusterClient := client.MachineLearning.ComputeClient - id, err := parse.ComputeClusterID(state.ID) + id, err := machinelearningcomputes.ParseComputeID(state.ID) if err != nil { return nil, err } - computeResource, err := computeClusterClient.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName) + computeResource, err := computeClusterClient.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(computeResource.Response) { + if response.WasNotFound(computeResource.HttpResponse) { return utils.Bool(false), nil } return nil, fmt.Errorf("retrieving Machine Learning Compute Cluster %q: %+v", state.ID, err) } - return utils.Bool(computeResource.Properties != nil), nil + return utils.Bool(computeResource.Model.Properties != nil), nil } func (r ComputeClusterResource) basic(data acceptance.TestData) string { diff --git a/internal/services/machinelearning/machine_learning_compute_instance_resource.go b/internal/services/machinelearning/machine_learning_compute_instance_resource.go index fcb7945c7740..d7fc8e8c7b8a 100644 --- a/internal/services/machinelearning/machine_learning_compute_instance_resource.go +++ b/internal/services/machinelearning/machine_learning_compute_instance_resource.go @@ -7,9 +7,12 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" @@ -17,7 +20,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/validate" networkValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -72,7 +74,7 @@ func resourceComputeInstance() *pluginsdk.Resource { Optional: true, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - string(machinelearningservices.ComputeInstanceAuthorizationTypePersonal), + string(machinelearningcomputes.ComputeInstanceAuthorizationTypePersonal), }, false), }, @@ -145,7 +147,7 @@ func resourceComputeInstance() *pluginsdk.Resource { ValidateFunc: networkValidate.SubnetID, }, - "tags": tags.ForceNewSchema(), + "tags": commonschema.TagsForceNew(), }, } } @@ -156,17 +158,17 @@ func resourceComputeInstanceCreate(d *pluginsdk.ResourceData, meta interface{}) ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - workspaceID, _ := parse.WorkspaceID(d.Get("machine_learning_workspace_id").(string)) - id := parse.NewComputeID(subscriptionId, workspaceID.ResourceGroup, workspaceID.Name, d.Get("name").(string)) + workspaceID, _ := workspaces.ParseWorkspaceID(d.Get("machine_learning_workspace_id").(string)) + id := machinelearningcomputes.NewComputeID(subscriptionId, workspaceID.ResourceGroupName, workspaceID.WorkspaceName, d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + existing, err := client.ComputeGet(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for existing Machine Learning Compute (%q): %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_machine_learning_compute_instance", id.ID()) } } @@ -176,36 +178,42 @@ func resourceComputeInstanceCreate(d *pluginsdk.ResourceData, meta interface{}) return fmt.Errorf("expanding `identity`: %+v", err) } - var subnet *machinelearningservices.ResourceID + var subnet *machinelearningcomputes.ResourceId if subnetId, ok := d.GetOk("subnet_resource_id"); ok { - subnet = &machinelearningservices.ResourceID{ - ID: utils.String(subnetId.(string)), + subnet = &machinelearningcomputes.ResourceId{ + Id: subnetId.(string), } } - parameters := machinelearningservices.ComputeResource{ - Properties: &machinelearningservices.ComputeInstance{ - Properties: &machinelearningservices.ComputeInstanceProperties{ - VMSize: utils.String(d.Get("virtual_machine_size").(string)), - Subnet: subnet, - SSHSettings: expandComputeSSHSetting(d.Get("ssh").([]interface{})), - ComputeInstanceAuthorizationType: machinelearningservices.ComputeInstanceAuthorizationType(d.Get("authorization_type").(string)), - PersonalComputeInstanceSettings: expandComputePersonalComputeInstanceSetting(d.Get("assign_to_user").([]interface{})), - }, - ComputeLocation: utils.String(d.Get("location").(string)), - Description: utils.String(d.Get("description").(string)), - DisableLocalAuth: utils.Bool(!d.Get("local_auth_enabled").(bool)), + computeInstance := &machinelearningcomputes.ComputeInstance{ + Properties: &machinelearningcomputes.ComputeInstanceProperties{ + VmSize: utils.String(d.Get("virtual_machine_size").(string)), + Subnet: subnet, + SshSettings: expandComputeSSHSetting(d.Get("ssh").([]interface{})), + PersonalComputeInstanceSettings: expandComputePersonalComputeInstanceSetting(d.Get("assign_to_user").([]interface{})), }, - Identity: identity, - Location: utils.String(location.Normalize(d.Get("location").(string))), - Tags: tags.Expand(d.Get("tags").(map[string]interface{})), + ComputeLocation: utils.String(d.Get("location").(string)), + Description: utils.String(d.Get("description").(string)), + DisableLocalAuth: utils.Bool(!d.Get("local_auth_enabled").(bool)), + } + authType := d.Get("authorization_type").(string) + if authType != "" { + computeInstance.Properties.ComputeInstanceAuthorizationType = utils.ToPtr(machinelearningcomputes.ComputeInstanceAuthorizationType(authType)) + + } + + parameters := machinelearningcomputes.ComputeResource{ + Properties: computeInstance, + Identity: identity, + Location: utils.String(location.Normalize(d.Get("location").(string))), + Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.WorkspaceName, id.Name, parameters) + future, err := client.ComputeCreateOrUpdate(ctx, id, parameters) if err != nil { return fmt.Errorf("creating Machine Learning Compute (%q): %+v", id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err := future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for creation of Machine Learning Compute (%q): %+v", id, err) } @@ -220,14 +228,14 @@ func resourceComputeInstanceRead(d *pluginsdk.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ComputeID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + resp, err := client.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[INFO] Machine Learning Compute %q does not exist - removing from state", d.Id()) d.SetId("") return nil @@ -235,15 +243,15 @@ func resourceComputeInstanceRead(d *pluginsdk.ResourceData, meta interface{}) er return fmt.Errorf("retrieving Machine Learning Compute (%q): %+v", id, err) } - d.Set("name", id.Name) - workspaceId := parse.NewWorkspaceID(subscriptionId, id.ResourceGroup, id.WorkspaceName) + d.Set("name", id.ComputeName) + workspaceId := workspaces.NewWorkspaceID(subscriptionId, id.ResourceGroupName, id.WorkspaceName) d.Set("machine_learning_workspace_id", workspaceId.ID()) - if location := resp.Location; location != nil { + if location := resp.Model.Location; location != nil { d.Set("location", azure.NormalizeLocation(*location)) } - identity, err := flattenIdentity(resp.Identity) + identity, err := flattenIdentity(resp.Model.Identity) if err != nil { return fmt.Errorf("flattening `identity`: %+v", err) } @@ -251,87 +259,87 @@ func resourceComputeInstanceRead(d *pluginsdk.ResourceData, meta interface{}) er return fmt.Errorf("setting `identity`: %+v", err) } - if props, ok := resp.Properties.AsComputeInstance(); ok && props != nil { - if props.DisableLocalAuth != nil { - d.Set("local_auth_enabled", !*props.DisableLocalAuth) - } - d.Set("description", props.Description) - if props.Properties != nil { - d.Set("virtual_machine_size", props.Properties.VMSize) - if props.Properties.Subnet != nil { - d.Set("subnet_resource_id", props.Properties.Subnet.ID) - } - d.Set("authorization_type", props.Properties.ComputeInstanceAuthorizationType) - d.Set("ssh", flattenComputeSSHSetting(props.Properties.SSHSettings)) - d.Set("assign_to_user", flattenComputePersonalComputeInstanceSetting(props.Properties.PersonalComputeInstanceSettings)) + props := resp.Model.Properties.(machinelearningcomputes.ComputeInstance) + + if props.DisableLocalAuth != nil { + d.Set("local_auth_enabled", !*props.DisableLocalAuth) + } + d.Set("description", props.Description) + if props.Properties != nil { + d.Set("virtual_machine_size", props.Properties.VmSize) + if props.Properties.Subnet != nil { + d.Set("subnet_resource_id", props.Properties.Subnet.Id) } - } else { - return fmt.Errorf("compute resource %s is not a ComputeInstance Compute", id) + d.Set("authorization_type", props.Properties.ComputeInstanceAuthorizationType) + d.Set("ssh", flattenComputeSSHSetting(props.Properties.SshSettings)) + d.Set("assign_to_user", flattenComputePersonalComputeInstanceSetting(props.Properties.PersonalComputeInstanceSettings)) } - return tags.FlattenAndSet(d, resp.Tags) + return tags.FlattenAndSet(d, resp.Model.Tags) } func resourceComputeInstanceDelete(d *pluginsdk.ResourceData, meta interface{}) error { client := meta.(*clients.Client).MachineLearning.ComputeClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ComputeID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.WorkspaceName, id.Name, machinelearningservices.UnderlyingResourceActionDelete) + future, err := client.ComputeDelete(ctx, *id, machinelearningcomputes.ComputeDeleteOperationOptions{ + UnderlyingResourceAction: utils.ToPtr(machinelearningcomputes.UnderlyingResourceActionDelete), + }) if err != nil { return fmt.Errorf("deleting Machine Learning Compute (%q): %+v", id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err := future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for deletion of the Machine Learning Compute (%q): %+v", id, err) } return nil } -func expandComputePersonalComputeInstanceSetting(input []interface{}) *machinelearningservices.PersonalComputeInstanceSettings { +func expandComputePersonalComputeInstanceSetting(input []interface{}) *machinelearningcomputes.PersonalComputeInstanceSettings { if len(input) == 0 || input[0] == nil { return nil } value := input[0].(map[string]interface{}) - return &machinelearningservices.PersonalComputeInstanceSettings{ - AssignedUser: &machinelearningservices.AssignedUser{ - ObjectID: utils.String(value["object_id"].(string)), - TenantID: utils.String(value["tenant_id"].(string)), + return &machinelearningcomputes.PersonalComputeInstanceSettings{ + AssignedUser: &machinelearningcomputes.AssignedUser{ + ObjectId: value["object_id"].(string), + TenantId: value["tenant_id"].(string), }, } } -func expandComputeSSHSetting(input []interface{}) *machinelearningservices.ComputeInstanceSSHSettings { +func expandComputeSSHSetting(input []interface{}) *machinelearningcomputes.ComputeInstanceSshSettings { if len(input) == 0 { - return &machinelearningservices.ComputeInstanceSSHSettings{ - SSHPublicAccess: machinelearningservices.SSHPublicAccessDisabled, + return &machinelearningcomputes.ComputeInstanceSshSettings{ + SshPublicAccess: utils.ToPtr(machinelearningcomputes.SshPublicAccessDisabled), } } value := input[0].(map[string]interface{}) - return &machinelearningservices.ComputeInstanceSSHSettings{ - SSHPublicAccess: machinelearningservices.SSHPublicAccessEnabled, + return &machinelearningcomputes.ComputeInstanceSshSettings{ + SshPublicAccess: utils.ToPtr(machinelearningcomputes.SshPublicAccessEnabled), AdminPublicKey: utils.String(value["public_key"].(string)), } } -func flattenComputePersonalComputeInstanceSetting(settings *machinelearningservices.PersonalComputeInstanceSettings) interface{} { +func flattenComputePersonalComputeInstanceSetting(settings *machinelearningcomputes.PersonalComputeInstanceSettings) interface{} { if settings == nil || settings.AssignedUser == nil { return []interface{}{} } return []interface{}{ map[string]interface{}{ - "tenant_id": settings.AssignedUser.TenantID, - "object_id": settings.AssignedUser.ObjectID, + "tenant_id": settings.AssignedUser.TenantId, + "object_id": settings.AssignedUser.ObjectId, }, } } -func flattenComputeSSHSetting(settings *machinelearningservices.ComputeInstanceSSHSettings) interface{} { - if settings == nil || strings.EqualFold(string(settings.SSHPublicAccess), string(machinelearningservices.SSHPublicAccessDisabled)) { +func flattenComputeSSHSetting(settings *machinelearningcomputes.ComputeInstanceSshSettings) interface{} { + if settings == nil || strings.EqualFold(string(*settings.SshPublicAccess), string(machinelearningcomputes.SshPublicAccessDisabled)) { return []interface{}{} } @@ -339,7 +347,7 @@ func flattenComputeSSHSetting(settings *machinelearningservices.ComputeInstanceS map[string]interface{}{ "public_key": settings.AdminPublicKey, "username": settings.AdminUserName, - "port": settings.SSHPort, + "port": settings.SshPort, }, } } diff --git a/internal/services/machinelearning/machine_learning_compute_instance_resource_test.go b/internal/services/machinelearning/machine_learning_compute_instance_resource_test.go index ff976386e365..0f7676612fb7 100644 --- a/internal/services/machinelearning/machine_learning_compute_instance_resource_test.go +++ b/internal/services/machinelearning/machine_learning_compute_instance_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -104,19 +105,19 @@ func TestAccComputeInstance_identity(t *testing.T) { func (r ComputeInstanceResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { computeClient := client.MachineLearning.ComputeClient - id, err := parse.ComputeID(state.ID) + id, err := machinelearningcomputes.ParseComputeID(state.ID) if err != nil { return nil, err } - computeResource, err := computeClient.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + computeResource, err := computeClient.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(computeResource.Response) { + if response.WasNotFound(computeResource.HttpResponse) { return utils.Bool(false), nil } return nil, fmt.Errorf("retrieving Machine Learning Compute Cluster %q: %+v", state.ID, err) } - return utils.Bool(computeResource.Properties != nil), nil + return utils.Bool(computeResource.Model.Properties != nil), nil } func (r ComputeInstanceResource) basic(data acceptance.TestData) string { @@ -324,12 +325,13 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_machine_learning_workspace" "test" { - name = "acctest-MLW%[5]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - application_insights_id = azurerm_application_insights.test.id - key_vault_id = azurerm_key_vault.test.id - storage_account_id = azurerm_storage_account.test.id + name = "acctest-MLW%[5]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + application_insights_id = azurerm_application_insights.test.id + key_vault_id = azurerm_key_vault.test.id + storage_account_id = azurerm_storage_account.test.id + public_network_access_enabled = true identity { type = "SystemAssigned" } diff --git a/internal/services/machinelearning/machine_learning_inference_cluster_resource.go b/internal/services/machinelearning/machine_learning_inference_cluster_resource.go index e9bb89b138b6..abdcb6cb1251 100644 --- a/internal/services/machinelearning/machine_learning_inference_cluster_resource.go +++ b/internal/services/machinelearning/machine_learning_inference_cluster_resource.go @@ -4,15 +4,17 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" "github.com/Azure/azure-sdk-for-go/services/preview/containerservice/mgmt/2022-03-02-preview/containerservice" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -66,11 +68,11 @@ func resourceAksInferenceCluster() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, ForceNew: true, - Default: string(machinelearningservices.ClusterPurposeFastProd), + Default: string(machinelearningcomputes.ClusterPurposeFastProd), ValidateFunc: validation.StringInSlice([]string{ - string(machinelearningservices.ClusterPurposeDevTest), - string(machinelearningservices.ClusterPurposeFastProd), - string(machinelearningservices.ClusterPurposeDenseProd), + string(machinelearningcomputes.ClusterPurposeDevTest), + string(machinelearningcomputes.ClusterPurposeFastProd), + string(machinelearningcomputes.ClusterPurposeDenseProd), }, false), }, @@ -128,7 +130,7 @@ func resourceAksInferenceCluster() *pluginsdk.Resource { }, }, - "tags": tags.ForceNewSchema(), + "tags": commonschema.TagsForceNew(), }, } } @@ -143,20 +145,21 @@ func resourceAksInferenceClusterCreate(d *pluginsdk.ResourceData, meta interface name := d.Get("name").(string) // Get Machine Learning Workspace Name and Resource Group from ID - workspaceID, err := parse.WorkspaceID(d.Get("machine_learning_workspace_id").(string)) + workspaceID, err := workspaces.ParseWorkspaceID(d.Get("machine_learning_workspace_id").(string)) if err != nil { return err } + computeId := machinelearningcomputes.NewComputeID(workspaceID.SubscriptionId, workspaceID.ResourceGroupName, workspaceID.WorkspaceName, d.Get("name").(string)) // Check if Inference Cluster already exists - existing, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + existing, err := client.ComputeGet(ctx, computeId) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("checking for existing Inference Cluster %q in Workspace %q (Resource Group %q): %s", name, workspaceID.Name, workspaceID.ResourceGroup, err) + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for existing Inference Cluster %q in Workspace %q (Resource Group %q): %s", name, workspaceID.WorkspaceName, workspaceID.ResourceGroupName, err) } } - if existing.ID != nil && *existing.ID != "" { - return tf.ImportAsExistsError("azurerm_machine_learning_inference_cluster", *existing.ID) + if existing.Model != nil && *existing.Model.Id != "" { + return tf.ImportAsExistsError("azurerm_machine_learning_inference_cluster", *existing.Model.Id) } // Get AKS Compute Properties @@ -174,22 +177,22 @@ func resourceAksInferenceClusterCreate(d *pluginsdk.ResourceData, meta interface return fmt.Errorf("expanding `identity`: %+v", err) } - inferenceClusterParameters := machinelearningservices.ComputeResource{ + inferenceClusterParameters := machinelearningcomputes.ComputeResource{ Properties: expandAksComputeProperties(&aks, d), Identity: identity, Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))), Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - future, err := client.CreateOrUpdate(ctx, workspaceID.ResourceGroup, workspaceID.Name, name, inferenceClusterParameters) + future, err := client.ComputeCreateOrUpdate(ctx, computeId, inferenceClusterParameters) if err != nil { - return fmt.Errorf("creating Inference Cluster %q in workspace %q (Resource Group %q): %+v", name, workspaceID.Name, workspaceID.ResourceGroup, err) + return fmt.Errorf("creating Inference Cluster %q in workspace %q (Resource Group %q): %+v", name, workspaceID.WorkspaceName, workspaceID.ResourceGroupName, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for creation of Inference Cluster %q in workspace %q (Resource Group %q): %+v", name, workspaceID.Name, workspaceID.ResourceGroup, err) + if err := future.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("waiting for creation of Inference Cluster %q in workspace %q (Resource Group %q): %+v", name, workspaceID.ResourceGroupName, workspaceID.ResourceGroupName, err) } subscriptionId := meta.(*clients.Client).Account.SubscriptionId - id := parse.NewInferenceClusterID(subscriptionId, workspaceID.ResourceGroup, workspaceID.Name, name) + id := machinelearningcomputes.NewComputeID(subscriptionId, workspaceID.ResourceGroupName, workspaceID.WorkspaceName, name) d.SetId(id.ID()) return resourceAksInferenceClusterRead(d, meta) @@ -200,7 +203,7 @@ func resourceAksInferenceClusterRead(d *pluginsdk.ResourceData, meta interface{} ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.InferenceClusterID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return err } @@ -208,42 +211,39 @@ func resourceAksInferenceClusterRead(d *pluginsdk.ResourceData, meta interface{} d.Set("name", id.ComputeName) // Check that Inference Cluster Response can be read - computeResource, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName) + computeResource, err := client.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(computeResource.Response) { + if response.WasNotFound(computeResource.HttpResponse) { d.SetId("") return nil } return fmt.Errorf("making Read request on Inference Cluster %q in Workspace %q (Resource Group %q): %+v", - id.ComputeName, id.WorkspaceName, id.ResourceGroup, err) + id.ComputeName, id.WorkspaceName, id.ResourceGroupName, err) } // Retrieve Machine Learning Workspace ID subscriptionId := meta.(*clients.Client).Account.SubscriptionId - workspaceId := parse.NewWorkspaceID(subscriptionId, id.ResourceGroup, id.WorkspaceName) + workspaceId := machinelearningcomputes.NewWorkspaceID(subscriptionId, id.ResourceGroupName, id.WorkspaceName) d.Set("machine_learning_workspace_id", workspaceId.ID()) // use ComputeResource to get to AKS Cluster ID and other properties - aksComputeProperties, isAks := (machinelearningservices.BasicCompute).AsAKS(computeResource.Properties) - if !isAks { - return fmt.Errorf("compute resource %s is not an AKS cluster", id.ComputeName) - } + aksComputeProperties := computeResource.Model.Properties.(machinelearningcomputes.AKS) // Retrieve AKS Cluster ID - aksId, err := parse.KubernetesClusterID(*aksComputeProperties.ResourceID) + aksId, err := parse.KubernetesClusterID(*aksComputeProperties.ResourceId) if err != nil { return err } d.Set("kubernetes_cluster_id", aksId.ID()) - d.Set("cluster_purpose", string(aksComputeProperties.Properties.ClusterPurpose)) + d.Set("cluster_purpose", aksComputeProperties.Properties.ClusterPurpose) d.Set("description", aksComputeProperties.Description) // Retrieve location - if location := computeResource.Location; location != nil { + if location := computeResource.Model.Location; location != nil { d.Set("location", azure.NormalizeLocation(*location)) } - identity, err := flattenIdentity(computeResource.Identity) + identity, err := flattenIdentity(computeResource.Model.Identity) if err != nil { return fmt.Errorf("flattening `identity`: %+v", err) } @@ -251,49 +251,51 @@ func resourceAksInferenceClusterRead(d *pluginsdk.ResourceData, meta interface{} return fmt.Errorf("setting `identity`: %+v", err) } - return tags.FlattenAndSet(d, computeResource.Tags) + return tags.FlattenAndSet(d, computeResource.Model.Tags) } func resourceAksInferenceClusterDelete(d *pluginsdk.ResourceData, meta interface{}) error { client := meta.(*clients.Client).MachineLearning.ComputeClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.InferenceClusterID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName, machinelearningservices.UnderlyingResourceActionDetach) + future, err := client.ComputeDelete(ctx, *id, machinelearningcomputes.ComputeDeleteOperationOptions{ + UnderlyingResourceAction: utils.ToPtr(machinelearningcomputes.UnderlyingResourceActionDetach), + }) if err != nil { return fmt.Errorf("deleting Inference Cluster %q in workspace %q (Resource Group %q): %+v", - id.ComputeName, id.WorkspaceName, id.ResourceGroup, err) + id.ComputeName, id.WorkspaceName, id.ResourceGroupName, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err := future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for deletion of Inference Cluster %q in workspace %q (Resource Group %q): %+v", - id.ComputeName, id.WorkspaceName, id.ResourceGroup, err) + id.ComputeName, id.WorkspaceName, id.ResourceGroupName, err) } return nil } -func expandAksComputeProperties(aks *containerservice.ManagedCluster, d *pluginsdk.ResourceData) machinelearningservices.AKS { +func expandAksComputeProperties(aks *containerservice.ManagedCluster, d *pluginsdk.ResourceData) machinelearningcomputes.AKS { fqdn := aks.PrivateFQDN if fqdn == nil { fqdn = aks.Fqdn } - return machinelearningservices.AKS{ - Properties: &machinelearningservices.AKSProperties{ + return machinelearningcomputes.AKS{ + Properties: &machinelearningcomputes.AKSSchemaProperties{ ClusterFqdn: utils.String(*fqdn), SslConfiguration: expandSSLConfig(d.Get("ssl").([]interface{})), - ClusterPurpose: machinelearningservices.ClusterPurpose(d.Get("cluster_purpose").(string)), + ClusterPurpose: utils.ToPtr(machinelearningcomputes.ClusterPurpose(d.Get("cluster_purpose").(string))), }, ComputeLocation: aks.Location, Description: utils.String(d.Get("description").(string)), - ResourceID: aks.ID, + ResourceId: aks.ID, } } -func expandSSLConfig(input []interface{}) *machinelearningservices.SslConfiguration { +func expandSSLConfig(input []interface{}) *machinelearningcomputes.SslConfiguration { if len(input) == 0 { return nil } @@ -312,8 +314,8 @@ func expandSSLConfig(input []interface{}) *machinelearningservices.SslConfigurat v["cname"] = "" } - return &machinelearningservices.SslConfiguration{ - Status: machinelearningservices.Status1(sslStatus), + return &machinelearningcomputes.SslConfiguration{ + Status: utils.ToPtr(machinelearningcomputes.SslConfigStatus(sslStatus)), Cert: utils.String(v["cert"].(string)), Key: utils.String(v["key"].(string)), Cname: utils.String(v["cname"].(string)), diff --git a/internal/services/machinelearning/machine_learning_inference_cluster_resource_test.go b/internal/services/machinelearning/machine_learning_inference_cluster_resource_test.go index e63526d896d0..2274c724b61b 100644 --- a/internal/services/machinelearning/machine_learning_inference_cluster_resource_test.go +++ b/internal/services/machinelearning/machine_learning_inference_cluster_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -147,20 +148,20 @@ func TestAccInferenceCluster_identity(t *testing.T) { func (r InferenceClusterResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { inferenceClusterClient := client.MachineLearning.ComputeClient - id, err := parse.InferenceClusterID(state.ID) + id, err := machinelearningcomputes.ParseComputeID(state.ID) if err != nil { return nil, err } - resp, err := inferenceClusterClient.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.ComputeName) + resp, err := inferenceClusterClient.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil } return nil, fmt.Errorf("retrieving Inference Cluster %q: %+v", state.ID, err) } - return utils.Bool(resp.Properties != nil), nil + return utils.Bool(resp.Model.Properties != nil), nil } func (r InferenceClusterResource) basic(data acceptance.TestData) string { diff --git a/internal/services/machinelearning/machine_learning_synapse_spark_resource.go b/internal/services/machinelearning/machine_learning_synapse_spark_resource.go index 36a591db68f2..458ebb6d24e0 100644 --- a/internal/services/machinelearning/machine_learning_synapse_spark_resource.go +++ b/internal/services/machinelearning/machine_learning_synapse_spark_resource.go @@ -6,16 +6,18 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/validate" synapseValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/synapse/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" @@ -80,7 +82,7 @@ func resourceSynapseSpark() *pluginsdk.Resource { ForceNew: true, }, - "tags": tags.ForceNewSchema(), + "tags": commonschema.TagsForceNew(), }, } } @@ -91,17 +93,17 @@ func resourceSynapseSparkCreate(d *pluginsdk.ResourceData, meta interface{}) err ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - workspaceID, _ := parse.WorkspaceID(d.Get("machine_learning_workspace_id").(string)) - id := parse.NewComputeID(subscriptionId, workspaceID.ResourceGroup, workspaceID.Name, d.Get("name").(string)) + workspaceID, _ := workspaces.ParseWorkspaceID(d.Get("machine_learning_workspace_id").(string)) + id := machinelearningcomputes.NewComputeID(subscriptionId, workspaceID.ResourceGroupName, workspaceID.WorkspaceName, d.Get("name").(string)) if d.IsNewResource() { - existing, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + existing, err := client.ComputeGet(ctx, id) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return fmt.Errorf("checking for existing Machine Learning Compute (%q): %+v", id, err) } } - if !utils.ResponseWasNotFound(existing.Response) { + if !response.WasNotFound(existing.HttpResponse) { return tf.ImportAsExistsError("azurerm_machine_learning_synapse_spark", id.ID()) } } @@ -111,12 +113,12 @@ func resourceSynapseSparkCreate(d *pluginsdk.ResourceData, meta interface{}) err return fmt.Errorf("expanding `identity`: %+v", err) } - parameters := machinelearningservices.ComputeResource{ - Properties: &machinelearningservices.SynapseSpark{ + parameters := machinelearningcomputes.ComputeResource{ + Properties: &machinelearningcomputes.SynapseSpark{ Properties: nil, ComputeLocation: utils.String(d.Get("location").(string)), Description: utils.String(d.Get("description").(string)), - ResourceID: utils.String(d.Get("synapse_spark_pool_id").(string)), + ResourceId: utils.String(d.Get("synapse_spark_pool_id").(string)), DisableLocalAuth: utils.Bool(!d.Get("local_auth_enabled").(bool)), }, Identity: identity, @@ -124,11 +126,11 @@ func resourceSynapseSparkCreate(d *pluginsdk.ResourceData, meta interface{}) err Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.WorkspaceName, id.Name, parameters) + future, err := client.ComputeCreateOrUpdate(ctx, id, parameters) if err != nil { return fmt.Errorf("creating Machine Learning Compute (%q): %+v", id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err := future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for creation of Machine Learning Compute (%q): %+v", id, err) } @@ -143,14 +145,14 @@ func resourceSynapseSparkRead(d *pluginsdk.ResourceData, meta interface{}) error ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ComputeID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return err } - resp, err := client.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + resp, err := client.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { log.Printf("[INFO] Machine Learning Compute %q does not exist - removing from state", d.Id()) d.SetId("") return nil @@ -158,15 +160,15 @@ func resourceSynapseSparkRead(d *pluginsdk.ResourceData, meta interface{}) error return fmt.Errorf("retrieving Machine Learning Compute (%q): %+v", id, err) } - d.Set("name", id.Name) - workspaceId := parse.NewWorkspaceID(subscriptionId, id.ResourceGroup, id.WorkspaceName) + d.Set("name", id.ComputeName) + workspaceId := parse.NewWorkspaceID(subscriptionId, id.ResourceGroupName, id.WorkspaceName) d.Set("machine_learning_workspace_id", workspaceId.ID()) - if location := resp.Location; location != nil { + if location := resp.Model.Location; location != nil { d.Set("location", azure.NormalizeLocation(*location)) } - identity, err := flattenIdentity(resp.Identity) + identity, err := flattenIdentity(resp.Model.Identity) if err != nil { return fmt.Errorf("flattening `identity`: %+v", err) } @@ -174,34 +176,33 @@ func resourceSynapseSparkRead(d *pluginsdk.ResourceData, meta interface{}) error return fmt.Errorf("setting `identity`: %+v", err) } - if props, ok := resp.Properties.AsSynapseSpark(); ok && props != nil { - if props.DisableLocalAuth != nil { - d.Set("local_auth_enabled", !*props.DisableLocalAuth) - } - d.Set("description", props.Description) - d.Set("synapse_spark_pool_id", props.ResourceID) - } else { - return fmt.Errorf("compute resource %s is not a SynapseSpark Compute", id) + props := resp.Model.Properties.(machinelearningcomputes.SynapseSpark) + if props.DisableLocalAuth != nil { + d.Set("local_auth_enabled", !*props.DisableLocalAuth) } + d.Set("description", props.Description) + d.Set("synapse_spark_pool_id", props.ResourceId) - return tags.FlattenAndSet(d, resp.Tags) + return tags.FlattenAndSet(d, resp.Model.Tags) } func resourceSynapseSparkDelete(d *pluginsdk.ResourceData, meta interface{}) error { client := meta.(*clients.Client).MachineLearning.ComputeClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.ComputeID(d.Id()) + id, err := machinelearningcomputes.ParseComputeID(d.Id()) if err != nil { return err } - future, err := client.Delete(ctx, id.ResourceGroup, id.WorkspaceName, id.Name, machinelearningservices.UnderlyingResourceActionDetach) + future, err := client.ComputeDelete(ctx, *id, machinelearningcomputes.ComputeDeleteOperationOptions{ + UnderlyingResourceAction: utils.ToPtr(machinelearningcomputes.UnderlyingResourceActionDetach), + }) if err != nil { return fmt.Errorf("deleting Machine Learning Compute (%q): %+v", id, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err := future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for deletion of the Machine Learning Compute (%q): %+v", id, err) } return nil diff --git a/internal/services/machinelearning/machine_learning_synapse_spark_resource_test.go b/internal/services/machinelearning/machine_learning_synapse_spark_resource_test.go index f26b40177307..a0a0d646e693 100644 --- a/internal/services/machinelearning/machine_learning_synapse_spark_resource_test.go +++ b/internal/services/machinelearning/machine_learning_synapse_spark_resource_test.go @@ -5,10 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -102,19 +103,19 @@ func TestAccSynapseSpark_identity(t *testing.T) { func (r SynapseSparkResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { computeClient := client.MachineLearning.ComputeClient - id, err := parse.ComputeID(state.ID) + id, err := machinelearningcomputes.ParseComputeID(state.ID) if err != nil { return nil, err } - computeResource, err := computeClient.Get(ctx, id.ResourceGroup, id.WorkspaceName, id.Name) + computeResource, err := computeClient.ComputeGet(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(computeResource.Response) { + if response.WasNotFound(computeResource.HttpResponse) { return utils.Bool(false), nil } return nil, fmt.Errorf("retrieving Machine Learning Compute Cluster %q: %+v", state.ID, err) } - return utils.Bool(computeResource.Properties != nil), nil + return utils.Bool(computeResource.Model.Properties != nil), nil } func (r SynapseSparkResource) basic(data acceptance.TestData) string { diff --git a/internal/services/machinelearning/machine_learning_workspace_data_source.go b/internal/services/machinelearning/machine_learning_workspace_data_source.go index 40827984f951..79b1d254ad37 100644 --- a/internal/services/machinelearning/machine_learning_workspace_data_source.go +++ b/internal/services/machinelearning/machine_learning_workspace_data_source.go @@ -4,15 +4,15 @@ import ( "fmt" "time" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" - "github.com/hashicorp/terraform-provider-azurerm/utils" ) func dataSourceMachineLearningWorkspace() *pluginsdk.Resource { @@ -35,7 +35,7 @@ func dataSourceMachineLearningWorkspace() *pluginsdk.Resource { "identity": commonschema.SystemAssignedUserAssignedIdentityComputed(), - "tags": tags.SchemaDataSource(), + "tags": commonschema.TagsDataSource(), }, } } @@ -46,22 +46,22 @@ func dataSourceMachineLearningWorkspaceRead(d *pluginsdk.ResourceData, meta inte ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewWorkspaceID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - resp, err := client.Get(ctx, id.ResourceGroup, id.Name) + id := workspaces.NewWorkspaceID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + resp, err := client.Get(ctx, id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return fmt.Errorf("%s was not found", id) } return fmt.Errorf("retrieving %s: %+v", id, err) } d.SetId(id.ID()) - d.Set("name", id.Name) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("name", id.WorkspaceName) + d.Set("resource_group_name", id.ResourceGroupName) - d.Set("location", location.NormalizeNilable(resp.Location)) + d.Set("location", location.NormalizeNilable(resp.Model.Location)) - flattenedIdentity, err := flattenMachineLearningWorkspaceIdentity(resp.Identity) + flattenedIdentity, err := flattenMachineLearningWorkspaceIdentity(resp.Model.Identity) if err != nil { return fmt.Errorf("flattening `identity`: %+v", err) } @@ -69,5 +69,5 @@ func dataSourceMachineLearningWorkspaceRead(d *pluginsdk.ResourceData, meta inte return fmt.Errorf("setting `identity`: %+v", err) } - return tags.FlattenAndSet(d, resp.Tags) + return tags.FlattenAndSet(d, resp.Model.Tags) } diff --git a/internal/services/machinelearning/machine_learning_workspace_resource.go b/internal/services/machinelearning/machine_learning_workspace_resource.go index 75cc2ad9cb8b..48df6e01c480 100644 --- a/internal/services/machinelearning/machine_learning_workspace_resource.go +++ b/internal/services/machinelearning/machine_learning_workspace_resource.go @@ -4,10 +4,12 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" + "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -18,7 +20,6 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/validate" storageValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/validate" - "github.com/hashicorp/terraform-provider-azurerm/internal/tags" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/suppress" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" @@ -34,9 +35,9 @@ const ( func resourceMachineLearningWorkspace() *pluginsdk.Resource { resource := &pluginsdk.Resource{ - Create: resourceMachineLearningWorkspaceCreate, + Create: resourceMachineLearningWorkspaceCreateOrUpdate, Read: resourceMachineLearningWorkspaceRead, - Update: resourceMachineLearningWorkspaceUpdate, + Update: resourceMachineLearningWorkspaceCreateOrUpdate, Delete: resourceMachineLearningWorkspaceDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { @@ -107,14 +108,13 @@ func resourceMachineLearningWorkspace() *pluginsdk.Resource { DiffSuppressFunc: suppress.CaseDifference, }, - "public_access_behind_virtual_network_enabled": { + "public_network_access_enabled": { Type: pluginsdk.TypeBool, Optional: true, - Computed: !features.FourPointOhBeta(), - ForceNew: true, + Computed: true, ConflictsWith: func() []string { if !features.FourPointOhBeta() { - return []string{"public_network_access_enabled"} + return []string{"public_access_behind_virtual_network_enabled"} } return []string{} }(), @@ -176,12 +176,18 @@ func resourceMachineLearningWorkspace() *pluginsdk.Resource { ValidateFunc: validation.StringInSlice([]string{string(Basic)}, false), }, + "v1_legacy_mode_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: false, + }, + "discovery_url": { Type: pluginsdk.TypeString, Computed: true, }, - "tags": tags.Schema(), + "tags": commonschema.Tags(), }, } @@ -189,34 +195,35 @@ func resourceMachineLearningWorkspace() *pluginsdk.Resource { // For the time being we should just deprecate and remove this property since it's broken in the API - it doesn't // actually set the property and also isn't returned by the API. Once https://github.com/Azure/azure-rest-api-specs/issues/18340 // is fixed we can reassess how to deal with this field. - resource.Schema["public_network_access_enabled"] = &pluginsdk.Schema{ + resource.Schema["public_access_behind_virtual_network_enabled"] = &pluginsdk.Schema{ Type: pluginsdk.TypeBool, Optional: true, - Computed: true, ForceNew: true, - Deprecated: "`public_network_access_enabled` will be removed in favour of the property `public_access_behind_virtual_network_enabled` in version 4.0 of the AzureRM Provider.", - ConflictsWith: []string{"public_access_behind_virtual_network_enabled"}, + Deprecated: "`public_access_behind_virtual_network_enabled` will be removed in favour of the property `public_network_access_enabled` in version 4.0 of the AzureRM Provider.", + ConflictsWith: []string{"public_network_access_enabled"}, } } return resource } -func resourceMachineLearningWorkspaceCreate(d *pluginsdk.ResourceData, meta interface{}) error { +func resourceMachineLearningWorkspaceCreateOrUpdate(d *pluginsdk.ResourceData, meta interface{}) error { client := meta.(*clients.Client).MachineLearning.WorkspacesClient subscriptionId := meta.(*clients.Client).Account.SubscriptionId ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() - id := parse.NewWorkspaceID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) - existing, err := client.Get(ctx, id.ResourceGroup, id.Name) - if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + id := workspaces.NewWorkspaceID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + if d.IsNewResource() { + existing, err := client.Get(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return tf.ImportAsExistsError("azurerm_machine_learning_workspace", id.ID()) } - } - if !utils.ResponseWasNotFound(existing.Response) { - return tf.ImportAsExistsError("azurerm_machine_learning_workspace", id.ID()) } expandedIdentity, err := expandMachineLearningWorkspaceIdentity(d.Get("identity").([]interface{})) @@ -227,63 +234,65 @@ func resourceMachineLearningWorkspaceCreate(d *pluginsdk.ResourceData, meta inte expandedEncryption := expandMachineLearningWorkspaceEncryption(d.Get("encryption").([]interface{})) networkAccessBehindVnetEnabled := false - if !features.FourPointOhBeta() { - if v, ok := d.GetOkExists("public_network_access_enabled"); ok { - networkAccessBehindVnetEnabled = v.(bool) - } - } - if v, ok := d.GetOkExists("public_access_behind_virtual_network_enabled"); ok { + + if v, ok := d.GetOkExists("public_network_access_enabled"); ok { networkAccessBehindVnetEnabled = v.(bool) } - workspace := machinelearningservices.Workspace{ - Name: utils.String(id.Name), + workspace := workspaces.Workspace{ + Name: utils.String(id.WorkspaceName), Location: utils.String(azure.NormalizeLocation(d.Get("location").(string))), Tags: tags.Expand(d.Get("tags").(map[string]interface{})), - Sku: &machinelearningservices.Sku{ - Name: utils.String(d.Get("sku_name").(string)), - Tier: utils.String(d.Get("sku_name").(string)), + Sku: &workspaces.Sku{ + Name: d.Get("sku_name").(string), + Tier: utils.ToPtr(workspaces.SkuTier(d.Get("sku_name").(string))), }, + Identity: expandedIdentity, - WorkspaceProperties: &machinelearningservices.WorkspaceProperties{ - Encryption: expandedEncryption, - StorageAccount: utils.String(d.Get("storage_account_id").(string)), - ApplicationInsights: utils.String(d.Get("application_insights_id").(string)), - KeyVault: utils.String(d.Get("key_vault_id").(string)), - AllowPublicAccessWhenBehindVnet: utils.Bool(networkAccessBehindVnetEnabled), + Properties: &workspaces.WorkspaceProperties{ + V1LegacyMode: utils.ToPtr(d.Get("v1_legacy_mode_enabled").(bool)), + Encryption: expandedEncryption, + StorageAccount: utils.String(d.Get("storage_account_id").(string)), + ApplicationInsights: utils.String(d.Get("application_insights_id").(string)), + KeyVault: utils.String(d.Get("key_vault_id").(string)), + PublicNetworkAccess: utils.ToPtr(workspaces.PublicNetworkAccessDisabled), }, } + if networkAccessBehindVnetEnabled { + workspace.Properties.PublicNetworkAccess = utils.ToPtr(workspaces.PublicNetworkAccessEnabled) + } + if v, ok := d.GetOk("description"); ok { - workspace.WorkspaceProperties.Description = utils.String(v.(string)) + workspace.Properties.Description = utils.String(v.(string)) } if v, ok := d.GetOk("friendly_name"); ok { - workspace.WorkspaceProperties.FriendlyName = utils.String(v.(string)) + workspace.Properties.FriendlyName = utils.String(v.(string)) } if v, ok := d.GetOk("container_registry_id"); ok { - workspace.WorkspaceProperties.ContainerRegistry = utils.String(v.(string)) + workspace.Properties.ContainerRegistry = utils.String(v.(string)) } if v, ok := d.GetOk("high_business_impact"); ok { - workspace.WorkspaceProperties.HbiWorkspace = utils.Bool(v.(bool)) + workspace.Properties.HbiWorkspace = utils.Bool(v.(bool)) } if v, ok := d.GetOk("image_build_compute_name"); ok { - workspace.WorkspaceProperties.ImageBuildCompute = utils.String(v.(string)) + workspace.Properties.ImageBuildCompute = utils.String(v.(string)) } if v, ok := d.GetOk("primary_user_assigned_identity"); ok { - workspace.WorkspaceProperties.PrimaryUserAssignedIdentity = utils.String(v.(string)) + workspace.Properties.PrimaryUserAssignedIdentity = utils.String(v.(string)) } - future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.Name, workspace) + future, err := client.CreateOrUpdate(ctx, id, workspace) if err != nil { - return fmt.Errorf("creating %s: %+v", id, err) + return fmt.Errorf("creating/updating %s: %+v", id, err) } - if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + if err = future.Poller.PollUntilDone(); err != nil { return fmt.Errorf("waiting for the creation of %s: %+v", id, err) } @@ -296,32 +305,33 @@ func resourceMachineLearningWorkspaceRead(d *pluginsdk.ResourceData, meta interf ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.WorkspaceID(d.Id()) + id, err := workspaces.ParseWorkspaceID(d.Id()) if err != nil { + return fmt.Errorf("parsing Machine Learning Workspace ID `%q`: %+v", d.Id(), err) } - resp, err := client.Get(ctx, id.ResourceGroup, id.Name) + resp, err := client.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { d.SetId("") return nil } - return fmt.Errorf("making Read request on Workspace %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + return fmt.Errorf("making Read request on Workspace %q (Resource Group %q): %+v", id.WorkspaceName, id.ResourceGroupName, err) } - d.Set("name", id.Name) - d.Set("resource_group_name", id.ResourceGroup) + d.Set("name", id.WorkspaceName) + d.Set("resource_group_name", id.ResourceGroupName) - if location := resp.Location; location != nil { + if location := resp.Model.Location; location != nil { d.Set("location", azure.NormalizeLocation(*location)) } - if sku := resp.Sku; sku != nil { + if sku := resp.Model.Sku; sku != nil { d.Set("sku_name", sku.Name) } - if props := resp.WorkspaceProperties; props != nil { + if props := resp.Model.Properties; props != nil { d.Set("application_insights_id", props.ApplicationInsights) d.Set("storage_account_id", props.StorageAccount) d.Set("key_vault_id", props.KeyVault) @@ -330,85 +340,35 @@ func resourceMachineLearningWorkspaceRead(d *pluginsdk.ResourceData, meta interf d.Set("friendly_name", props.FriendlyName) d.Set("high_business_impact", props.HbiWorkspace) d.Set("image_build_compute_name", props.ImageBuildCompute) - d.Set("discovery_url", props.DiscoveryURL) + d.Set("discovery_url", props.DiscoveryUrl) d.Set("primary_user_assigned_identity", props.PrimaryUserAssignedIdentity) - d.Set("public_access_behind_virtual_network_enabled", props.AllowPublicAccessWhenBehindVnet) + d.Set("public_network_access_enabled", *props.PublicNetworkAccess == workspaces.PublicNetworkAccessEnabled) + d.Set("v1_legacy_mode_enabled", props.V1LegacyMode) if !features.FourPointOhBeta() { - d.Set("public_network_access_enabled", props.AllowPublicAccessWhenBehindVnet) + d.Set("public_access_behind_virtual_network_enabled", props.AllowPublicAccessWhenBehindVnet) } + } - flattenedIdentity, err := flattenMachineLearningWorkspaceIdentity(resp.Identity) + flattenedIdentity, err := flattenMachineLearningWorkspaceIdentity(resp.Model.Identity) if err != nil { return fmt.Errorf("flattening `identity`: %+v", err) } + if err := d.Set("identity", flattenedIdentity); err != nil { return fmt.Errorf("setting `identity`: %+v", err) } - flattenedEncryption, err := flattenMachineLearningWorkspaceEncryption(resp.Encryption) + flattenedEncryption, err := flattenMachineLearningWorkspaceEncryption(resp.Model.Properties.Encryption) if err != nil { return fmt.Errorf("flattening `encryption`: %+v", err) } if err := d.Set("encryption", flattenedEncryption); err != nil { - return fmt.Errorf("flattening encryption on Workspace %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) - } - - return tags.FlattenAndSet(d, resp.Tags) -} - -func resourceMachineLearningWorkspaceUpdate(d *pluginsdk.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).MachineLearning.WorkspacesClient - ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) - defer cancel() - - id, err := parse.WorkspaceID(d.Id()) - if err != nil { - return err - } - - update := machinelearningservices.WorkspaceUpdateParameters{ - WorkspacePropertiesUpdateParameters: &machinelearningservices.WorkspacePropertiesUpdateParameters{}, - } - - if d.HasChange("sku_name") { - skuName := d.Get("sku_name").(string) - update.Sku = &machinelearningservices.Sku{ - Name: &skuName, - Tier: &skuName, - } - } - - if d.HasChange("description") { - update.WorkspacePropertiesUpdateParameters.Description = utils.String(d.Get("description").(string)) - } - - if d.HasChange("friendly_name") { - update.WorkspacePropertiesUpdateParameters.FriendlyName = utils.String(d.Get("friendly_name").(string)) - } - - if d.HasChange("tags") { - update.Tags = tags.Expand(d.Get("tags").(map[string]interface{})) - } - - if d.HasChange("identity") { - identity, err := expandMachineLearningWorkspaceIdentity(d.Get("identity").([]interface{})) - if err != nil { - return err - } - update.Identity = identity - } - - if d.HasChange("primary_user_assigned_identity") { - update.WorkspacePropertiesUpdateParameters.PrimaryUserAssignedIdentity = utils.String(d.Get("primary_user_assigned_identity").(string)) - } - - if _, err := client.Update(ctx, id.ResourceGroup, id.Name, update); err != nil { - return fmt.Errorf("updating Machine Learning Workspace %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + return fmt.Errorf("flattening encryption on Workspace %q (Resource Group %q): %+v", id.WorkspaceName, id.ResourceGroupName, err) } - return resourceMachineLearningWorkspaceRead(d, meta) + return tags.FlattenAndSet(d, resp.Model.Tags) } func resourceMachineLearningWorkspaceDelete(d *pluginsdk.ResourceData, meta interface{}) error { @@ -416,40 +376,36 @@ func resourceMachineLearningWorkspaceDelete(d *pluginsdk.ResourceData, meta inte ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := parse.WorkspaceID(d.Id()) + id, err := workspaces.ParseWorkspaceID(d.Id()) if err != nil { return fmt.Errorf("parsing Machine Learning Workspace ID `%q`: %+v", d.Id(), err) } - future, err := client.Delete(ctx, id.ResourceGroup, id.Name) + future, err := client.Delete(ctx, *id) if err != nil { - return fmt.Errorf("deleting Machine Learning Workspace %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + return fmt.Errorf("deleting Machine Learning Workspace %q (Resource Group %q): %+v", id.WorkspaceName, id.ResourceGroupName, err) } - if err := future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("waiting for deletion of Machine Learning Workspace %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + if err := future.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("waiting for deletion of Machine Learning Workspace %q (Resource Group %q): %+v", id.WorkspaceName, id.ResourceGroupName, err) } return nil } -func expandMachineLearningWorkspaceIdentity(input []interface{}) (*machinelearningservices.Identity, error) { +func expandMachineLearningWorkspaceIdentity(input []interface{}) (*identity.LegacySystemAndUserAssignedMap, error) { expanded, err := identity.ExpandSystemAndUserAssignedMap(input) if err != nil { return nil, err } - out := machinelearningservices.Identity{ - Type: machinelearningservices.ResourceIdentityType(string(expanded.Type)), - } - // api uses `SystemAssigned,UserAssigned` (no space), so convert it from the normalized value - if expanded.Type == identity.TypeSystemAssignedUserAssigned { - out.Type = machinelearningservices.ResourceIdentityTypeSystemAssignedUserAssigned + out := identity.LegacySystemAndUserAssignedMap{ + Type: expanded.Type, } if len(expanded.IdentityIds) > 0 { - out.UserAssignedIdentities = make(map[string]*machinelearningservices.UserAssignedIdentity) + out.IdentityIds = map[string]identity.UserAssignedIdentityDetails{} for k := range expanded.IdentityIds { - out.UserAssignedIdentities[k] = &machinelearningservices.UserAssignedIdentity{ + out.IdentityIds[k] = identity.UserAssignedIdentityDetails{ // intentionally empty } } @@ -457,30 +413,33 @@ func expandMachineLearningWorkspaceIdentity(input []interface{}) (*machinelearni return &out, nil } -func flattenMachineLearningWorkspaceIdentity(input *machinelearningservices.Identity) (*[]interface{}, error) { +func flattenMachineLearningWorkspaceIdentity(input *identity.LegacySystemAndUserAssignedMap) (*[]interface{}, error) { var transform *identity.SystemAndUserAssignedMap if input != nil { transform = &identity.SystemAndUserAssignedMap{ - Type: identity.Type(string(input.Type)), + Type: input.Type, IdentityIds: make(map[string]identity.UserAssignedIdentityDetails), } // api uses `SystemAssigned,UserAssigned` (no space), so normalize it back - if input.Type == machinelearningservices.ResourceIdentityTypeSystemAssignedUserAssigned { + if input.Type == "SystemAssigned,UserAssigned" { transform.Type = identity.TypeSystemAssignedUserAssigned } - if input.PrincipalID != nil { - transform.PrincipalId = *input.PrincipalID + if input.PrincipalId != "" { + transform.PrincipalId = input.PrincipalId } - if input.TenantID != nil { - transform.TenantId = *input.TenantID + if input.TenantId != "" { + transform.TenantId = input.TenantId } - for k, v := range input.UserAssignedIdentities { - transform.IdentityIds[k] = identity.UserAssignedIdentityDetails{ - ClientId: v.ClientID, - PrincipalId: v.PrincipalID, + + if input != nil && input.IdentityIds != nil { + for k, v := range input.IdentityIds { + transform.IdentityIds[k] = identity.UserAssignedIdentityDetails{ + ClientId: v.ClientId, + PrincipalId: v.PrincipalId, + } } } } @@ -488,21 +447,21 @@ func flattenMachineLearningWorkspaceIdentity(input *machinelearningservices.Iden return identity.FlattenSystemAndUserAssignedMap(transform) } -func expandMachineLearningWorkspaceEncryption(input []interface{}) *machinelearningservices.EncryptionProperty { +func expandMachineLearningWorkspaceEncryption(input []interface{}) *workspaces.EncryptionProperty { if len(input) == 0 || input[0] == nil { return nil } raw := input[0].(map[string]interface{}) - out := machinelearningservices.EncryptionProperty{ - Identity: &machinelearningservices.IdentityForCmk{ + out := workspaces.EncryptionProperty{ + Identity: &workspaces.IdentityForCmk{ UserAssignedIdentity: nil, }, - KeyVaultProperties: &machinelearningservices.KeyVaultProperties{ - KeyVaultArmID: utils.String(raw["key_vault_id"].(string)), - KeyIdentifier: utils.String(raw["key_id"].(string)), + KeyVaultProperties: workspaces.EncryptionKeyVaultProperties{ + KeyVaultArmId: raw["key_vault_id"].(string), + KeyIdentifier: raw["key_id"].(string), }, - Status: machinelearningservices.EncryptionStatusEnabled, + Status: workspaces.EncryptionStatusEnabled, } if raw["user_assigned_identity_id"].(string) != "" { @@ -512,20 +471,19 @@ func expandMachineLearningWorkspaceEncryption(input []interface{}) *machinelearn return &out } -func flattenMachineLearningWorkspaceEncryption(input *machinelearningservices.EncryptionProperty) (*[]interface{}, error) { - if input == nil || input.Status != machinelearningservices.EncryptionStatusEnabled { +func flattenMachineLearningWorkspaceEncryption(input *workspaces.EncryptionProperty) (*[]interface{}, error) { + if input == nil || input.Status != workspaces.EncryptionStatusEnabled { return &[]interface{}{}, nil } keyVaultId := "" keyVaultKeyId := "" - if input.KeyVaultProperties != nil { - if input.KeyVaultProperties.KeyIdentifier != nil { - keyVaultKeyId = *input.KeyVaultProperties.KeyIdentifier - } - if input.KeyVaultProperties.KeyVaultArmID != nil { - keyVaultId = *input.KeyVaultProperties.KeyVaultArmID - } + + if input.KeyVaultProperties.KeyIdentifier != "" { + keyVaultKeyId = input.KeyVaultProperties.KeyIdentifier + } + if input.KeyVaultProperties.KeyVaultArmId != "" { + keyVaultId = input.KeyVaultProperties.KeyVaultArmId } userAssignedIdentityId := "" diff --git a/internal/services/machinelearning/machine_learning_workspace_resource_test.go b/internal/services/machinelearning/machine_learning_workspace_resource_test.go index 12164b372d53..1ae36e91530a 100644 --- a/internal/services/machinelearning/machine_learning_workspace_resource_test.go +++ b/internal/services/machinelearning/machine_learning_workspace_resource_test.go @@ -5,11 +5,11 @@ import ( "fmt" "testing" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" - "github.com/hashicorp/terraform-provider-azurerm/internal/features" - "github.com/hashicorp/terraform-provider-azurerm/internal/services/machinelearning/parse" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" ) @@ -180,6 +180,22 @@ func TestAccMachineLearningWorkspace_identityUpdate(t *testing.T) { ), }, data.ImportStep(), + { + Config: r.userAssignedIdentityUpdate(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.0.tenant_id").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccMachineLearningWorkspace_identityTypeUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_machine_learning_workspace", "test") + r := WorkspaceResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ { Config: r.systemAssignedUserAssignedIdentity(data), Check: acceptance.ComposeTestCheckFunc( @@ -189,10 +205,17 @@ func TestAccMachineLearningWorkspace_identityUpdate(t *testing.T) { }, data.ImportStep(), { - Config: r.basic(data), + Config: r.systemAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.0.tenant_id").Exists(), + ), + }, + data.ImportStep(), + { + Config: r.systemAssignedUserAssignedIdentity(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("identity.0.principal_id").Exists(), check.That(data.ResourceName).Key("identity.0.tenant_id").Exists(), ), }, @@ -238,20 +261,20 @@ func TestAccMachineLearningWorkspace_systemAssignedAndCustomManagedKey(t *testin func (r WorkspaceResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { workspacesClient := client.MachineLearning.WorkspacesClient - id, err := parse.WorkspaceID(state.ID) + id, err := workspaces.ParseWorkspaceID(state.ID) if err != nil { return nil, err } - resp, err := workspacesClient.Get(ctx, id.ResourceGroup, id.Name) + resp, err := workspacesClient.Get(ctx, *id) if err != nil { - if utils.ResponseWasNotFound(resp.Response) { + if response.WasNotFound(resp.HttpResponse) { return utils.Bool(false), nil } return nil, fmt.Errorf("retrieving Machine Learning Workspace %q: %+v", state.ID, err) } - return utils.Bool(resp.WorkspaceProperties != nil), nil + return utils.Bool(resp.Model.Properties != nil), nil } func (r WorkspaceResource) basic(data acceptance.TestData) string { @@ -271,7 +294,7 @@ resource "azurerm_machine_learning_workspace" "test" { type = "SystemAssigned" } } -`, template, data.RandomIntOfLength(16)) +`, template, data.RandomInteger) } func (r WorkspaceResource) basicUpdated(data acceptance.TestData) string { @@ -302,8 +325,7 @@ resource "azurerm_machine_learning_workspace" "test" { func (r WorkspaceResource) complete(data acceptance.TestData) string { template := r.template(data) - if !features.FourPointOhBeta() { - return fmt.Sprintf(` + return fmt.Sprintf(` %[1]s resource "azurerm_container_registry" "test" { @@ -346,65 +368,7 @@ resource "azurerm_machine_learning_workspace" "test" { high_business_impact = true public_network_access_enabled = true image_build_compute_name = "terraformCompute" - - identity { - type = "SystemAssigned" - } - - encryption { - key_vault_id = azurerm_key_vault.test.id - key_id = azurerm_key_vault_key.test.id - } - - tags = { - ENV = "Test" - } -} -`, template, data.RandomIntOfLength(16)) - } - return fmt.Sprintf(` -%[1]s - -resource "azurerm_container_registry" "test" { - name = "acctestacr%[2]d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - sku = "Standard" - admin_enabled = true -} - -resource "azurerm_key_vault_key" "test" { - name = "acctest-kv-key-%[2]d" - key_vault_id = azurerm_key_vault.test.id - key_type = "RSA" - key_size = 2048 - - key_opts = [ - "decrypt", - "encrypt", - "sign", - "unwrapKey", - "verify", - "wrapKey", - ] - - depends_on = [azurerm_key_vault.test, azurerm_key_vault_access_policy.test] -} - -resource "azurerm_machine_learning_workspace" "test" { - name = "acctest-MLW-%[2]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - friendly_name = "test-workspace" - description = "Test machine learning workspace" - application_insights_id = azurerm_application_insights.test.id - key_vault_id = azurerm_key_vault.test.id - storage_account_id = azurerm_storage_account.test.id - container_registry_id = azurerm_container_registry.test.id - sku_name = "Basic" - high_business_impact = true - public_access_behind_virtual_network_enabled = true - image_build_compute_name = "terraformCompute" + v1_legacy_mode_enabled = false identity { type = "SystemAssigned" @@ -454,19 +418,19 @@ resource "azurerm_key_vault_key" "test" { } resource "azurerm_machine_learning_workspace" "test" { - name = "acctest-MLW-%[2]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - friendly_name = "test-workspace-updated" - description = "Test machine learning workspace update" - application_insights_id = azurerm_application_insights.test.id - key_vault_id = azurerm_key_vault.test.id - storage_account_id = azurerm_storage_account.test.id - container_registry_id = azurerm_container_registry.test.id - sku_name = "Basic" - high_business_impact = true - public_access_behind_virtual_network_enabled = true - image_build_compute_name = "terraformCompute" + name = "acctest-MLW-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + friendly_name = "test-workspace-updated" + description = "Test machine learning workspace update" + application_insights_id = azurerm_application_insights.test.id + key_vault_id = azurerm_key_vault.test.id + storage_account_id = azurerm_storage_account.test.id + container_registry_id = azurerm_container_registry.test.id + sku_name = "Basic" + high_business_impact = true + public_network_access_enabled = true + image_build_compute_name = "terraformCompute" identity { type = "SystemAssigned" @@ -600,6 +564,55 @@ resource "azurerm_machine_learning_workspace" "test" { } `, r.template(data), data.RandomInteger) } +func (r WorkspaceResource) userAssignedIdentityUpdate(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s + +resource "azurerm_user_assigned_identity" "test" { + name = "acctestUAI-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_user_assigned_identity" "test2" { + name = "acctestUAI-%[3]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_role_assignment" "test" { + scope = azurerm_key_vault.test.id + role_definition_name = "Key Vault Reader" + principal_id = azurerm_user_assigned_identity.test.principal_id +} + +resource "azurerm_role_assignment" "test2" { + scope = azurerm_key_vault.test.id + role_definition_name = "Key Vault Reader" + principal_id = azurerm_user_assigned_identity.test2.principal_id +} + +resource "azurerm_machine_learning_workspace" "test" { + name = "acctest-MLW-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + application_insights_id = azurerm_application_insights.test.id + key_vault_id = azurerm_key_vault.test.id + storage_account_id = azurerm_storage_account.test.id + primary_user_assigned_identity = azurerm_user_assigned_identity.test.id + + identity { + type = "UserAssigned" + identity_ids = [ + azurerm_user_assigned_identity.test.id, + azurerm_user_assigned_identity.test2.id, + ] + } + + depends_on = [azurerm_role_assignment.test] +} +`, r.template(data), data.RandomInteger, data.RandomIntOfLength(8)) +} func (r WorkspaceResource) systemAssignedUserAssignedIdentity(data acceptance.TestData) string { return fmt.Sprintf(` @@ -629,6 +642,31 @@ resource "azurerm_machine_learning_workspace" "test" { `, r.template(data), data.RandomInteger) } +func (r WorkspaceResource) systemAssignedIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s + +resource "azurerm_user_assigned_identity" "test" { + name = "acctestUAI-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_machine_learning_workspace" "test" { + name = "acctest-MLW-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + application_insights_id = azurerm_application_insights.test.id + key_vault_id = azurerm_key_vault.test.id + storage_account_id = azurerm_storage_account.test.id + + identity { + type = "SystemAssigned" + } +} +`, r.template(data), data.RandomInteger) +} + func (r WorkspaceResource) systemAssignedAndCustomManagedKey(data acceptance.TestData) string { return fmt.Sprintf(` %[1]s diff --git a/utils/pointer.go b/utils/pointer.go index 953e9832f2cd..157fcf1500a0 100644 --- a/utils/pointer.go +++ b/utils/pointer.go @@ -24,6 +24,10 @@ func String(input string) *string { return &input } +func ToPtr[E any](e E) *E { + return &e +} + func StringSlice(input []string) *[]string { if input == nil { return nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/_meta.json deleted file mode 100644 index 6519961fb79f..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "47545c5f0842f5be29529674a4609d75a973d783", - "readme": "/_/azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.md", - "tag": "package-2021-07-01", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-07-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/machinelearningservices/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/client.go deleted file mode 100644 index 2d91dbf1f5fe..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/machinelearning/armmachinelearning). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. -// -// Package machinelearningservices implements the Azure ARM Machinelearningservices service API version 2021-07-01. -// -// These APIs allow end users to operate on Azure Machine Learning Workspace resources. -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Machinelearningservices - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Machinelearningservices. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/compute.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/compute.go deleted file mode 100644 index 2b998e7bc980..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/compute.go +++ /dev/null @@ -1,1014 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ComputeClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. -type ComputeClient struct { - BaseClient -} - -// NewComputeClient creates an instance of the ComputeClient client. -func NewComputeClient(subscriptionID string) ComputeClient { - return NewComputeClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewComputeClientWithBaseURI creates an instance of the ComputeClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewComputeClientWithBaseURI(baseURI string, subscriptionID string) ComputeClient { - return ComputeClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable -// operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -// parameters - payload with Machine Learning compute definition. -func (client ComputeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource) (result ComputeCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, computeName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ComputeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) CreateOrUpdateSender(req *http.Request) (future ComputeCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ComputeClient) CreateOrUpdateResponder(resp *http.Response) (result ComputeResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes specified Machine Learning compute. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -// underlyingResourceAction - delete the underlying compute if 'Delete', or detach the underlying compute from -// workspace if 'Detach'. -func (client ComputeClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction) (result ComputeDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, computeName, underlyingResourceAction) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ComputeClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "underlyingResourceAction": autorest.Encode("query", underlyingResourceAction), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) DeleteSender(req *http.Request) (future ComputeDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ComputeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use -// 'keys' nested resource to get them. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -func (client ComputeClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, computeName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ComputeClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ComputeClient) GetResponder(resp *http.Response) (result ComputeResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets computes in specified workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// skip - continuation token for pagination. -func (client ComputeClient) List(ctx context.Context, resourceGroupName string, workspaceName string, skip string) (result PaginatedComputeResourcesListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.List") - defer func() { - sc := -1 - if result.pcrl.Response.Response != nil { - sc = result.pcrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pcrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "List", resp, "Failure sending request") - return - } - - result.pcrl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "List", resp, "Failure responding to request") - return - } - if result.pcrl.hasNextLink() && result.pcrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ComputeClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, skip string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(skip) > 0 { - queryParameters["$skip"] = autorest.Encode("query", skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ComputeClient) ListResponder(resp *http.Response) (result PaginatedComputeResourcesList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ComputeClient) listNextResults(ctx context.Context, lastResults PaginatedComputeResourcesList) (result PaginatedComputeResourcesList, err error) { - req, err := lastResults.paginatedComputeResourcesListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string, skip string) (result PaginatedComputeResourcesListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, workspaceName, skip) - return -} - -// ListKeys gets secrets related to Machine Learning compute (storage keys, service credentials, etc). -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -func (client ComputeClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeSecretsModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.ListKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "ListKeys", err.Error()) - } - - req, err := client.ListKeysPreparer(ctx, resourceGroupName, workspaceName, computeName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "ListKeys", nil, "Failure preparing request") - return - } - - resp, err := client.ListKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "ListKeys", resp, "Failure sending request") - return - } - - result, err = client.ListKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "ListKeys", resp, "Failure responding to request") - return - } - - return -} - -// ListKeysPreparer prepares the ListKeys request. -func (client ComputeClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListKeysSender sends the ListKeys request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) ListKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListKeysResponder handles the response to the ListKeys request. The method always -// closes the http.Response Body. -func (client ComputeClient) ListKeysResponder(resp *http.Response) (result ComputeSecretsModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListNodes get the details (e.g IP address, port etc) of all the compute nodes in the compute. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -func (client ComputeClient) ListNodes(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result AmlComputeNodesInformationPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.ListNodes") - defer func() { - sc := -1 - if result.acni.Response.Response != nil { - sc = result.acni.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "ListNodes", err.Error()) - } - - result.fn = client.listNodesNextResults - req, err := client.ListNodesPreparer(ctx, resourceGroupName, workspaceName, computeName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "ListNodes", nil, "Failure preparing request") - return - } - - resp, err := client.ListNodesSender(req) - if err != nil { - result.acni.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "ListNodes", resp, "Failure sending request") - return - } - - result.acni, err = client.ListNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "ListNodes", resp, "Failure responding to request") - return - } - if result.acni.hasNextLink() && result.acni.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListNodesPreparer prepares the ListNodes request. -func (client ComputeClient) ListNodesPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNodesSender sends the ListNodes request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) ListNodesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListNodesResponder handles the response to the ListNodes request. The method always -// closes the http.Response Body. -func (client ComputeClient) ListNodesResponder(resp *http.Response) (result AmlComputeNodesInformation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNodesNextResults retrieves the next set of results, if any. -func (client ComputeClient) listNodesNextResults(ctx context.Context, lastResults AmlComputeNodesInformation) (result AmlComputeNodesInformation, err error) { - req, err := lastResults.amlComputeNodesInformationPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "listNodesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListNodesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "listNodesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListNodesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "listNodesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListNodesComplete enumerates all values, automatically crossing page boundaries as required. -func (client ComputeClient) ListNodesComplete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result AmlComputeNodesInformationIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.ListNodes") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListNodes(ctx, resourceGroupName, workspaceName, computeName) - return -} - -// Restart posts a restart action to a compute instance -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -func (client ComputeClient) Restart(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "Restart", err.Error()) - } - - req, err := client.RestartPreparer(ctx, resourceGroupName, workspaceName, computeName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client ComputeClient) RestartPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) RestartSender(req *http.Request) (future ComputeRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client ComputeClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start posts a start action to a compute instance -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -func (client ComputeClient) Start(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "Start", err.Error()) - } - - req, err := client.StartPreparer(ctx, resourceGroupName, workspaceName, computeName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client ComputeClient) StartPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) StartSender(req *http.Request) (future ComputeStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client ComputeClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop posts a stop action to a compute instance -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -func (client ComputeClient) Stop(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeStopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.Stop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "Stop", err.Error()) - } - - req, err := client.StopPreparer(ctx, resourceGroupName, workspaceName, computeName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = client.StopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Stop", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client ComputeClient) StopPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) StopSender(req *http.Request) (future ComputeStopFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client ComputeClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable -// operation. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// computeName - name of the Azure Machine Learning compute. -// parameters - additional parameters for cluster update. -func (client ComputeClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters) (result ComputeUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComputeClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.ComputeClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, computeName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ComputeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "computeName": autorest.Encode("path", computeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ComputeClient) UpdateSender(req *http.Request) (future ComputeUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ComputeClient) UpdateResponder(resp *http.Response) (result ComputeResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/enums.go deleted file mode 100644 index 724aa1708ce3..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/enums.go +++ /dev/null @@ -1,633 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// AllocationState enumerates the values for allocation state. -type AllocationState string - -const ( - // AllocationStateResizing ... - AllocationStateResizing AllocationState = "Resizing" - // AllocationStateSteady ... - AllocationStateSteady AllocationState = "Steady" -) - -// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. -func PossibleAllocationStateValues() []AllocationState { - return []AllocationState{AllocationStateResizing, AllocationStateSteady} -} - -// ApplicationSharingPolicy enumerates the values for application sharing policy. -type ApplicationSharingPolicy string - -const ( - // ApplicationSharingPolicyPersonal ... - ApplicationSharingPolicyPersonal ApplicationSharingPolicy = "Personal" - // ApplicationSharingPolicyShared ... - ApplicationSharingPolicyShared ApplicationSharingPolicy = "Shared" -) - -// PossibleApplicationSharingPolicyValues returns an array of possible values for the ApplicationSharingPolicy const type. -func PossibleApplicationSharingPolicyValues() []ApplicationSharingPolicy { - return []ApplicationSharingPolicy{ApplicationSharingPolicyPersonal, ApplicationSharingPolicyShared} -} - -// ClusterPurpose enumerates the values for cluster purpose. -type ClusterPurpose string - -const ( - // ClusterPurposeDenseProd ... - ClusterPurposeDenseProd ClusterPurpose = "DenseProd" - // ClusterPurposeDevTest ... - ClusterPurposeDevTest ClusterPurpose = "DevTest" - // ClusterPurposeFastProd ... - ClusterPurposeFastProd ClusterPurpose = "FastProd" -) - -// PossibleClusterPurposeValues returns an array of possible values for the ClusterPurpose const type. -func PossibleClusterPurposeValues() []ClusterPurpose { - return []ClusterPurpose{ClusterPurposeDenseProd, ClusterPurposeDevTest, ClusterPurposeFastProd} -} - -// ComputeInstanceAuthorizationType enumerates the values for compute instance authorization type. -type ComputeInstanceAuthorizationType string - -const ( - // ComputeInstanceAuthorizationTypePersonal ... - ComputeInstanceAuthorizationTypePersonal ComputeInstanceAuthorizationType = "personal" -) - -// PossibleComputeInstanceAuthorizationTypeValues returns an array of possible values for the ComputeInstanceAuthorizationType const type. -func PossibleComputeInstanceAuthorizationTypeValues() []ComputeInstanceAuthorizationType { - return []ComputeInstanceAuthorizationType{ComputeInstanceAuthorizationTypePersonal} -} - -// ComputeInstanceState enumerates the values for compute instance state. -type ComputeInstanceState string - -const ( - // ComputeInstanceStateCreateFailed ... - ComputeInstanceStateCreateFailed ComputeInstanceState = "CreateFailed" - // ComputeInstanceStateCreating ... - ComputeInstanceStateCreating ComputeInstanceState = "Creating" - // ComputeInstanceStateDeleting ... - ComputeInstanceStateDeleting ComputeInstanceState = "Deleting" - // ComputeInstanceStateJobRunning ... - ComputeInstanceStateJobRunning ComputeInstanceState = "JobRunning" - // ComputeInstanceStateRestarting ... - ComputeInstanceStateRestarting ComputeInstanceState = "Restarting" - // ComputeInstanceStateRunning ... - ComputeInstanceStateRunning ComputeInstanceState = "Running" - // ComputeInstanceStateSettingUp ... - ComputeInstanceStateSettingUp ComputeInstanceState = "SettingUp" - // ComputeInstanceStateSetupFailed ... - ComputeInstanceStateSetupFailed ComputeInstanceState = "SetupFailed" - // ComputeInstanceStateStarting ... - ComputeInstanceStateStarting ComputeInstanceState = "Starting" - // ComputeInstanceStateStopped ... - ComputeInstanceStateStopped ComputeInstanceState = "Stopped" - // ComputeInstanceStateStopping ... - ComputeInstanceStateStopping ComputeInstanceState = "Stopping" - // ComputeInstanceStateUnknown ... - ComputeInstanceStateUnknown ComputeInstanceState = "Unknown" - // ComputeInstanceStateUnusable ... - ComputeInstanceStateUnusable ComputeInstanceState = "Unusable" - // ComputeInstanceStateUserSettingUp ... - ComputeInstanceStateUserSettingUp ComputeInstanceState = "UserSettingUp" - // ComputeInstanceStateUserSetupFailed ... - ComputeInstanceStateUserSetupFailed ComputeInstanceState = "UserSetupFailed" -) - -// PossibleComputeInstanceStateValues returns an array of possible values for the ComputeInstanceState const type. -func PossibleComputeInstanceStateValues() []ComputeInstanceState { - return []ComputeInstanceState{ComputeInstanceStateCreateFailed, ComputeInstanceStateCreating, ComputeInstanceStateDeleting, ComputeInstanceStateJobRunning, ComputeInstanceStateRestarting, ComputeInstanceStateRunning, ComputeInstanceStateSettingUp, ComputeInstanceStateSetupFailed, ComputeInstanceStateStarting, ComputeInstanceStateStopped, ComputeInstanceStateStopping, ComputeInstanceStateUnknown, ComputeInstanceStateUnusable, ComputeInstanceStateUserSettingUp, ComputeInstanceStateUserSetupFailed} -} - -// ComputeType enumerates the values for compute type. -type ComputeType string - -const ( - // ComputeTypeAKS ... - ComputeTypeAKS ComputeType = "AKS" - // ComputeTypeAmlCompute ... - ComputeTypeAmlCompute ComputeType = "AmlCompute" - // ComputeTypeComputeInstance ... - ComputeTypeComputeInstance ComputeType = "ComputeInstance" - // ComputeTypeDatabricks ... - ComputeTypeDatabricks ComputeType = "Databricks" - // ComputeTypeDataFactory ... - ComputeTypeDataFactory ComputeType = "DataFactory" - // ComputeTypeDataLakeAnalytics ... - ComputeTypeDataLakeAnalytics ComputeType = "DataLakeAnalytics" - // ComputeTypeHDInsight ... - ComputeTypeHDInsight ComputeType = "HDInsight" - // ComputeTypeKubernetes ... - ComputeTypeKubernetes ComputeType = "Kubernetes" - // ComputeTypeSynapseSpark ... - ComputeTypeSynapseSpark ComputeType = "SynapseSpark" - // ComputeTypeVirtualMachine ... - ComputeTypeVirtualMachine ComputeType = "VirtualMachine" -) - -// PossibleComputeTypeValues returns an array of possible values for the ComputeType const type. -func PossibleComputeTypeValues() []ComputeType { - return []ComputeType{ComputeTypeAKS, ComputeTypeAmlCompute, ComputeTypeComputeInstance, ComputeTypeDatabricks, ComputeTypeDataFactory, ComputeTypeDataLakeAnalytics, ComputeTypeHDInsight, ComputeTypeKubernetes, ComputeTypeSynapseSpark, ComputeTypeVirtualMachine} -} - -// ComputeTypeBasicCompute enumerates the values for compute type basic compute. -type ComputeTypeBasicCompute string - -const ( - // ComputeTypeBasicComputeComputeTypeAKS ... - ComputeTypeBasicComputeComputeTypeAKS ComputeTypeBasicCompute = "AKS" - // ComputeTypeBasicComputeComputeTypeAmlCompute ... - ComputeTypeBasicComputeComputeTypeAmlCompute ComputeTypeBasicCompute = "AmlCompute" - // ComputeTypeBasicComputeComputeTypeCompute ... - ComputeTypeBasicComputeComputeTypeCompute ComputeTypeBasicCompute = "Compute" - // ComputeTypeBasicComputeComputeTypeComputeInstance ... - ComputeTypeBasicComputeComputeTypeComputeInstance ComputeTypeBasicCompute = "ComputeInstance" - // ComputeTypeBasicComputeComputeTypeDatabricks ... - ComputeTypeBasicComputeComputeTypeDatabricks ComputeTypeBasicCompute = "Databricks" - // ComputeTypeBasicComputeComputeTypeDataFactory ... - ComputeTypeBasicComputeComputeTypeDataFactory ComputeTypeBasicCompute = "DataFactory" - // ComputeTypeBasicComputeComputeTypeDataLakeAnalytics ... - ComputeTypeBasicComputeComputeTypeDataLakeAnalytics ComputeTypeBasicCompute = "DataLakeAnalytics" - // ComputeTypeBasicComputeComputeTypeHDInsight ... - ComputeTypeBasicComputeComputeTypeHDInsight ComputeTypeBasicCompute = "HDInsight" - // ComputeTypeBasicComputeComputeTypeSynapseSpark ... - ComputeTypeBasicComputeComputeTypeSynapseSpark ComputeTypeBasicCompute = "SynapseSpark" - // ComputeTypeBasicComputeComputeTypeVirtualMachine ... - ComputeTypeBasicComputeComputeTypeVirtualMachine ComputeTypeBasicCompute = "VirtualMachine" -) - -// PossibleComputeTypeBasicComputeValues returns an array of possible values for the ComputeTypeBasicCompute const type. -func PossibleComputeTypeBasicComputeValues() []ComputeTypeBasicCompute { - return []ComputeTypeBasicCompute{ComputeTypeBasicComputeComputeTypeAKS, ComputeTypeBasicComputeComputeTypeAmlCompute, ComputeTypeBasicComputeComputeTypeCompute, ComputeTypeBasicComputeComputeTypeComputeInstance, ComputeTypeBasicComputeComputeTypeDatabricks, ComputeTypeBasicComputeComputeTypeDataFactory, ComputeTypeBasicComputeComputeTypeDataLakeAnalytics, ComputeTypeBasicComputeComputeTypeHDInsight, ComputeTypeBasicComputeComputeTypeSynapseSpark, ComputeTypeBasicComputeComputeTypeVirtualMachine} -} - -// ComputeTypeBasicComputeSecrets enumerates the values for compute type basic compute secrets. -type ComputeTypeBasicComputeSecrets string - -const ( - // ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ... - ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ComputeTypeBasicComputeSecrets = "ComputeSecrets" - // ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ... - ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ComputeTypeBasicComputeSecrets = "VirtualMachine" -) - -// PossibleComputeTypeBasicComputeSecretsValues returns an array of possible values for the ComputeTypeBasicComputeSecrets const type. -func PossibleComputeTypeBasicComputeSecretsValues() []ComputeTypeBasicComputeSecrets { - return []ComputeTypeBasicComputeSecrets{ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets, ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine} -} - -// CreatedByType enumerates the values for created by type. -type CreatedByType string - -const ( - // CreatedByTypeApplication ... - CreatedByTypeApplication CreatedByType = "Application" - // CreatedByTypeKey ... - CreatedByTypeKey CreatedByType = "Key" - // CreatedByTypeManagedIdentity ... - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - // CreatedByTypeUser ... - CreatedByTypeUser CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} -} - -// DiagnoseResultLevel enumerates the values for diagnose result level. -type DiagnoseResultLevel string - -const ( - // DiagnoseResultLevelError ... - DiagnoseResultLevelError DiagnoseResultLevel = "Error" - // DiagnoseResultLevelInformation ... - DiagnoseResultLevelInformation DiagnoseResultLevel = "Information" - // DiagnoseResultLevelWarning ... - DiagnoseResultLevelWarning DiagnoseResultLevel = "Warning" -) - -// PossibleDiagnoseResultLevelValues returns an array of possible values for the DiagnoseResultLevel const type. -func PossibleDiagnoseResultLevelValues() []DiagnoseResultLevel { - return []DiagnoseResultLevel{DiagnoseResultLevelError, DiagnoseResultLevelInformation, DiagnoseResultLevelWarning} -} - -// EncryptionStatus enumerates the values for encryption status. -type EncryptionStatus string - -const ( - // EncryptionStatusDisabled ... - EncryptionStatusDisabled EncryptionStatus = "Disabled" - // EncryptionStatusEnabled ... - EncryptionStatusEnabled EncryptionStatus = "Enabled" -) - -// PossibleEncryptionStatusValues returns an array of possible values for the EncryptionStatus const type. -func PossibleEncryptionStatusValues() []EncryptionStatus { - return []EncryptionStatus{EncryptionStatusDisabled, EncryptionStatusEnabled} -} - -// LoadBalancerType enumerates the values for load balancer type. -type LoadBalancerType string - -const ( - // LoadBalancerTypeInternalLoadBalancer ... - LoadBalancerTypeInternalLoadBalancer LoadBalancerType = "InternalLoadBalancer" - // LoadBalancerTypePublicIP ... - LoadBalancerTypePublicIP LoadBalancerType = "PublicIp" -) - -// PossibleLoadBalancerTypeValues returns an array of possible values for the LoadBalancerType const type. -func PossibleLoadBalancerTypeValues() []LoadBalancerType { - return []LoadBalancerType{LoadBalancerTypeInternalLoadBalancer, LoadBalancerTypePublicIP} -} - -// NodeState enumerates the values for node state. -type NodeState string - -const ( - // NodeStateIdle ... - NodeStateIdle NodeState = "idle" - // NodeStateLeaving ... - NodeStateLeaving NodeState = "leaving" - // NodeStatePreempted ... - NodeStatePreempted NodeState = "preempted" - // NodeStatePreparing ... - NodeStatePreparing NodeState = "preparing" - // NodeStateRunning ... - NodeStateRunning NodeState = "running" - // NodeStateUnusable ... - NodeStateUnusable NodeState = "unusable" -) - -// PossibleNodeStateValues returns an array of possible values for the NodeState const type. -func PossibleNodeStateValues() []NodeState { - return []NodeState{NodeStateIdle, NodeStateLeaving, NodeStatePreempted, NodeStatePreparing, NodeStateRunning, NodeStateUnusable} -} - -// OperationName enumerates the values for operation name. -type OperationName string - -const ( - // OperationNameCreate ... - OperationNameCreate OperationName = "Create" - // OperationNameDelete ... - OperationNameDelete OperationName = "Delete" - // OperationNameReimage ... - OperationNameReimage OperationName = "Reimage" - // OperationNameRestart ... - OperationNameRestart OperationName = "Restart" - // OperationNameStart ... - OperationNameStart OperationName = "Start" - // OperationNameStop ... - OperationNameStop OperationName = "Stop" -) - -// PossibleOperationNameValues returns an array of possible values for the OperationName const type. -func PossibleOperationNameValues() []OperationName { - return []OperationName{OperationNameCreate, OperationNameDelete, OperationNameReimage, OperationNameRestart, OperationNameStart, OperationNameStop} -} - -// OperationStatus enumerates the values for operation status. -type OperationStatus string - -const ( - // OperationStatusCreateFailed ... - OperationStatusCreateFailed OperationStatus = "CreateFailed" - // OperationStatusDeleteFailed ... - OperationStatusDeleteFailed OperationStatus = "DeleteFailed" - // OperationStatusInProgress ... - OperationStatusInProgress OperationStatus = "InProgress" - // OperationStatusReimageFailed ... - OperationStatusReimageFailed OperationStatus = "ReimageFailed" - // OperationStatusRestartFailed ... - OperationStatusRestartFailed OperationStatus = "RestartFailed" - // OperationStatusStartFailed ... - OperationStatusStartFailed OperationStatus = "StartFailed" - // OperationStatusStopFailed ... - OperationStatusStopFailed OperationStatus = "StopFailed" - // OperationStatusSucceeded ... - OperationStatusSucceeded OperationStatus = "Succeeded" -) - -// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. -func PossibleOperationStatusValues() []OperationStatus { - return []OperationStatus{OperationStatusCreateFailed, OperationStatusDeleteFailed, OperationStatusInProgress, OperationStatusReimageFailed, OperationStatusRestartFailed, OperationStatusStartFailed, OperationStatusStopFailed, OperationStatusSucceeded} -} - -// OsType enumerates the values for os type. -type OsType string - -const ( - // OsTypeLinux ... - OsTypeLinux OsType = "Linux" - // OsTypeWindows ... - OsTypeWindows OsType = "Windows" -) - -// PossibleOsTypeValues returns an array of possible values for the OsType const type. -func PossibleOsTypeValues() []OsType { - return []OsType{OsTypeLinux, OsTypeWindows} -} - -// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection -// provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - // PrivateEndpointConnectionProvisioningStateCreating ... - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - // PrivateEndpointConnectionProvisioningStateDeleting ... - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - // PrivateEndpointConnectionProvisioningStateFailed ... - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - // PrivateEndpointConnectionProvisioningStateSucceeded ... - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} -} - -// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - // PrivateEndpointServiceConnectionStatusApproved ... - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - // PrivateEndpointServiceConnectionStatusDisconnected ... - PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected" - // PrivateEndpointServiceConnectionStatusPending ... - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - // PrivateEndpointServiceConnectionStatusRejected ... - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" - // PrivateEndpointServiceConnectionStatusTimeout ... - PrivateEndpointServiceConnectionStatusTimeout PrivateEndpointServiceConnectionStatus = "Timeout" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{PrivateEndpointServiceConnectionStatusApproved, PrivateEndpointServiceConnectionStatusDisconnected, PrivateEndpointServiceConnectionStatusPending, PrivateEndpointServiceConnectionStatusRejected, PrivateEndpointServiceConnectionStatusTimeout} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCanceled ... - ProvisioningStateCanceled ProvisioningState = "Canceled" - // ProvisioningStateCreating ... - ProvisioningStateCreating ProvisioningState = "Creating" - // ProvisioningStateDeleting ... - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUnknown ... - ProvisioningStateUnknown ProvisioningState = "Unknown" - // ProvisioningStateUpdating ... - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUnknown, ProvisioningStateUpdating} -} - -// PublicNetworkAccess enumerates the values for public network access. -type PublicNetworkAccess string - -const ( - // PublicNetworkAccessDisabled ... - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - // PublicNetworkAccessEnabled ... - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} -} - -// QuotaUnit enumerates the values for quota unit. -type QuotaUnit string - -const ( - // QuotaUnitCount ... - QuotaUnitCount QuotaUnit = "Count" -) - -// PossibleQuotaUnitValues returns an array of possible values for the QuotaUnit const type. -func PossibleQuotaUnitValues() []QuotaUnit { - return []QuotaUnit{QuotaUnitCount} -} - -// ReasonCode enumerates the values for reason code. -type ReasonCode string - -const ( - // ReasonCodeNotAvailableForRegion ... - ReasonCodeNotAvailableForRegion ReasonCode = "NotAvailableForRegion" - // ReasonCodeNotAvailableForSubscription ... - ReasonCodeNotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" - // ReasonCodeNotSpecified ... - ReasonCodeNotSpecified ReasonCode = "NotSpecified" -) - -// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. -func PossibleReasonCodeValues() []ReasonCode { - return []ReasonCode{ReasonCodeNotAvailableForRegion, ReasonCodeNotAvailableForSubscription, ReasonCodeNotSpecified} -} - -// RemoteLoginPortPublicAccess enumerates the values for remote login port public access. -type RemoteLoginPortPublicAccess string - -const ( - // RemoteLoginPortPublicAccessDisabled ... - RemoteLoginPortPublicAccessDisabled RemoteLoginPortPublicAccess = "Disabled" - // RemoteLoginPortPublicAccessEnabled ... - RemoteLoginPortPublicAccessEnabled RemoteLoginPortPublicAccess = "Enabled" - // RemoteLoginPortPublicAccessNotSpecified ... - RemoteLoginPortPublicAccessNotSpecified RemoteLoginPortPublicAccess = "NotSpecified" -) - -// PossibleRemoteLoginPortPublicAccessValues returns an array of possible values for the RemoteLoginPortPublicAccess const type. -func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { - return []RemoteLoginPortPublicAccess{RemoteLoginPortPublicAccessDisabled, RemoteLoginPortPublicAccessEnabled, RemoteLoginPortPublicAccessNotSpecified} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned,UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// SSHPublicAccess enumerates the values for ssh public access. -type SSHPublicAccess string - -const ( - // SSHPublicAccessDisabled ... - SSHPublicAccessDisabled SSHPublicAccess = "Disabled" - // SSHPublicAccessEnabled ... - SSHPublicAccessEnabled SSHPublicAccess = "Enabled" -) - -// PossibleSSHPublicAccessValues returns an array of possible values for the SSHPublicAccess const type. -func PossibleSSHPublicAccessValues() []SSHPublicAccess { - return []SSHPublicAccess{SSHPublicAccessDisabled, SSHPublicAccessEnabled} -} - -// Status enumerates the values for status. -type Status string - -const ( - // StatusFailure ... - StatusFailure Status = "Failure" - // StatusInvalidQuotaBelowClusterMinimum ... - StatusInvalidQuotaBelowClusterMinimum Status = "InvalidQuotaBelowClusterMinimum" - // StatusInvalidQuotaExceedsSubscriptionLimit ... - StatusInvalidQuotaExceedsSubscriptionLimit Status = "InvalidQuotaExceedsSubscriptionLimit" - // StatusInvalidVMFamilyName ... - StatusInvalidVMFamilyName Status = "InvalidVMFamilyName" - // StatusOperationNotEnabledForRegion ... - StatusOperationNotEnabledForRegion Status = "OperationNotEnabledForRegion" - // StatusOperationNotSupportedForSku ... - StatusOperationNotSupportedForSku Status = "OperationNotSupportedForSku" - // StatusSuccess ... - StatusSuccess Status = "Success" - // StatusUndefined ... - StatusUndefined Status = "Undefined" -) - -// PossibleStatusValues returns an array of possible values for the Status const type. -func PossibleStatusValues() []Status { - return []Status{StatusFailure, StatusInvalidQuotaBelowClusterMinimum, StatusInvalidQuotaExceedsSubscriptionLimit, StatusInvalidVMFamilyName, StatusOperationNotEnabledForRegion, StatusOperationNotSupportedForSku, StatusSuccess, StatusUndefined} -} - -// Status1 enumerates the values for status 1. -type Status1 string - -const ( - // Status1Auto ... - Status1Auto Status1 = "Auto" - // Status1Disabled ... - Status1Disabled Status1 = "Disabled" - // Status1Enabled ... - Status1Enabled Status1 = "Enabled" -) - -// PossibleStatus1Values returns an array of possible values for the Status1 const type. -func PossibleStatus1Values() []Status1 { - return []Status1{Status1Auto, Status1Disabled, Status1Enabled} -} - -// UnderlyingResourceAction enumerates the values for underlying resource action. -type UnderlyingResourceAction string - -const ( - // UnderlyingResourceActionDelete ... - UnderlyingResourceActionDelete UnderlyingResourceAction = "Delete" - // UnderlyingResourceActionDetach ... - UnderlyingResourceActionDetach UnderlyingResourceAction = "Detach" -) - -// PossibleUnderlyingResourceActionValues returns an array of possible values for the UnderlyingResourceAction const type. -func PossibleUnderlyingResourceActionValues() []UnderlyingResourceAction { - return []UnderlyingResourceAction{UnderlyingResourceActionDelete, UnderlyingResourceActionDetach} -} - -// UsageUnit enumerates the values for usage unit. -type UsageUnit string - -const ( - // UsageUnitCount ... - UsageUnitCount UsageUnit = "Count" -) - -// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. -func PossibleUsageUnitValues() []UsageUnit { - return []UsageUnit{UsageUnitCount} -} - -// ValueFormat enumerates the values for value format. -type ValueFormat string - -const ( - // ValueFormatJSON ... - ValueFormatJSON ValueFormat = "JSON" -) - -// PossibleValueFormatValues returns an array of possible values for the ValueFormat const type. -func PossibleValueFormatValues() []ValueFormat { - return []ValueFormat{ValueFormatJSON} -} - -// VMPriceOSType enumerates the values for vm price os type. -type VMPriceOSType string - -const ( - // VMPriceOSTypeLinux ... - VMPriceOSTypeLinux VMPriceOSType = "Linux" - // VMPriceOSTypeWindows ... - VMPriceOSTypeWindows VMPriceOSType = "Windows" -) - -// PossibleVMPriceOSTypeValues returns an array of possible values for the VMPriceOSType const type. -func PossibleVMPriceOSTypeValues() []VMPriceOSType { - return []VMPriceOSType{VMPriceOSTypeLinux, VMPriceOSTypeWindows} -} - -// VMPriority enumerates the values for vm priority. -type VMPriority string - -const ( - // VMPriorityDedicated ... - VMPriorityDedicated VMPriority = "Dedicated" - // VMPriorityLowPriority ... - VMPriorityLowPriority VMPriority = "LowPriority" -) - -// PossibleVMPriorityValues returns an array of possible values for the VMPriority const type. -func PossibleVMPriorityValues() []VMPriority { - return []VMPriority{VMPriorityDedicated, VMPriorityLowPriority} -} - -// VMTier enumerates the values for vm tier. -type VMTier string - -const ( - // VMTierLowPriority ... - VMTierLowPriority VMTier = "LowPriority" - // VMTierSpot ... - VMTierSpot VMTier = "Spot" - // VMTierStandard ... - VMTierStandard VMTier = "Standard" -) - -// PossibleVMTierValues returns an array of possible values for the VMTier const type. -func PossibleVMTierValues() []VMTier { - return []VMTier{VMTierLowPriority, VMTierSpot, VMTierStandard} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/models.go deleted file mode 100644 index d93c702110ed..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/models.go +++ /dev/null @@ -1,5400 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices" - -// AKS a Machine Learning compute based on AKS. -type AKS struct { - // Properties - AKS properties - Properties *AKSProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AKS. -func (a AKS) MarshalJSON() ([]byte, error) { - a.ComputeType = ComputeTypeBasicComputeComputeTypeAKS - objectMap := make(map[string]interface{}) - if a.Properties != nil { - objectMap["properties"] = a.Properties - } - if a.ComputeLocation != nil { - objectMap["computeLocation"] = a.ComputeLocation - } - if a.Description != nil { - objectMap["description"] = a.Description - } - if a.ResourceID != nil { - objectMap["resourceId"] = a.ResourceID - } - if a.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = a.DisableLocalAuth - } - if a.ComputeType != "" { - objectMap["computeType"] = a.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for AKS. -func (a AKS) AsAKS() (*AKS, bool) { - return &a, true -} - -// AsAmlCompute is the BasicCompute implementation for AKS. -func (a AKS) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for AKS. -func (a AKS) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for AKS. -func (a AKS) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for AKS. -func (a AKS) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for AKS. -func (a AKS) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for AKS. -func (a AKS) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for AKS. -func (a AKS) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for AKS. -func (a AKS) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for AKS. -func (a AKS) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for AKS. -func (a AKS) AsBasicCompute() (BasicCompute, bool) { - return &a, true -} - -// AksComputeSecrets secrets related to a Machine Learning compute based on AKS. -type AksComputeSecrets struct { - // ComputeType - The type of compute. Possible values include: 'ComputeTypeAKS', 'ComputeTypeKubernetes', 'ComputeTypeAmlCompute', 'ComputeTypeComputeInstance', 'ComputeTypeDataFactory', 'ComputeTypeVirtualMachine', 'ComputeTypeHDInsight', 'ComputeTypeDatabricks', 'ComputeTypeDataLakeAnalytics', 'ComputeTypeSynapseSpark' - ComputeType ComputeType `json:"computeType,omitempty"` - // UserKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. - UserKubeConfig *string `json:"userKubeConfig,omitempty"` - // AdminKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. - AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` - // ImagePullSecretName - Image registry pull secret. - ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` -} - -// AksComputeSecretsProperties properties of AksComputeSecrets -type AksComputeSecretsProperties struct { - // UserKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. - UserKubeConfig *string `json:"userKubeConfig,omitempty"` - // AdminKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. - AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` - // ImagePullSecretName - Image registry pull secret. - ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` -} - -// AksNetworkingConfiguration advance configuration for AKS networking -type AksNetworkingConfiguration struct { - // SubnetID - Virtual network subnet resource ID the compute nodes belong to - SubnetID *string `json:"subnetId,omitempty"` - // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. - ServiceCidr *string `json:"serviceCidr,omitempty"` - // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. - DNSServiceIP *string `json:"dnsServiceIP,omitempty"` - // 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. - DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` -} - -// AKSProperties AKS properties -type AKSProperties struct { - // ClusterFqdn - Cluster full qualified domain name - ClusterFqdn *string `json:"clusterFqdn,omitempty"` - // SystemServices - READ-ONLY; System services - SystemServices *[]SystemService `json:"systemServices,omitempty"` - // AgentCount - Number of agents - AgentCount *int32 `json:"agentCount,omitempty"` - // AgentVMSize - Agent virtual machine size - AgentVMSize *string `json:"agentVmSize,omitempty"` - // ClusterPurpose - Intended usage of the cluster. Possible values include: 'ClusterPurposeFastProd', 'ClusterPurposeDenseProd', 'ClusterPurposeDevTest' - ClusterPurpose ClusterPurpose `json:"clusterPurpose,omitempty"` - // SslConfiguration - SSL configuration - SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` - // AksNetworkingConfiguration - AKS networking configuration for vnet - AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` - // LoadBalancerType - Load Balancer Type. Possible values include: 'LoadBalancerTypePublicIP', 'LoadBalancerTypeInternalLoadBalancer' - LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty"` - // LoadBalancerSubnet - Load Balancer Subnet - LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"` -} - -// MarshalJSON is the custom marshaler for AKSProperties. -func (a AKSProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if a.ClusterFqdn != nil { - objectMap["clusterFqdn"] = a.ClusterFqdn - } - if a.AgentCount != nil { - objectMap["agentCount"] = a.AgentCount - } - if a.AgentVMSize != nil { - objectMap["agentVmSize"] = a.AgentVMSize - } - if a.ClusterPurpose != "" { - objectMap["clusterPurpose"] = a.ClusterPurpose - } - if a.SslConfiguration != nil { - objectMap["sslConfiguration"] = a.SslConfiguration - } - if a.AksNetworkingConfiguration != nil { - objectMap["aksNetworkingConfiguration"] = a.AksNetworkingConfiguration - } - if a.LoadBalancerType != "" { - objectMap["loadBalancerType"] = a.LoadBalancerType - } - if a.LoadBalancerSubnet != nil { - objectMap["loadBalancerSubnet"] = a.LoadBalancerSubnet - } - return json.Marshal(objectMap) -} - -// AmlCompute an Azure Machine Learning compute. -type AmlCompute struct { - // Properties - Properties of AmlCompute - Properties *AmlComputeProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for AmlCompute. -func (ac AmlCompute) MarshalJSON() ([]byte, error) { - ac.ComputeType = ComputeTypeBasicComputeComputeTypeAmlCompute - objectMap := make(map[string]interface{}) - if ac.Properties != nil { - objectMap["properties"] = ac.Properties - } - if ac.ComputeLocation != nil { - objectMap["computeLocation"] = ac.ComputeLocation - } - if ac.Description != nil { - objectMap["description"] = ac.Description - } - if ac.ResourceID != nil { - objectMap["resourceId"] = ac.ResourceID - } - if ac.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = ac.DisableLocalAuth - } - if ac.ComputeType != "" { - objectMap["computeType"] = ac.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsAmlCompute() (*AmlCompute, bool) { - return &ac, true -} - -// AsComputeInstance is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for AmlCompute. -func (ac AmlCompute) AsBasicCompute() (BasicCompute, bool) { - return &ac, true -} - -// AmlComputeNodeInformation compute node information related to a AmlCompute. -type AmlComputeNodeInformation struct { - // NodeID - READ-ONLY; ID of the compute node. - NodeID *string `json:"nodeId,omitempty"` - // PrivateIPAddress - READ-ONLY; Private IP address of the compute node. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - // PublicIPAddress - READ-ONLY; Public IP address of the compute node. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // Port - READ-ONLY; SSH port number of the node. - Port *float64 `json:"port,omitempty"` - // NodeState - READ-ONLY; State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. Possible values include: 'NodeStateIdle', 'NodeStateRunning', 'NodeStatePreparing', 'NodeStateUnusable', 'NodeStateLeaving', 'NodeStatePreempted' - NodeState NodeState `json:"nodeState,omitempty"` - // RunID - READ-ONLY; ID of the Experiment running on the node, if any else null. - RunID *string `json:"runId,omitempty"` -} - -// MarshalJSON is the custom marshaler for AmlComputeNodeInformation. -func (acni AmlComputeNodeInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AmlComputeNodesInformation result of AmlCompute Nodes -type AmlComputeNodesInformation struct { - autorest.Response `json:"-"` - // Nodes - READ-ONLY; The collection of returned AmlCompute nodes details. - Nodes *[]AmlComputeNodeInformation `json:"nodes,omitempty"` - // NextLink - READ-ONLY; The continuation token. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AmlComputeNodesInformation. -func (acni AmlComputeNodesInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AmlComputeNodesInformationIterator provides access to a complete listing of AmlComputeNodeInformation -// values. -type AmlComputeNodesInformationIterator struct { - i int - page AmlComputeNodesInformationPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AmlComputeNodesInformationIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AmlComputeNodesInformationIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AmlComputeNodesInformationIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AmlComputeNodesInformationIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AmlComputeNodesInformationIterator) Response() AmlComputeNodesInformation { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AmlComputeNodesInformationIterator) Value() AmlComputeNodeInformation { - if !iter.page.NotDone() { - return AmlComputeNodeInformation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AmlComputeNodesInformationIterator type. -func NewAmlComputeNodesInformationIterator(page AmlComputeNodesInformationPage) AmlComputeNodesInformationIterator { - return AmlComputeNodesInformationIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (acni AmlComputeNodesInformation) IsEmpty() bool { - return acni.Nodes == nil || len(*acni.Nodes) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (acni AmlComputeNodesInformation) hasNextLink() bool { - return acni.NextLink != nil && len(*acni.NextLink) != 0 -} - -// amlComputeNodesInformationPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (acni AmlComputeNodesInformation) amlComputeNodesInformationPreparer(ctx context.Context) (*http.Request, error) { - if !acni.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(acni.NextLink))) -} - -// AmlComputeNodesInformationPage contains a page of AmlComputeNodeInformation values. -type AmlComputeNodesInformationPage struct { - fn func(context.Context, AmlComputeNodesInformation) (AmlComputeNodesInformation, error) - acni AmlComputeNodesInformation -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AmlComputeNodesInformationPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AmlComputeNodesInformationPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.acni) - if err != nil { - return err - } - page.acni = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AmlComputeNodesInformationPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AmlComputeNodesInformationPage) NotDone() bool { - return !page.acni.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AmlComputeNodesInformationPage) Response() AmlComputeNodesInformation { - return page.acni -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AmlComputeNodesInformationPage) Values() []AmlComputeNodeInformation { - if page.acni.IsEmpty() { - return nil - } - return *page.acni.Nodes -} - -// Creates a new instance of the AmlComputeNodesInformationPage type. -func NewAmlComputeNodesInformationPage(cur AmlComputeNodesInformation, getNextPage func(context.Context, AmlComputeNodesInformation) (AmlComputeNodesInformation, error)) AmlComputeNodesInformationPage { - return AmlComputeNodesInformationPage{ - fn: getNextPage, - acni: cur, - } -} - -// AmlComputeProperties AML Compute properties -type AmlComputeProperties struct { - // OsType - Compute OS Type. Possible values include: 'OsTypeLinux', 'OsTypeWindows' - OsType OsType `json:"osType,omitempty"` - // VMSize - Virtual Machine Size - VMSize *string `json:"vmSize,omitempty"` - // VMPriority - Virtual Machine priority. Possible values include: 'VMPriorityDedicated', 'VMPriorityLowPriority' - VMPriority VMPriority `json:"vmPriority,omitempty"` - // VirtualMachineImage - Virtual Machine image for AML Compute - windows only - VirtualMachineImage *VirtualMachineImage `json:"virtualMachineImage,omitempty"` - // IsolatedNetwork - Network is isolated or not - IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"` - // ScaleSettings - Scale settings for AML Compute - ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` - // UserAccountCredentials - Credentials for an administrator user account that will be created on each compute node. - UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` - // Subnet - Virtual network subnet resource ID the compute nodes belong to. - Subnet *ResourceID `json:"subnet,omitempty"` - // 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' - RemoteLoginPortPublicAccess RemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"` - // 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: 'AllocationStateSteady', 'AllocationStateResizing' - AllocationState AllocationState `json:"allocationState,omitempty"` - // AllocationStateTransitionTime - READ-ONLY; The time at which the compute entered its current allocation state. - AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` - // Errors - READ-ONLY; Collection of errors encountered by various compute nodes during node setup. - Errors *[]ErrorResponse `json:"errors,omitempty"` - // CurrentNodeCount - READ-ONLY; The number of compute nodes currently assigned to the compute. - CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"` - // 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. - TargetNodeCount *int32 `json:"targetNodeCount,omitempty"` - // NodeStateCounts - READ-ONLY; Counts of various node states on the compute. - NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"` - // EnableNodePublicIP - Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs. - EnableNodePublicIP *bool `json:"enableNodePublicIp,omitempty"` -} - -// MarshalJSON is the custom marshaler for AmlComputeProperties. -func (acp AmlComputeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if acp.OsType != "" { - objectMap["osType"] = acp.OsType - } - if acp.VMSize != nil { - objectMap["vmSize"] = acp.VMSize - } - if acp.VMPriority != "" { - objectMap["vmPriority"] = acp.VMPriority - } - if acp.VirtualMachineImage != nil { - objectMap["virtualMachineImage"] = acp.VirtualMachineImage - } - if acp.IsolatedNetwork != nil { - objectMap["isolatedNetwork"] = acp.IsolatedNetwork - } - if acp.ScaleSettings != nil { - objectMap["scaleSettings"] = acp.ScaleSettings - } - if acp.UserAccountCredentials != nil { - objectMap["userAccountCredentials"] = acp.UserAccountCredentials - } - if acp.Subnet != nil { - objectMap["subnet"] = acp.Subnet - } - if acp.RemoteLoginPortPublicAccess != "" { - objectMap["remoteLoginPortPublicAccess"] = acp.RemoteLoginPortPublicAccess - } - if acp.EnableNodePublicIP != nil { - objectMap["enableNodePublicIp"] = acp.EnableNodePublicIP - } - return json.Marshal(objectMap) -} - -// AmlUserFeature features enabled for a workspace -type AmlUserFeature struct { - // ID - Specifies the feature ID - ID *string `json:"id,omitempty"` - // DisplayName - Specifies the feature name - DisplayName *string `json:"displayName,omitempty"` - // Description - Describes the feature for user experience - Description *string `json:"description,omitempty"` -} - -// AssignedUser a user that can be assigned to a compute instance. -type AssignedUser struct { - // ObjectID - User’s AAD Object Id. - ObjectID *string `json:"objectId,omitempty"` - // TenantID - User’s AAD Tenant Id. - TenantID *string `json:"tenantId,omitempty"` -} - -// AutoPauseProperties auto pause properties -type AutoPauseProperties struct { - DelayInMinutes *int32 `json:"delayInMinutes,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} - -// AutoScaleProperties auto scale properties -type AutoScaleProperties struct { - MinNodeCount *int32 `json:"minNodeCount,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` -} - -// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. -type AzureEntityResource struct { - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureEntityResource. -func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ClusterUpdateParameters amlCompute update parameters. -type ClusterUpdateParameters struct { - // ClusterUpdateProperties - The properties of the amlCompute. - *ClusterUpdateProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ClusterUpdateParameters. -func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cup.ClusterUpdateProperties != nil { - objectMap["properties"] = cup.ClusterUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ClusterUpdateParameters struct. -func (cup *ClusterUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var clusterUpdateProperties ClusterUpdateProperties - err = json.Unmarshal(*v, &clusterUpdateProperties) - if err != nil { - return err - } - cup.ClusterUpdateProperties = &clusterUpdateProperties - } - } - } - - return nil -} - -// ClusterUpdateProperties the properties of a amlCompute that need to be updated. -type ClusterUpdateProperties struct { - // Properties - Properties of ClusterUpdate - Properties *ScaleSettingsInformation `json:"properties,omitempty"` -} - -// BasicCompute machine Learning compute object. -type BasicCompute interface { - AsAKS() (*AKS, bool) - AsAmlCompute() (*AmlCompute, bool) - AsComputeInstance() (*ComputeInstance, bool) - AsVirtualMachine() (*VirtualMachine, bool) - AsHDInsight() (*HDInsight, bool) - AsDataFactory() (*DataFactory, bool) - AsDatabricks() (*Databricks, bool) - AsDataLakeAnalytics() (*DataLakeAnalytics, bool) - AsSynapseSpark() (*SynapseSpark, bool) - AsCompute() (*Compute, bool) -} - -// Compute machine Learning compute object. -type Compute struct { - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -func unmarshalBasicCompute(body []byte) (BasicCompute, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["computeType"] { - case string(ComputeTypeBasicComputeComputeTypeAKS): - var a AKS - err := json.Unmarshal(body, &a) - return a, err - case string(ComputeTypeBasicComputeComputeTypeAmlCompute): - var ac AmlCompute - err := json.Unmarshal(body, &ac) - return ac, err - case string(ComputeTypeBasicComputeComputeTypeComputeInstance): - var ci ComputeInstance - err := json.Unmarshal(body, &ci) - return ci, err - case string(ComputeTypeBasicComputeComputeTypeVirtualMachine): - var VM VirtualMachine - err := json.Unmarshal(body, &VM) - return VM, err - case string(ComputeTypeBasicComputeComputeTypeHDInsight): - var hi HDInsight - err := json.Unmarshal(body, &hi) - return hi, err - case string(ComputeTypeBasicComputeComputeTypeDataFactory): - var df DataFactory - err := json.Unmarshal(body, &df) - return df, err - case string(ComputeTypeBasicComputeComputeTypeDatabricks): - var d Databricks - err := json.Unmarshal(body, &d) - return d, err - case string(ComputeTypeBasicComputeComputeTypeDataLakeAnalytics): - var dla DataLakeAnalytics - err := json.Unmarshal(body, &dla) - return dla, err - case string(ComputeTypeBasicComputeComputeTypeSynapseSpark): - var ss SynapseSpark - err := json.Unmarshal(body, &ss) - return ss, err - default: - var c Compute - err := json.Unmarshal(body, &c) - return c, err - } -} -func unmarshalBasicComputeArray(body []byte) ([]BasicCompute, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - cArray := make([]BasicCompute, len(rawMessages)) - - for index, rawMessage := range rawMessages { - c, err := unmarshalBasicCompute(*rawMessage) - if err != nil { - return nil, err - } - cArray[index] = c - } - return cArray, nil -} - -// MarshalJSON is the custom marshaler for Compute. -func (c Compute) MarshalJSON() ([]byte, error) { - c.ComputeType = ComputeTypeBasicComputeComputeTypeCompute - objectMap := make(map[string]interface{}) - if c.ComputeLocation != nil { - objectMap["computeLocation"] = c.ComputeLocation - } - if c.Description != nil { - objectMap["description"] = c.Description - } - if c.ResourceID != nil { - objectMap["resourceId"] = c.ResourceID - } - if c.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = c.DisableLocalAuth - } - if c.ComputeType != "" { - objectMap["computeType"] = c.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for Compute. -func (c Compute) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for Compute. -func (c Compute) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for Compute. -func (c Compute) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for Compute. -func (c Compute) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for Compute. -func (c Compute) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for Compute. -func (c Compute) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for Compute. -func (c Compute) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for Compute. -func (c Compute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for Compute. -func (c Compute) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for Compute. -func (c Compute) AsCompute() (*Compute, bool) { - return &c, true -} - -// AsBasicCompute is the BasicCompute implementation for Compute. -func (c Compute) AsBasicCompute() (BasicCompute, bool) { - return &c, true -} - -// ComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ComputeCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ComputeClient) (ComputeResource, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ComputeCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ComputeCreateOrUpdateFuture.Result. -func (future *ComputeCreateOrUpdateFuture) result(client ComputeClient) (cr ComputeResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.ComputeCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { - cr, err = client.CreateOrUpdateResponder(cr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") - } - } - return -} - -// ComputeDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ComputeDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ComputeClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ComputeDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ComputeDeleteFuture.Result. -func (future *ComputeDeleteFuture) result(client ComputeClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.ComputeDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ComputeInstance an Azure Machine Learning compute instance. -type ComputeInstance struct { - // Properties - Properties of ComputeInstance - Properties *ComputeInstanceProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ComputeInstance. -func (ci ComputeInstance) MarshalJSON() ([]byte, error) { - ci.ComputeType = ComputeTypeBasicComputeComputeTypeComputeInstance - objectMap := make(map[string]interface{}) - if ci.Properties != nil { - objectMap["properties"] = ci.Properties - } - if ci.ComputeLocation != nil { - objectMap["computeLocation"] = ci.ComputeLocation - } - if ci.Description != nil { - objectMap["description"] = ci.Description - } - if ci.ResourceID != nil { - objectMap["resourceId"] = ci.ResourceID - } - if ci.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = ci.DisableLocalAuth - } - if ci.ComputeType != "" { - objectMap["computeType"] = ci.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsComputeInstance() (*ComputeInstance, bool) { - return &ci, true -} - -// AsVirtualMachine is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for ComputeInstance. -func (ci ComputeInstance) AsBasicCompute() (BasicCompute, bool) { - return &ci, true -} - -// ComputeInstanceApplication defines an Aml Instance application and its connectivity endpoint URI. -type ComputeInstanceApplication struct { - // DisplayName - Name of the ComputeInstance application. - DisplayName *string `json:"displayName,omitempty"` - // EndpointURI - Application' endpoint URI. - EndpointURI *string `json:"endpointUri,omitempty"` -} - -// ComputeInstanceConnectivityEndpoints defines all connectivity endpoints and properties for an -// ComputeInstance. -type ComputeInstanceConnectivityEndpoints struct { - // PublicIPAddress - READ-ONLY; Public IP Address of this ComputeInstance. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - READ-ONLY; Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed). - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` -} - -// MarshalJSON is the custom marshaler for ComputeInstanceConnectivityEndpoints. -func (cice ComputeInstanceConnectivityEndpoints) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ComputeInstanceCreatedBy describes information on user who created this ComputeInstance. -type ComputeInstanceCreatedBy struct { - // UserName - READ-ONLY; Name of the user. - UserName *string `json:"userName,omitempty"` - // UserOrgID - READ-ONLY; Uniquely identifies user' Azure Active Directory organization. - UserOrgID *string `json:"userOrgId,omitempty"` - // UserID - READ-ONLY; Uniquely identifies the user within his/her organization. - UserID *string `json:"userId,omitempty"` -} - -// MarshalJSON is the custom marshaler for ComputeInstanceCreatedBy. -func (cicb ComputeInstanceCreatedBy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ComputeInstanceLastOperation the last operation on ComputeInstance. -type ComputeInstanceLastOperation struct { - // OperationName - Name of the last operation. Possible values include: 'OperationNameCreate', 'OperationNameStart', 'OperationNameStop', 'OperationNameRestart', 'OperationNameReimage', 'OperationNameDelete' - OperationName OperationName `json:"operationName,omitempty"` - // OperationTime - Time of the last operation. - OperationTime *date.Time `json:"operationTime,omitempty"` - // OperationStatus - Operation status. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusCreateFailed', 'OperationStatusStartFailed', 'OperationStatusStopFailed', 'OperationStatusRestartFailed', 'OperationStatusReimageFailed', 'OperationStatusDeleteFailed' - OperationStatus OperationStatus `json:"operationStatus,omitempty"` -} - -// ComputeInstanceProperties compute Instance properties -type ComputeInstanceProperties struct { - // VMSize - Virtual Machine Size - VMSize *string `json:"vmSize,omitempty"` - // Subnet - Virtual network subnet resource ID the compute nodes belong to. - Subnet *ResourceID `json:"subnet,omitempty"` - // ApplicationSharingPolicy - Policy for sharing applications on this compute instance among users of parent workspace. If Personal, only the creator can access applications on this compute instance. When Shared, any workspace user can access applications on this instance depending on his/her assigned role. Possible values include: 'ApplicationSharingPolicyPersonal', 'ApplicationSharingPolicyShared' - ApplicationSharingPolicy ApplicationSharingPolicy `json:"applicationSharingPolicy,omitempty"` - // SSHSettings - Specifies policy and settings for SSH access. - SSHSettings *ComputeInstanceSSHSettings `json:"sshSettings,omitempty"` - // ConnectivityEndpoints - READ-ONLY; Describes all connectivity endpoints available for this ComputeInstance. - ConnectivityEndpoints *ComputeInstanceConnectivityEndpoints `json:"connectivityEndpoints,omitempty"` - // Applications - READ-ONLY; Describes available applications and their endpoints on this ComputeInstance. - Applications *[]ComputeInstanceApplication `json:"applications,omitempty"` - // CreatedBy - READ-ONLY; Describes information on user who created this ComputeInstance. - CreatedBy *ComputeInstanceCreatedBy `json:"createdBy,omitempty"` - // Errors - READ-ONLY; Collection of errors encountered on this ComputeInstance. - Errors *[]ErrorResponse `json:"errors,omitempty"` - // State - READ-ONLY; The current state of this ComputeInstance. Possible values include: 'ComputeInstanceStateCreating', 'ComputeInstanceStateCreateFailed', 'ComputeInstanceStateDeleting', 'ComputeInstanceStateRunning', 'ComputeInstanceStateRestarting', 'ComputeInstanceStateJobRunning', 'ComputeInstanceStateSettingUp', 'ComputeInstanceStateSetupFailed', 'ComputeInstanceStateStarting', 'ComputeInstanceStateStopped', 'ComputeInstanceStateStopping', 'ComputeInstanceStateUserSettingUp', 'ComputeInstanceStateUserSetupFailed', 'ComputeInstanceStateUnknown', 'ComputeInstanceStateUnusable' - State ComputeInstanceState `json:"state,omitempty"` - // ComputeInstanceAuthorizationType - The Compute Instance Authorization type. Available values are personal (default). Possible values include: 'ComputeInstanceAuthorizationTypePersonal' - ComputeInstanceAuthorizationType ComputeInstanceAuthorizationType `json:"computeInstanceAuthorizationType,omitempty"` - // PersonalComputeInstanceSettings - Settings for a personal compute instance. - PersonalComputeInstanceSettings *PersonalComputeInstanceSettings `json:"personalComputeInstanceSettings,omitempty"` - // SetupScripts - Details of customized scripts to execute for setting up the cluster. - SetupScripts *SetupScripts `json:"setupScripts,omitempty"` - // LastOperation - READ-ONLY; The last operation on ComputeInstance. - LastOperation *ComputeInstanceLastOperation `json:"lastOperation,omitempty"` -} - -// MarshalJSON is the custom marshaler for ComputeInstanceProperties. -func (cip ComputeInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cip.VMSize != nil { - objectMap["vmSize"] = cip.VMSize - } - if cip.Subnet != nil { - objectMap["subnet"] = cip.Subnet - } - if cip.ApplicationSharingPolicy != "" { - objectMap["applicationSharingPolicy"] = cip.ApplicationSharingPolicy - } - if cip.SSHSettings != nil { - objectMap["sshSettings"] = cip.SSHSettings - } - if cip.ComputeInstanceAuthorizationType != "" { - objectMap["computeInstanceAuthorizationType"] = cip.ComputeInstanceAuthorizationType - } - if cip.PersonalComputeInstanceSettings != nil { - objectMap["personalComputeInstanceSettings"] = cip.PersonalComputeInstanceSettings - } - if cip.SetupScripts != nil { - objectMap["setupScripts"] = cip.SetupScripts - } - return json.Marshal(objectMap) -} - -// ComputeInstanceSSHSettings specifies policy and settings for SSH access. -type ComputeInstanceSSHSettings struct { - // SSHPublicAccess - State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable. Possible values include: 'SSHPublicAccessEnabled', 'SSHPublicAccessDisabled' - SSHPublicAccess SSHPublicAccess `json:"sshPublicAccess,omitempty"` - // AdminUserName - READ-ONLY; Describes the admin user name. - AdminUserName *string `json:"adminUserName,omitempty"` - // SSHPort - READ-ONLY; Describes the port for connecting through SSH. - SSHPort *int32 `json:"sshPort,omitempty"` - // AdminPublicKey - Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. - AdminPublicKey *string `json:"adminPublicKey,omitempty"` -} - -// MarshalJSON is the custom marshaler for ComputeInstanceSSHSettings. -func (ciss ComputeInstanceSSHSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ciss.SSHPublicAccess != "" { - objectMap["sshPublicAccess"] = ciss.SSHPublicAccess - } - if ciss.AdminPublicKey != nil { - objectMap["adminPublicKey"] = ciss.AdminPublicKey - } - return json.Marshal(objectMap) -} - -// ComputeResource machine Learning compute object wrapped into ARM resource envelope. -type ComputeResource struct { - autorest.Response `json:"-"` - // Properties - Compute properties - Properties BasicCompute `json:"properties,omitempty"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // Location - Specifies the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Contains resource tags defined as key/value pairs. - Tags map[string]*string `json:"tags"` - // Sku - The sku of the workspace. - Sku *Sku `json:"sku,omitempty"` - // SystemData - System data - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ComputeResource. -func (cr ComputeResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["properties"] = cr.Properties - if cr.Identity != nil { - objectMap["identity"] = cr.Identity - } - if cr.Location != nil { - objectMap["location"] = cr.Location - } - if cr.Tags != nil { - objectMap["tags"] = cr.Tags - } - if cr.Sku != nil { - objectMap["sku"] = cr.Sku - } - if cr.SystemData != nil { - objectMap["systemData"] = cr.SystemData - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ComputeResource struct. -func (cr *ComputeResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - properties, err := unmarshalBasicCompute(*v) - if err != nil { - return err - } - cr.Properties = properties - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - cr.Identity = &identity - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cr.Tags = tags - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - cr.Sku = &sku - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - cr.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cr.Type = &typeVar - } - } - } - - return nil -} - -// ComputeRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ComputeRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ComputeClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ComputeRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ComputeRestartFuture.Result. -func (future *ComputeRestartFuture) result(client ComputeClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.ComputeRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// BasicComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. -type BasicComputeSecrets interface { - AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) - AsComputeSecrets() (*ComputeSecrets, bool) -} - -// ComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. -type ComputeSecrets struct { - autorest.Response `json:"-"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine' - ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` -} - -func unmarshalBasicComputeSecrets(body []byte) (BasicComputeSecrets, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["computeType"] { - case string(ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine): - var vms VirtualMachineSecrets - err := json.Unmarshal(body, &vms) - return vms, err - default: - var cs ComputeSecrets - err := json.Unmarshal(body, &cs) - return cs, err - } -} -func unmarshalBasicComputeSecretsArray(body []byte) ([]BasicComputeSecrets, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - csArray := make([]BasicComputeSecrets, len(rawMessages)) - - for index, rawMessage := range rawMessages { - cs, err := unmarshalBasicComputeSecrets(*rawMessage) - if err != nil { - return nil, err - } - csArray[index] = cs - } - return csArray, nil -} - -// MarshalJSON is the custom marshaler for ComputeSecrets. -func (cs ComputeSecrets) MarshalJSON() ([]byte, error) { - cs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets - objectMap := make(map[string]interface{}) - if cs.ComputeType != "" { - objectMap["computeType"] = cs.ComputeType - } - return json.Marshal(objectMap) -} - -// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for ComputeSecrets. -func (cs ComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { - return nil, false -} - -// AsComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. -func (cs ComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { - return &cs, true -} - -// AsBasicComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. -func (cs ComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { - return &cs, true -} - -// ComputeSecretsModel ... -type ComputeSecretsModel struct { - autorest.Response `json:"-"` - Value BasicComputeSecrets `json:"value,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ComputeSecretsModel struct. -func (csm *ComputeSecretsModel) UnmarshalJSON(body []byte) error { - cs, err := unmarshalBasicComputeSecrets(body) - if err != nil { - return err - } - csm.Value = cs - - return nil -} - -// ComputeStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ComputeStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ComputeClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ComputeStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ComputeStartFuture.Result. -func (future *ComputeStartFuture) result(client ComputeClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.ComputeStartFuture") - return - } - ar.Response = future.Response() - return -} - -// ComputeStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ComputeStopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ComputeClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ComputeStopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ComputeStopFuture.Result. -func (future *ComputeStopFuture) result(client ComputeClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeStopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.ComputeStopFuture") - return - } - ar.Response = future.Response() - return -} - -// ComputeUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ComputeUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ComputeClient) (ComputeResource, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ComputeUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ComputeUpdateFuture.Result. -func (future *ComputeUpdateFuture) result(client ComputeClient) (cr ComputeResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.ComputeUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { - cr, err = client.UpdateResponder(cr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.ComputeUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") - } - } - return -} - -// ContainerResourceRequirements the resource requirements for the container (cpu and memory). -type ContainerResourceRequirements struct { - // CPU - The minimum amount of CPU cores to be used by the container. More info: - // https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - CPU *float64 `json:"cpu,omitempty"` - // CPULimit - The maximum amount of CPU cores allowed to be used by the container. More info: - // https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - CPULimit *float64 `json:"cpuLimit,omitempty"` - // MemoryInGB - The minimum amount of memory (in GB) to be used by the container. More info: - // https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - MemoryInGB *float64 `json:"memoryInGB,omitempty"` - // MemoryInGBLimit - The maximum amount of memory (in GB) allowed to be used by the container. More info: - // https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ - MemoryInGBLimit *float64 `json:"memoryInGBLimit,omitempty"` - // Gpu - The number of GPU cores in the container. - Gpu *int32 `json:"gpu,omitempty"` - // Fpga - The number of FPGA PCIE devices exposed to the container. Must be multiple of 2. - Fpga *int32 `json:"fpga,omitempty"` -} - -// CosmosDbSettings ... -type CosmosDbSettings struct { - // CollectionsThroughput - The throughput of the collections in cosmosdb database - CollectionsThroughput *int32 `json:"collectionsThroughput,omitempty"` -} - -// Databricks a DataFactory compute. -type Databricks struct { - Properties *DatabricksProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for Databricks. -func (d Databricks) MarshalJSON() ([]byte, error) { - d.ComputeType = ComputeTypeBasicComputeComputeTypeDatabricks - objectMap := make(map[string]interface{}) - if d.Properties != nil { - objectMap["properties"] = d.Properties - } - if d.ComputeLocation != nil { - objectMap["computeLocation"] = d.ComputeLocation - } - if d.Description != nil { - objectMap["description"] = d.Description - } - if d.ResourceID != nil { - objectMap["resourceId"] = d.ResourceID - } - if d.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = d.DisableLocalAuth - } - if d.ComputeType != "" { - objectMap["computeType"] = d.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for Databricks. -func (d Databricks) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for Databricks. -func (d Databricks) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for Databricks. -func (d Databricks) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for Databricks. -func (d Databricks) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for Databricks. -func (d Databricks) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for Databricks. -func (d Databricks) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for Databricks. -func (d Databricks) AsDatabricks() (*Databricks, bool) { - return &d, true -} - -// AsDataLakeAnalytics is the BasicCompute implementation for Databricks. -func (d Databricks) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for Databricks. -func (d Databricks) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for Databricks. -func (d Databricks) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for Databricks. -func (d Databricks) AsBasicCompute() (BasicCompute, bool) { - return &d, true -} - -// DatabricksComputeSecrets secrets related to a Machine Learning compute based on Databricks. -type DatabricksComputeSecrets struct { - // ComputeType - The type of compute. Possible values include: 'ComputeTypeAKS', 'ComputeTypeKubernetes', 'ComputeTypeAmlCompute', 'ComputeTypeComputeInstance', 'ComputeTypeDataFactory', 'ComputeTypeVirtualMachine', 'ComputeTypeHDInsight', 'ComputeTypeDatabricks', 'ComputeTypeDataLakeAnalytics', 'ComputeTypeSynapseSpark' - ComputeType ComputeType `json:"computeType,omitempty"` - // DatabricksAccessToken - access token for databricks account. - DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` -} - -// DatabricksComputeSecretsProperties properties of Databricks Compute Secrets -type DatabricksComputeSecretsProperties struct { - // DatabricksAccessToken - access token for databricks account. - DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` -} - -// DatabricksProperties properties of Databricks -type DatabricksProperties struct { - // DatabricksAccessToken - Databricks access token - DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` - // WorkspaceURL - Workspace Url - WorkspaceURL *string `json:"workspaceUrl,omitempty"` -} - -// DataFactory a DataFactory compute. -type DataFactory struct { - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataFactory. -func (df DataFactory) MarshalJSON() ([]byte, error) { - df.ComputeType = ComputeTypeBasicComputeComputeTypeDataFactory - objectMap := make(map[string]interface{}) - if df.ComputeLocation != nil { - objectMap["computeLocation"] = df.ComputeLocation - } - if df.Description != nil { - objectMap["description"] = df.Description - } - if df.ResourceID != nil { - objectMap["resourceId"] = df.ResourceID - } - if df.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = df.DisableLocalAuth - } - if df.ComputeType != "" { - objectMap["computeType"] = df.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsDataFactory() (*DataFactory, bool) { - return &df, true -} - -// AsDatabricks is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for DataFactory. -func (df DataFactory) AsBasicCompute() (BasicCompute, bool) { - return &df, true -} - -// DataLakeAnalytics a DataLakeAnalytics compute. -type DataLakeAnalytics struct { - Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataLakeAnalytics. -func (dla DataLakeAnalytics) MarshalJSON() ([]byte, error) { - dla.ComputeType = ComputeTypeBasicComputeComputeTypeDataLakeAnalytics - objectMap := make(map[string]interface{}) - if dla.Properties != nil { - objectMap["properties"] = dla.Properties - } - if dla.ComputeLocation != nil { - objectMap["computeLocation"] = dla.ComputeLocation - } - if dla.Description != nil { - objectMap["description"] = dla.Description - } - if dla.ResourceID != nil { - objectMap["resourceId"] = dla.ResourceID - } - if dla.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = dla.DisableLocalAuth - } - if dla.ComputeType != "" { - objectMap["computeType"] = dla.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return &dla, true -} - -// AsSynapseSpark is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for DataLakeAnalytics. -func (dla DataLakeAnalytics) AsBasicCompute() (BasicCompute, bool) { - return &dla, true -} - -// DataLakeAnalyticsProperties ... -type DataLakeAnalyticsProperties struct { - // DataLakeStoreAccountName - DataLake Store Account Name - DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` -} - -// DiagnoseRequestProperties ... -type DiagnoseRequestProperties struct { - // Udr - Setting for diagnosing user defined routing - Udr map[string]interface{} `json:"udr"` - // Nsg - Setting for diagnosing network security group - Nsg map[string]interface{} `json:"nsg"` - // ResourceLock - Setting for diagnosing resource lock - ResourceLock map[string]interface{} `json:"resourceLock"` - // DNSResolution - Setting for diagnosing dns resolution - DNSResolution map[string]interface{} `json:"dnsResolution"` - // StorageAccount - Setting for diagnosing dependent storage account - StorageAccount map[string]interface{} `json:"storageAccount"` - // KeyVault - Setting for diagnosing dependent key vault - KeyVault map[string]interface{} `json:"keyVault"` - // ContainerRegistry - Setting for diagnosing dependent container registry - ContainerRegistry map[string]interface{} `json:"containerRegistry"` - // ApplicationInsights - Setting for diagnosing dependent application insights - ApplicationInsights map[string]interface{} `json:"applicationInsights"` - // Others - Setting for diagnosing unclassified category of problems - Others map[string]interface{} `json:"others"` -} - -// MarshalJSON is the custom marshaler for DiagnoseRequestProperties. -func (drp DiagnoseRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if drp.Udr != nil { - objectMap["udr"] = drp.Udr - } - if drp.Nsg != nil { - objectMap["nsg"] = drp.Nsg - } - if drp.ResourceLock != nil { - objectMap["resourceLock"] = drp.ResourceLock - } - if drp.DNSResolution != nil { - objectMap["dnsResolution"] = drp.DNSResolution - } - if drp.StorageAccount != nil { - objectMap["storageAccount"] = drp.StorageAccount - } - if drp.KeyVault != nil { - objectMap["keyVault"] = drp.KeyVault - } - if drp.ContainerRegistry != nil { - objectMap["containerRegistry"] = drp.ContainerRegistry - } - if drp.ApplicationInsights != nil { - objectMap["applicationInsights"] = drp.ApplicationInsights - } - if drp.Others != nil { - objectMap["others"] = drp.Others - } - return json.Marshal(objectMap) -} - -// DiagnoseResponseResult ... -type DiagnoseResponseResult struct { - autorest.Response `json:"-"` - Value *DiagnoseResponseResultValue `json:"value,omitempty"` -} - -// DiagnoseResponseResultValue ... -type DiagnoseResponseResultValue struct { - UserDefinedRouteResults *[]DiagnoseResult `json:"userDefinedRouteResults,omitempty"` - NetworkSecurityRuleResults *[]DiagnoseResult `json:"networkSecurityRuleResults,omitempty"` - ResourceLockResults *[]DiagnoseResult `json:"resourceLockResults,omitempty"` - DNSResolutionResults *[]DiagnoseResult `json:"dnsResolutionResults,omitempty"` - StorageAccountResults *[]DiagnoseResult `json:"storageAccountResults,omitempty"` - KeyVaultResults *[]DiagnoseResult `json:"keyVaultResults,omitempty"` - ContainerRegistryResults *[]DiagnoseResult `json:"containerRegistryResults,omitempty"` - ApplicationInsightsResults *[]DiagnoseResult `json:"applicationInsightsResults,omitempty"` - OtherResults *[]DiagnoseResult `json:"otherResults,omitempty"` -} - -// DiagnoseResult result of Diagnose -type DiagnoseResult struct { - // Code - READ-ONLY; Code for workspace setup error - Code *string `json:"code,omitempty"` - // Level - READ-ONLY; Level of workspace setup error. Possible values include: 'DiagnoseResultLevelWarning', 'DiagnoseResultLevelError', 'DiagnoseResultLevelInformation' - Level DiagnoseResultLevel `json:"level,omitempty"` - // Message - READ-ONLY; Message of workspace setup error - Message *string `json:"message,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiagnoseResult. -func (dr DiagnoseResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DiagnoseWorkspaceParameters parameters to diagnose a workspace -type DiagnoseWorkspaceParameters struct { - // Value - Value of Parameters - Value *DiagnoseRequestProperties `json:"value,omitempty"` -} - -// EncryptionProperty ... -type EncryptionProperty struct { - // Status - Indicates whether or not the encryption is enabled for the workspace. Possible values include: 'EncryptionStatusEnabled', 'EncryptionStatusDisabled' - Status EncryptionStatus `json:"status,omitempty"` - // Identity - The identity that will be used to access the key vault for encryption at rest. - Identity *IdentityForCmk `json:"identity,omitempty"` - // KeyVaultProperties - Customer Key vault properties. - KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` -} - -// ErrorAdditionalInfo the resource management error additional info. -type ErrorAdditionalInfo struct { - // Type - READ-ONLY; The additional info type. - Type *string `json:"type,omitempty"` - // Info - READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. -func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorDetail the error detail. -type ErrorDetail struct { - // Code - READ-ONLY; The error code. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; The error message. - Message *string `json:"message,omitempty"` - // Target - READ-ONLY; The error target. - Target *string `json:"target,omitempty"` - // Details - READ-ONLY; The error details. - Details *[]ErrorDetail `json:"details,omitempty"` - // AdditionalInfo - READ-ONLY; The error additional info. - AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorDetail. -func (ed ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for -// failed operations. (This also follows the OData error response format.). -type ErrorResponse struct { - // Error - The error object. - Error *ErrorDetail `json:"error,omitempty"` -} - -// EstimatedVMPrice the estimated price info for using a VM of a particular OS type, tier, etc. -type EstimatedVMPrice struct { - // RetailPrice - The price charged for using the VM. - RetailPrice *float64 `json:"retailPrice,omitempty"` - // OsType - Operating system type used by the VM. Possible values include: 'VMPriceOSTypeLinux', 'VMPriceOSTypeWindows' - OsType VMPriceOSType `json:"osType,omitempty"` - // VMTier - The type of the VM. Possible values include: 'VMTierStandard', 'VMTierLowPriority', 'VMTierSpot' - VMTier VMTier `json:"vmTier,omitempty"` -} - -// EstimatedVMPrices the estimated price info for using a VM. -type EstimatedVMPrices struct { - // BillingCurrency - Three lettered code specifying the currency of the VM price. Example: USD - BillingCurrency *string `json:"billingCurrency,omitempty"` - // UnitOfMeasure - The unit of time measurement for the specified VM price. Example: OneHour - UnitOfMeasure *string `json:"unitOfMeasure,omitempty"` - // Values - The list of estimated prices for using a VM of a particular OS type, tier, etc. - Values *[]EstimatedVMPrice `json:"values,omitempty"` -} - -// ExternalFQDNResponse ... -type ExternalFQDNResponse struct { - autorest.Response `json:"-"` - Value *[]FQDNEndpoints `json:"value,omitempty"` -} - -// FQDNEndpoint ... -type FQDNEndpoint struct { - DomainName *string `json:"domainName,omitempty"` - EndpointDetails *[]FQDNEndpointDetail `json:"endpointDetails,omitempty"` -} - -// FQDNEndpointDetail ... -type FQDNEndpointDetail struct { - Port *int32 `json:"port,omitempty"` -} - -// FQDNEndpoints ... -type FQDNEndpoints struct { - Properties *FQDNEndpointsProperties `json:"properties,omitempty"` -} - -// FQDNEndpointsProperties ... -type FQDNEndpointsProperties struct { - Category *string `json:"category,omitempty"` - Endpoints *[]FQDNEndpoint `json:"endpoints,omitempty"` -} - -// HDInsight a HDInsight compute. -type HDInsight struct { - Properties *HDInsightProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for HDInsight. -func (hi HDInsight) MarshalJSON() ([]byte, error) { - hi.ComputeType = ComputeTypeBasicComputeComputeTypeHDInsight - objectMap := make(map[string]interface{}) - if hi.Properties != nil { - objectMap["properties"] = hi.Properties - } - if hi.ComputeLocation != nil { - objectMap["computeLocation"] = hi.ComputeLocation - } - if hi.Description != nil { - objectMap["description"] = hi.Description - } - if hi.ResourceID != nil { - objectMap["resourceId"] = hi.ResourceID - } - if hi.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = hi.DisableLocalAuth - } - if hi.ComputeType != "" { - objectMap["computeType"] = hi.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsHDInsight() (*HDInsight, bool) { - return &hi, true -} - -// AsDataFactory is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for HDInsight. -func (hi HDInsight) AsBasicCompute() (BasicCompute, bool) { - return &hi, true -} - -// HDInsightProperties hDInsight compute properties -type HDInsightProperties struct { - // SSHPort - Port open for ssh connections on the master node of the cluster. - SSHPort *int32 `json:"sshPort,omitempty"` - // Address - Public IP address of the master node of the cluster. - Address *string `json:"address,omitempty"` - // AdministratorAccount - Admin credentials for master node of the cluster - AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` -} - -// Identity identity for the resource. -type Identity struct { - // PrincipalID - READ-ONLY; The principal ID of resource identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant ID of resource. - TenantID *string `json:"tenantId,omitempty"` - // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The user assigned identities associated with the resource. - UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.Type != "" { - objectMap["type"] = i.Type - } - if i.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = i.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// IdentityForCmk identity that will be used to access key vault for encryption at rest -type IdentityForCmk struct { - // UserAssignedIdentity - The ArmId of the user assigned identity that will be used to access the customer managed key vault - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} - -// InstanceTypeSchema instance type schema. -type InstanceTypeSchema struct { - // NodeSelector - Node Selector - NodeSelector map[string]*string `json:"nodeSelector"` - // Resources - Resource requests/limits for this instance type - Resources *InstanceTypeSchemaResources `json:"resources,omitempty"` -} - -// MarshalJSON is the custom marshaler for InstanceTypeSchema. -func (its InstanceTypeSchema) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if its.NodeSelector != nil { - objectMap["nodeSelector"] = its.NodeSelector - } - if its.Resources != nil { - objectMap["resources"] = its.Resources - } - return json.Marshal(objectMap) -} - -// InstanceTypeSchemaResources resource requests/limits for this instance type -type InstanceTypeSchemaResources struct { - // Requests - Resource requests for this instance type - Requests map[string]*string `json:"requests"` - // Limits - Resource limits for this instance type - Limits map[string]*string `json:"limits"` -} - -// MarshalJSON is the custom marshaler for InstanceTypeSchemaResources. -func (its InstanceTypeSchemaResources) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if its.Requests != nil { - objectMap["requests"] = its.Requests - } - if its.Limits != nil { - objectMap["limits"] = its.Limits - } - return json.Marshal(objectMap) -} - -// KeyVaultProperties ... -type KeyVaultProperties struct { - // KeyVaultArmID - The ArmId of the keyVault where the customer owned encryption key is present. - KeyVaultArmID *string `json:"keyVaultArmId,omitempty"` - // KeyIdentifier - Key vault uri to access the encryption key. - KeyIdentifier *string `json:"keyIdentifier,omitempty"` - // IdentityClientID - For future use - The client id of the identity which will be used to access key vault. - IdentityClientID *string `json:"identityClientId,omitempty"` -} - -// Kubernetes a Machine Learning compute based on Kubernetes Compute. -type Kubernetes struct { - // ComputeType - The type of compute. Possible values include: 'ComputeTypeAKS', 'ComputeTypeKubernetes', 'ComputeTypeAmlCompute', 'ComputeTypeComputeInstance', 'ComputeTypeDataFactory', 'ComputeTypeVirtualMachine', 'ComputeTypeHDInsight', 'ComputeTypeDatabricks', 'ComputeTypeDataLakeAnalytics', 'ComputeTypeSynapseSpark' - ComputeType ComputeType `json:"computeType,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // Properties - Properties of Kubernetes - Properties *KubernetesProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Kubernetes. -func (kVar Kubernetes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if kVar.ComputeType != "" { - objectMap["computeType"] = kVar.ComputeType - } - if kVar.ComputeLocation != nil { - objectMap["computeLocation"] = kVar.ComputeLocation - } - if kVar.Description != nil { - objectMap["description"] = kVar.Description - } - if kVar.ResourceID != nil { - objectMap["resourceId"] = kVar.ResourceID - } - if kVar.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = kVar.DisableLocalAuth - } - if kVar.Properties != nil { - objectMap["properties"] = kVar.Properties - } - return json.Marshal(objectMap) -} - -// KubernetesProperties kubernetes properties -type KubernetesProperties struct { - // RelayConnectionString - Relay connection string. - RelayConnectionString *string `json:"relayConnectionString,omitempty"` - // ServiceBusConnectionString - ServiceBus connection string. - ServiceBusConnectionString *string `json:"serviceBusConnectionString,omitempty"` - // ExtensionPrincipalID - Extension principal-id. - ExtensionPrincipalID *string `json:"extensionPrincipalId,omitempty"` - // ExtensionInstanceReleaseTrain - Extension instance release train. - ExtensionInstanceReleaseTrain *string `json:"extensionInstanceReleaseTrain,omitempty"` - // VcName - VC name. - VcName *string `json:"vcName,omitempty"` - // Namespace - Compute namespace - Namespace *string `json:"namespace,omitempty"` - // DefaultInstanceType - Default instance type - DefaultInstanceType *string `json:"defaultInstanceType,omitempty"` - // InstanceTypes - Instance Type Schema - InstanceTypes map[string]*InstanceTypeSchema `json:"instanceTypes"` -} - -// MarshalJSON is the custom marshaler for KubernetesProperties. -func (kp KubernetesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if kp.RelayConnectionString != nil { - objectMap["relayConnectionString"] = kp.RelayConnectionString - } - if kp.ServiceBusConnectionString != nil { - objectMap["serviceBusConnectionString"] = kp.ServiceBusConnectionString - } - if kp.ExtensionPrincipalID != nil { - objectMap["extensionPrincipalId"] = kp.ExtensionPrincipalID - } - if kp.ExtensionInstanceReleaseTrain != nil { - objectMap["extensionInstanceReleaseTrain"] = kp.ExtensionInstanceReleaseTrain - } - if kp.VcName != nil { - objectMap["vcName"] = kp.VcName - } - if kp.Namespace != nil { - objectMap["namespace"] = kp.Namespace - } - if kp.DefaultInstanceType != nil { - objectMap["defaultInstanceType"] = kp.DefaultInstanceType - } - if kp.InstanceTypes != nil { - objectMap["instanceTypes"] = kp.InstanceTypes - } - return json.Marshal(objectMap) -} - -// KubernetesSchema kubernetes Compute Schema -type KubernetesSchema struct { - // Properties - Properties of Kubernetes - Properties *KubernetesProperties `json:"properties,omitempty"` -} - -// ListAmlUserFeatureResult the List Aml user feature operation response. -type ListAmlUserFeatureResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of AML user facing features. - Value *[]AmlUserFeature `json:"value,omitempty"` - // 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. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ListAmlUserFeatureResult. -func (laufr ListAmlUserFeatureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ListAmlUserFeatureResultIterator provides access to a complete listing of AmlUserFeature values. -type ListAmlUserFeatureResultIterator struct { - i int - page ListAmlUserFeatureResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListAmlUserFeatureResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListAmlUserFeatureResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListAmlUserFeatureResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListAmlUserFeatureResultIterator) Response() ListAmlUserFeatureResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListAmlUserFeatureResultIterator) Value() AmlUserFeature { - if !iter.page.NotDone() { - return AmlUserFeature{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListAmlUserFeatureResultIterator type. -func NewListAmlUserFeatureResultIterator(page ListAmlUserFeatureResultPage) ListAmlUserFeatureResultIterator { - return ListAmlUserFeatureResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (laufr ListAmlUserFeatureResult) IsEmpty() bool { - return laufr.Value == nil || len(*laufr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (laufr ListAmlUserFeatureResult) hasNextLink() bool { - return laufr.NextLink != nil && len(*laufr.NextLink) != 0 -} - -// listAmlUserFeatureResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (laufr ListAmlUserFeatureResult) listAmlUserFeatureResultPreparer(ctx context.Context) (*http.Request, error) { - if !laufr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(laufr.NextLink))) -} - -// ListAmlUserFeatureResultPage contains a page of AmlUserFeature values. -type ListAmlUserFeatureResultPage struct { - fn func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error) - laufr ListAmlUserFeatureResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListAmlUserFeatureResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.laufr) - if err != nil { - return err - } - page.laufr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListAmlUserFeatureResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListAmlUserFeatureResultPage) NotDone() bool { - return !page.laufr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListAmlUserFeatureResultPage) Response() ListAmlUserFeatureResult { - return page.laufr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListAmlUserFeatureResultPage) Values() []AmlUserFeature { - if page.laufr.IsEmpty() { - return nil - } - return *page.laufr.Value -} - -// Creates a new instance of the ListAmlUserFeatureResultPage type. -func NewListAmlUserFeatureResultPage(cur ListAmlUserFeatureResult, getNextPage func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error)) ListAmlUserFeatureResultPage { - return ListAmlUserFeatureResultPage{ - fn: getNextPage, - laufr: cur, - } -} - -// ListNotebookKeysResult ... -type ListNotebookKeysResult struct { - autorest.Response `json:"-"` - // PrimaryAccessKey - READ-ONLY - PrimaryAccessKey *string `json:"primaryAccessKey,omitempty"` - // SecondaryAccessKey - READ-ONLY - SecondaryAccessKey *string `json:"secondaryAccessKey,omitempty"` -} - -// MarshalJSON is the custom marshaler for ListNotebookKeysResult. -func (lnkr ListNotebookKeysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ListStorageAccountKeysResult ... -type ListStorageAccountKeysResult struct { - autorest.Response `json:"-"` - // UserStorageKey - READ-ONLY - UserStorageKey *string `json:"userStorageKey,omitempty"` -} - -// MarshalJSON is the custom marshaler for ListStorageAccountKeysResult. -func (lsakr ListStorageAccountKeysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ListUsagesResult the List Usages operation response. -type ListUsagesResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of AML resource usages. - Value *[]Usage `json:"value,omitempty"` - // 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. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ListUsagesResult. -func (lur ListUsagesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ListUsagesResultIterator provides access to a complete listing of Usage values. -type ListUsagesResultIterator struct { - i int - page ListUsagesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListUsagesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListUsagesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListUsagesResultIterator) Response() ListUsagesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListUsagesResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListUsagesResultIterator type. -func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { - return ListUsagesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lur ListUsagesResult) IsEmpty() bool { - return lur.Value == nil || len(*lur.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lur ListUsagesResult) hasNextLink() bool { - return lur.NextLink != nil && len(*lur.NextLink) != 0 -} - -// listUsagesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lur.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lur.NextLink))) -} - -// ListUsagesResultPage contains a page of Usage values. -type ListUsagesResultPage struct { - fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) - lur ListUsagesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lur) - if err != nil { - return err - } - page.lur = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListUsagesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListUsagesResultPage) NotDone() bool { - return !page.lur.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListUsagesResultPage) Response() ListUsagesResult { - return page.lur -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListUsagesResultPage) Values() []Usage { - if page.lur.IsEmpty() { - return nil - } - return *page.lur.Value -} - -// Creates a new instance of the ListUsagesResultPage type. -func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return ListUsagesResultPage{ - fn: getNextPage, - lur: cur, - } -} - -// ListWorkspaceKeysResult ... -type ListWorkspaceKeysResult struct { - autorest.Response `json:"-"` - // UserStorageKey - READ-ONLY - UserStorageKey *string `json:"userStorageKey,omitempty"` - // UserStorageResourceID - READ-ONLY - UserStorageResourceID *string `json:"userStorageResourceId,omitempty"` - // AppInsightsInstrumentationKey - READ-ONLY - AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` - // ContainerRegistryCredentials - READ-ONLY - ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` - // NotebookAccessKeys - READ-ONLY - NotebookAccessKeys *ListNotebookKeysResult `json:"notebookAccessKeys,omitempty"` -} - -// MarshalJSON is the custom marshaler for ListWorkspaceKeysResult. -func (lwkr ListWorkspaceKeysResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ListWorkspaceQuotas the List WorkspaceQuotasByVMFamily operation response. -type ListWorkspaceQuotas struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of Workspace Quotas by VM Family - Value *[]ResourceQuota `json:"value,omitempty"` - // 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. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ListWorkspaceQuotas. -func (lwq ListWorkspaceQuotas) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ListWorkspaceQuotasIterator provides access to a complete listing of ResourceQuota values. -type ListWorkspaceQuotasIterator struct { - i int - page ListWorkspaceQuotasPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListWorkspaceQuotasIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListWorkspaceQuotasIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListWorkspaceQuotasIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListWorkspaceQuotasIterator) Response() ListWorkspaceQuotas { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListWorkspaceQuotasIterator) Value() ResourceQuota { - if !iter.page.NotDone() { - return ResourceQuota{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListWorkspaceQuotasIterator type. -func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { - return ListWorkspaceQuotasIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lwq ListWorkspaceQuotas) IsEmpty() bool { - return lwq.Value == nil || len(*lwq.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lwq ListWorkspaceQuotas) hasNextLink() bool { - return lwq.NextLink != nil && len(*lwq.NextLink) != 0 -} - -// listWorkspaceQuotasPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lwq ListWorkspaceQuotas) listWorkspaceQuotasPreparer(ctx context.Context) (*http.Request, error) { - if !lwq.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lwq.NextLink))) -} - -// ListWorkspaceQuotasPage contains a page of ResourceQuota values. -type ListWorkspaceQuotasPage struct { - fn func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error) - lwq ListWorkspaceQuotas -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListWorkspaceQuotasPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lwq) - if err != nil { - return err - } - page.lwq = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListWorkspaceQuotasPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListWorkspaceQuotasPage) NotDone() bool { - return !page.lwq.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListWorkspaceQuotasPage) Response() ListWorkspaceQuotas { - return page.lwq -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListWorkspaceQuotasPage) Values() []ResourceQuota { - if page.lwq.IsEmpty() { - return nil - } - return *page.lwq.Value -} - -// Creates a new instance of the ListWorkspaceQuotasPage type. -func NewListWorkspaceQuotasPage(cur ListWorkspaceQuotas, getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { - return ListWorkspaceQuotasPage{ - fn: getNextPage, - lwq: cur, - } -} - -// NodeStateCounts counts of various compute node states on the amlCompute. -type NodeStateCounts struct { - // IdleNodeCount - READ-ONLY; Number of compute nodes in idle state. - IdleNodeCount *int32 `json:"idleNodeCount,omitempty"` - // RunningNodeCount - READ-ONLY; Number of compute nodes which are running jobs. - RunningNodeCount *int32 `json:"runningNodeCount,omitempty"` - // PreparingNodeCount - READ-ONLY; Number of compute nodes which are being prepared. - PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty"` - // UnusableNodeCount - READ-ONLY; Number of compute nodes which are in unusable state. - UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"` - // LeavingNodeCount - READ-ONLY; Number of compute nodes which are leaving the amlCompute. - LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"` - // PreemptedNodeCount - READ-ONLY; Number of compute nodes which are in preempted state. - PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for NodeStateCounts. -func (nsc NodeStateCounts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// NotebookAccessTokenResult ... -type NotebookAccessTokenResult struct { - autorest.Response `json:"-"` - // NotebookResourceID - READ-ONLY - NotebookResourceID *string `json:"notebookResourceId,omitempty"` - // HostName - READ-ONLY - HostName *string `json:"hostName,omitempty"` - // PublicDNS - READ-ONLY - PublicDNS *string `json:"publicDns,omitempty"` - // AccessToken - READ-ONLY - AccessToken *string `json:"accessToken,omitempty"` - // TokenType - READ-ONLY - TokenType *string `json:"tokenType,omitempty"` - // ExpiresIn - READ-ONLY - ExpiresIn *int32 `json:"expiresIn,omitempty"` - // RefreshToken - READ-ONLY - RefreshToken *string `json:"refreshToken,omitempty"` - // Scope - READ-ONLY - Scope *string `json:"scope,omitempty"` -} - -// MarshalJSON is the custom marshaler for NotebookAccessTokenResult. -func (natr NotebookAccessTokenResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// NotebookPreparationError ... -type NotebookPreparationError struct { - ErrorMessage *string `json:"errorMessage,omitempty"` - StatusCode *int32 `json:"statusCode,omitempty"` -} - -// NotebookResourceInfo ... -type NotebookResourceInfo struct { - autorest.Response `json:"-"` - Fqdn *string `json:"fqdn,omitempty"` - // ResourceID - the data plane resourceId that used to initialize notebook component - ResourceID *string `json:"resourceId,omitempty"` - // NotebookPreparationError - The error that occurs when preparing notebook. - NotebookPreparationError *NotebookPreparationError `json:"notebookPreparationError,omitempty"` -} - -// Operation azure Machine Learning workspace REST API operation -type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // Display - Display name of operation - Display *OperationDisplay `json:"display,omitempty"` -} - -// OperationDisplay display name of operation -type OperationDisplay struct { - // Provider - The resource provider name: Microsoft.MachineLearningExperimentation - Provider *string `json:"provider,omitempty"` - // Resource - The resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` - // Operation - The operation that users can perform. - Operation *string `json:"operation,omitempty"` - // Description - The description for the operation. - Description *string `json:"description,omitempty"` -} - -// OperationListResult an array of operations supported by the resource provider. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of AML workspace operations supported by the AML workspace resource provider. - Value *[]Operation `json:"value,omitempty"` -} - -// PaginatedComputeResourcesList paginated list of Machine Learning compute objects wrapped in ARM resource -// envelope. -type PaginatedComputeResourcesList struct { - autorest.Response `json:"-"` - // Value - An array of Machine Learning compute objects wrapped in ARM resource envelope. - Value *[]ComputeResource `json:"value,omitempty"` - // NextLink - A continuation link (absolute URI) to the next page of results in the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// PaginatedComputeResourcesListIterator provides access to a complete listing of ComputeResource values. -type PaginatedComputeResourcesListIterator struct { - i int - page PaginatedComputeResourcesListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PaginatedComputeResourcesListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PaginatedComputeResourcesListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PaginatedComputeResourcesListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PaginatedComputeResourcesListIterator) Response() PaginatedComputeResourcesList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PaginatedComputeResourcesListIterator) Value() ComputeResource { - if !iter.page.NotDone() { - return ComputeResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PaginatedComputeResourcesListIterator type. -func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator { - return PaginatedComputeResourcesListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pcrl PaginatedComputeResourcesList) IsEmpty() bool { - return pcrl.Value == nil || len(*pcrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pcrl PaginatedComputeResourcesList) hasNextLink() bool { - return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 -} - -// paginatedComputeResourcesListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pcrl PaginatedComputeResourcesList) paginatedComputeResourcesListPreparer(ctx context.Context) (*http.Request, error) { - if !pcrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pcrl.NextLink))) -} - -// PaginatedComputeResourcesListPage contains a page of ComputeResource values. -type PaginatedComputeResourcesListPage struct { - fn func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error) - pcrl PaginatedComputeResourcesList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PaginatedComputeResourcesListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pcrl) - if err != nil { - return err - } - page.pcrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PaginatedComputeResourcesListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PaginatedComputeResourcesListPage) NotDone() bool { - return !page.pcrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PaginatedComputeResourcesListPage) Response() PaginatedComputeResourcesList { - return page.pcrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PaginatedComputeResourcesListPage) Values() []ComputeResource { - if page.pcrl.IsEmpty() { - return nil - } - return *page.pcrl.Value -} - -// Creates a new instance of the PaginatedComputeResourcesListPage type. -func NewPaginatedComputeResourcesListPage(cur PaginatedComputeResourcesList, getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { - return PaginatedComputeResourcesListPage{ - fn: getNextPage, - pcrl: cur, - } -} - -// PaginatedWorkspaceConnectionsList paginated list of Workspace connection objects. -type PaginatedWorkspaceConnectionsList struct { - autorest.Response `json:"-"` - // Value - An array of Workspace connection objects. - Value *[]WorkspaceConnection `json:"value,omitempty"` - // NextLink - A continuation link (absolute URI) to the next page of results in the list. - NextLink *string `json:"nextLink,omitempty"` -} - -// Password ... -type Password struct { - // Name - READ-ONLY - Name *string `json:"name,omitempty"` - // Value - READ-ONLY - Value *string `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for Password. -func (p Password) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PersonalComputeInstanceSettings settings for a personal compute instance. -type PersonalComputeInstanceSettings struct { - // AssignedUser - A user explicitly assigned to a personal compute instance. - AssignedUser *AssignedUser `json:"assignedUser,omitempty"` -} - -// PrivateEndpoint the Private Endpoint resource. -type PrivateEndpoint struct { - // ID - READ-ONLY; The ARM identifier for Private Endpoint - ID *string `json:"id,omitempty"` - // SubnetArmID - READ-ONLY; The ARM identifier for Subnet resource that private endpoint links to - SubnetArmID *string `json:"subnetArmId,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpoint. -func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateEndpointConnection the Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Resource properties. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // Location - Specifies the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Contains resource tags defined as key/value pairs. - Tags map[string]*string `json:"tags"` - // Sku - The sku of the workspace. - Sku *Sku `json:"sku,omitempty"` - // SystemData - System data - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - if pec.Identity != nil { - objectMap["identity"] = pec.Identity - } - if pec.Location != nil { - objectMap["location"] = pec.Location - } - if pec.Tags != nil { - objectMap["tags"] = pec.Tags - } - if pec.Sku != nil { - objectMap["sku"] = pec.Sku - } - if pec.SystemData != nil { - objectMap["systemData"] = pec.SystemData - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - pec.Identity = &identity - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pec.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pec.Tags = tags - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - pec.Sku = &sku - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - pec.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified -// workspace -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - Array of private endpoint connections - Value *[]PrivateEndpointConnection `json:"value,omitempty"` -} - -// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' - ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` -} - -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - // PrivateLinkResourceProperties - Resource properties. - *PrivateLinkResourceProperties `json:"properties,omitempty"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // Location - Specifies the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Contains resource tags defined as key/value pairs. - Tags map[string]*string `json:"tags"` - // Sku - The sku of the workspace. - Sku *Sku `json:"sku,omitempty"` - // SystemData - System data - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResource. -func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plr.PrivateLinkResourceProperties != nil { - objectMap["properties"] = plr.PrivateLinkResourceProperties - } - if plr.Identity != nil { - objectMap["identity"] = plr.Identity - } - if plr.Location != nil { - objectMap["location"] = plr.Location - } - if plr.Tags != nil { - objectMap["tags"] = plr.Tags - } - if plr.Sku != nil { - objectMap["sku"] = plr.Sku - } - if plr.SystemData != nil { - objectMap["systemData"] = plr.SystemData - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. -func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkResourceProperties PrivateLinkResourceProperties - err = json.Unmarshal(*v, &privateLinkResourceProperties) - if err != nil { - return err - } - plr.PrivateLinkResourceProperties = &privateLinkResourceProperties - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - plr.Identity = &identity - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - plr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - plr.Tags = tags - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - plr.Sku = &sku - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - plr.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plr.Type = &typeVar - } - } - } - - return nil -} - -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - Array of private link resources - Value *[]PrivateLinkResource `json:"value,omitempty"` -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // RequiredZoneNames - The private link resource Private link DNS zone name. - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. -func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plrp.RequiredZoneNames != nil { - objectMap["requiredZoneNames"] = plrp.RequiredZoneNames - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionState a collection of information about the state of the connection between -// service consumer and provider. -type PrivateLinkServiceConnectionState struct { - // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected', 'PrivateEndpointServiceConnectionStatusDisconnected', 'PrivateEndpointServiceConnectionStatusTimeout' - Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` - // Description - The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not -// have tags and a location -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// QuotaBaseProperties the properties for Quota update or retrieval. -type QuotaBaseProperties struct { - // ID - Specifies the resource ID. - ID *string `json:"id,omitempty"` - // Type - Specifies the resource type. - Type *string `json:"type,omitempty"` - // Limit - The maximum permitted quota of the resource. - Limit *int64 `json:"limit,omitempty"` - // Unit - An enum describing the unit of quota measurement. Possible values include: 'QuotaUnitCount' - Unit QuotaUnit `json:"unit,omitempty"` -} - -// QuotaUpdateParameters quota update parameters. -type QuotaUpdateParameters struct { - // Value - The list for update quota. - Value *[]QuotaBaseProperties `json:"value,omitempty"` - // Location - Region of workspace quota to be updated. - Location *string `json:"location,omitempty"` -} - -// RegistryListCredentialsResult ... -type RegistryListCredentialsResult struct { - // Location - READ-ONLY - Location *string `json:"location,omitempty"` - // Username - READ-ONLY - Username *string `json:"username,omitempty"` - Passwords *[]Password `json:"passwords,omitempty"` -} - -// MarshalJSON is the custom marshaler for RegistryListCredentialsResult. -func (rlcr RegistryListCredentialsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rlcr.Passwords != nil { - objectMap["passwords"] = rlcr.Passwords - } - return json.Marshal(objectMap) -} - -// Resource common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceID represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. -type ResourceID struct { - // ID - The ID of the resource - ID *string `json:"id,omitempty"` -} - -// ResourceName the Resource Name. -type ResourceName struct { - // Value - READ-ONLY; The name of the resource. - Value *string `json:"value,omitempty"` - // LocalizedValue - READ-ONLY; The localized name of the resource. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceName. -func (rn ResourceName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceQuota the quota assigned to a resource. -type ResourceQuota struct { - // ID - READ-ONLY; Specifies the resource ID. - ID *string `json:"id,omitempty"` - // AmlWorkspaceLocation - READ-ONLY; Region of the AML workspace in the id. - AmlWorkspaceLocation *string `json:"amlWorkspaceLocation,omitempty"` - // Type - READ-ONLY; Specifies the resource type. - Type *string `json:"type,omitempty"` - // Name - READ-ONLY; Name of the resource. - Name *ResourceName `json:"name,omitempty"` - // Limit - READ-ONLY; The maximum permitted quota of the resource. - Limit *int64 `json:"limit,omitempty"` - // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'QuotaUnitCount' - Unit QuotaUnit `json:"unit,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceQuota. -func (rq ResourceQuota) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuLocationInfo ... -type ResourceSkuLocationInfo struct { - // Location - READ-ONLY; Location of the SKU - Location *string `json:"location,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is supported. - Zones *[]string `json:"zones,omitempty"` - // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. -func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. -type ResourceSkuZoneDetails struct { - // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name *[]string `json:"name,omitempty"` - // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities *[]SKUCapability `json:"capabilities,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. -func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Restriction the restriction because of which SKU cannot be used. -type Restriction struct { - // Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location. - Type *string `json:"type,omitempty"` - // 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. - Values *[]string `json:"values,omitempty"` - // ReasonCode - The reason for the restriction. Possible values include: 'ReasonCodeNotSpecified', 'ReasonCodeNotAvailableForRegion', 'ReasonCodeNotAvailableForSubscription' - ReasonCode ReasonCode `json:"reasonCode,omitempty"` -} - -// MarshalJSON is the custom marshaler for Restriction. -func (r Restriction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.ReasonCode != "" { - objectMap["reasonCode"] = r.ReasonCode - } - return json.Marshal(objectMap) -} - -// ScaleSettings scale settings for AML Compute -type ScaleSettings struct { - // MaxNodeCount - Max number of nodes to use - MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` - // MinNodeCount - Min number of nodes to use - MinNodeCount *int32 `json:"minNodeCount,omitempty"` - // NodeIdleTimeBeforeScaleDown - Node Idle Time before scaling down amlCompute. This string needs to be in the RFC Format. - NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` -} - -// ScaleSettingsInformation desired scale settings for the amlCompute. -type ScaleSettingsInformation struct { - ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` -} - -// ScriptReference script reference -type ScriptReference struct { - // ScriptSource - The storage source of the script: inline, workspace. - ScriptSource *string `json:"scriptSource,omitempty"` - // ScriptData - The location of scripts in the mounted volume. - ScriptData *string `json:"scriptData,omitempty"` - // ScriptArguments - Optional command line arguments passed to the script to run. - ScriptArguments *string `json:"scriptArguments,omitempty"` - // Timeout - Optional time period passed to timeout command. - Timeout *string `json:"timeout,omitempty"` -} - -// ScriptsToExecute customized setup scripts -type ScriptsToExecute struct { - // StartupScript - Script that's run every time the machine starts. - StartupScript *ScriptReference `json:"startupScript,omitempty"` - // CreationScript - Script that's run only once during provision of the compute. - CreationScript *ScriptReference `json:"creationScript,omitempty"` -} - -// ServiceManagedResourcesSettings ... -type ServiceManagedResourcesSettings struct { - // CosmosDb - The settings for the service managed cosmosdb account. - CosmosDb *CosmosDbSettings `json:"cosmosDb,omitempty"` -} - -// ServicePrincipalCredentials service principal credentials. -type ServicePrincipalCredentials struct { - // ClientID - Client Id - ClientID *string `json:"clientId,omitempty"` - // ClientSecret - Client secret - ClientSecret *string `json:"clientSecret,omitempty"` -} - -// SetupScripts details of customized scripts to execute for setting up the cluster. -type SetupScripts struct { - // Scripts - Customized setup scripts - Scripts *ScriptsToExecute `json:"scripts,omitempty"` -} - -// SharedPrivateLinkResource ... -type SharedPrivateLinkResource struct { - // Name - Unique name of the private link. - Name *string `json:"name,omitempty"` - // SharedPrivateLinkResourceProperty - Resource properties. - *SharedPrivateLinkResourceProperty `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedPrivateLinkResource. -func (splr SharedPrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if splr.Name != nil { - objectMap["name"] = splr.Name - } - if splr.SharedPrivateLinkResourceProperty != nil { - objectMap["properties"] = splr.SharedPrivateLinkResourceProperty - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SharedPrivateLinkResource struct. -func (splr *SharedPrivateLinkResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - splr.Name = &name - } - case "properties": - if v != nil { - var sharedPrivateLinkResourceProperty SharedPrivateLinkResourceProperty - err = json.Unmarshal(*v, &sharedPrivateLinkResourceProperty) - if err != nil { - return err - } - splr.SharedPrivateLinkResourceProperty = &sharedPrivateLinkResourceProperty - } - } - } - - return nil -} - -// SharedPrivateLinkResourceProperty properties of a shared private link resource. -type SharedPrivateLinkResourceProperty struct { - // PrivateLinkResourceID - The resource id that private link links to. - PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` - // GroupID - The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequestMessage - Request message. - RequestMessage *string `json:"requestMessage,omitempty"` - // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected', 'PrivateEndpointServiceConnectionStatusDisconnected', 'PrivateEndpointServiceConnectionStatusTimeout' - Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` -} - -// Sku sku of the resource -type Sku struct { - // Name - Name of the sku - Name *string `json:"name,omitempty"` - // Tier - Tier of the sku like Basic or Enterprise - Tier *string `json:"tier,omitempty"` -} - -// SKUCapability features/user capabilities associated with the sku -type SKUCapability struct { - // Name - Capability/Feature ID - Name *string `json:"name,omitempty"` - // Value - Details about the feature/capability - Value *string `json:"value,omitempty"` -} - -// SkuListResult list of skus with features -type SkuListResult struct { - autorest.Response `json:"-"` - Value *[]WorkspaceSku `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of Workspace Skus. Call ListNext() with this URI to fetch the next page of Workspace Skus - NextLink *string `json:"nextLink,omitempty"` -} - -// SkuListResultIterator provides access to a complete listing of WorkspaceSku values. -type SkuListResultIterator struct { - i int - page SkuListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SkuListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SkuListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SkuListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SkuListResultIterator) Response() SkuListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SkuListResultIterator) Value() WorkspaceSku { - if !iter.page.NotDone() { - return WorkspaceSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SkuListResultIterator type. -func NewSkuListResultIterator(page SkuListResultPage) SkuListResultIterator { - return SkuListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (slr SkuListResult) IsEmpty() bool { - return slr.Value == nil || len(*slr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (slr SkuListResult) hasNextLink() bool { - return slr.NextLink != nil && len(*slr.NextLink) != 0 -} - -// skuListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (slr SkuListResult) skuListResultPreparer(ctx context.Context) (*http.Request, error) { - if !slr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(slr.NextLink))) -} - -// SkuListResultPage contains a page of WorkspaceSku values. -type SkuListResultPage struct { - fn func(context.Context, SkuListResult) (SkuListResult, error) - slr SkuListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SkuListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.slr) - if err != nil { - return err - } - page.slr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SkuListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SkuListResultPage) NotDone() bool { - return !page.slr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SkuListResultPage) Response() SkuListResult { - return page.slr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SkuListResultPage) Values() []WorkspaceSku { - if page.slr.IsEmpty() { - return nil - } - return *page.slr.Value -} - -// Creates a new instance of the SkuListResultPage type. -func NewSkuListResultPage(cur SkuListResult, getNextPage func(context.Context, SkuListResult) (SkuListResult, error)) SkuListResultPage { - return SkuListResultPage{ - fn: getNextPage, - slr: cur, - } -} - -// SslConfiguration the ssl configuration for scoring -type SslConfiguration struct { - // Status - Enable or disable ssl for scoring. Possible values include: 'Status1Disabled', 'Status1Enabled', 'Status1Auto' - Status Status1 `json:"status,omitempty"` - // Cert - Cert data - Cert *string `json:"cert,omitempty"` - // Key - Key data - Key *string `json:"key,omitempty"` - // Cname - CNAME of the cert - Cname *string `json:"cname,omitempty"` - // LeafDomainLabel - Leaf domain label of public endpoint - LeafDomainLabel *string `json:"leafDomainLabel,omitempty"` - // OverwriteExistingDomain - Indicates whether to overwrite existing domain label. - OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"` -} - -// SynapseSpark a SynapseSpark compute. -type SynapseSpark struct { - Properties *SynapseSparkProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for SynapseSpark. -func (ss SynapseSpark) MarshalJSON() ([]byte, error) { - ss.ComputeType = ComputeTypeBasicComputeComputeTypeSynapseSpark - objectMap := make(map[string]interface{}) - if ss.Properties != nil { - objectMap["properties"] = ss.Properties - } - if ss.ComputeLocation != nil { - objectMap["computeLocation"] = ss.ComputeLocation - } - if ss.Description != nil { - objectMap["description"] = ss.Description - } - if ss.ResourceID != nil { - objectMap["resourceId"] = ss.ResourceID - } - if ss.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = ss.DisableLocalAuth - } - if ss.ComputeType != "" { - objectMap["computeType"] = ss.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsVirtualMachine() (*VirtualMachine, bool) { - return nil, false -} - -// AsHDInsight is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsSynapseSpark() (*SynapseSpark, bool) { - return &ss, true -} - -// AsCompute is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for SynapseSpark. -func (ss SynapseSpark) AsBasicCompute() (BasicCompute, bool) { - return &ss, true -} - -// SynapseSparkProperties ... -type SynapseSparkProperties struct { - // AutoScaleProperties - Auto scale properties. - AutoScaleProperties *AutoScaleProperties `json:"autoScaleProperties,omitempty"` - // AutoPauseProperties - Auto pause properties. - AutoPauseProperties *AutoPauseProperties `json:"autoPauseProperties,omitempty"` - // SparkVersion - Spark version. - SparkVersion *string `json:"sparkVersion,omitempty"` - // NodeCount - The number of compute nodes currently assigned to the compute. - NodeCount *int32 `json:"nodeCount,omitempty"` - // NodeSize - Node size. - NodeSize *string `json:"nodeSize,omitempty"` - // NodeSizeFamily - Node size family. - NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"` - // SubscriptionID - Azure subscription identifier. - SubscriptionID *string `json:"subscriptionId,omitempty"` - // ResourceGroup - Name of the resource group in which workspace is located. - ResourceGroup *string `json:"resourceGroup,omitempty"` - // WorkspaceName - Name of Azure Machine Learning workspace. - WorkspaceName *string `json:"workspaceName,omitempty"` - // PoolName - Pool name. - PoolName *string `json:"poolName,omitempty"` -} - -// SystemData metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // CreatedBy - The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' - CreatedByType CreatedByType `json:"createdByType,omitempty"` - // CreatedAt - The timestamp of resource creation (UTC). - CreatedAt *date.Time `json:"createdAt,omitempty"` - // LastModifiedBy - The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' - LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - The timestamp of resource last modification (UTC) - LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` -} - -// SystemService a system service running on a compute. -type SystemService struct { - // SystemServiceType - READ-ONLY; The type of this system service. - SystemServiceType *string `json:"systemServiceType,omitempty"` - // PublicIPAddress - READ-ONLY; Public IP address - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // Version - READ-ONLY; The version for this type. - Version *string `json:"version,omitempty"` -} - -// MarshalJSON is the custom marshaler for SystemService. -func (ss SystemService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource -// which has 'tags' and a 'location' -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} - -// UpdateWorkspaceQuotas the properties for update Quota response. -type UpdateWorkspaceQuotas struct { - // ID - READ-ONLY; Specifies the resource ID. - ID *string `json:"id,omitempty"` - // Type - READ-ONLY; Specifies the resource type. - Type *string `json:"type,omitempty"` - // Limit - The maximum permitted quota of the resource. - Limit *int64 `json:"limit,omitempty"` - // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'QuotaUnitCount' - Unit QuotaUnit `json:"unit,omitempty"` - // Status - Status of update workspace quota. Possible values include: 'StatusUndefined', 'StatusSuccess', 'StatusFailure', 'StatusInvalidQuotaBelowClusterMinimum', 'StatusInvalidQuotaExceedsSubscriptionLimit', 'StatusInvalidVMFamilyName', 'StatusOperationNotSupportedForSku', 'StatusOperationNotEnabledForRegion' - Status Status `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpdateWorkspaceQuotas. -func (uwq UpdateWorkspaceQuotas) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if uwq.Limit != nil { - objectMap["limit"] = uwq.Limit - } - if uwq.Status != "" { - objectMap["status"] = uwq.Status - } - return json.Marshal(objectMap) -} - -// UpdateWorkspaceQuotasResult the result of update workspace quota. -type UpdateWorkspaceQuotasResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of workspace quota update result. - Value *[]UpdateWorkspaceQuotas `json:"value,omitempty"` - // 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. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpdateWorkspaceQuotasResult. -func (uwqr UpdateWorkspaceQuotasResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Usage describes AML Resource Usage. -type Usage struct { - // ID - READ-ONLY; Specifies the resource ID. - ID *string `json:"id,omitempty"` - // AmlWorkspaceLocation - READ-ONLY; Region of the AML workspace in the id. - AmlWorkspaceLocation *string `json:"amlWorkspaceLocation,omitempty"` - // Type - READ-ONLY; Specifies the resource type. - Type *string `json:"type,omitempty"` - // Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'UsageUnitCount' - Unit UsageUnit `json:"unit,omitempty"` - // CurrentValue - READ-ONLY; The current usage of the resource. - CurrentValue *int64 `json:"currentValue,omitempty"` - // Limit - READ-ONLY; The maximum permitted usage of the resource. - Limit *int64 `json:"limit,omitempty"` - // Name - READ-ONLY; The name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for Usage. -func (u Usage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UsageName the Usage Names. -type UsageName struct { - // Value - READ-ONLY; The name of the resource. - Value *string `json:"value,omitempty"` - // LocalizedValue - READ-ONLY; The localized name of the resource. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// MarshalJSON is the custom marshaler for UsageName. -func (un UsageName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UserAccountCredentials settings for user account that gets created on each on the nodes of a compute. -type UserAccountCredentials struct { - // AdminUserName - Name of the administrator user account which can be used to SSH to nodes. - AdminUserName *string `json:"adminUserName,omitempty"` - // AdminUserSSHPublicKey - SSH public key of the administrator user account. - AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"` - // AdminUserPassword - Password of the administrator user account. - AdminUserPassword *string `json:"adminUserPassword,omitempty"` -} - -// UserAssignedIdentity user Assigned Identity -type UserAssignedIdentity struct { - // PrincipalID - READ-ONLY; The principal ID of the user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant ID of the user assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // ClientID - READ-ONLY; The clientId(aka appId) of the user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for UserAssignedIdentity. -func (uai UserAssignedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachine a Machine Learning compute based on Azure Virtual Machines. -type VirtualMachine struct { - Properties *VirtualMachineProperties `json:"properties,omitempty"` - // ComputeLocation - Location for the underlying compute - ComputeLocation *string `json:"computeLocation,omitempty"` - // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Description - The description of the Machine Learning compute. - Description *string `json:"description,omitempty"` - // CreatedOn - READ-ONLY; The time at which the compute was created. - CreatedOn *date.Time `json:"createdOn,omitempty"` - // ModifiedOn - READ-ONLY; The time at which the compute was last modified. - ModifiedOn *date.Time `json:"modifiedOn,omitempty"` - // ResourceID - ARM resource id of the underlying compute - ResourceID *string `json:"resourceId,omitempty"` - // ProvisioningErrors - READ-ONLY; Errors during provisioning - ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` - // 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. - IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` - // DisableLocalAuth - Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeComputeTypeCompute', 'ComputeTypeBasicComputeComputeTypeAKS', 'ComputeTypeBasicComputeComputeTypeAmlCompute', 'ComputeTypeBasicComputeComputeTypeComputeInstance', 'ComputeTypeBasicComputeComputeTypeVirtualMachine', 'ComputeTypeBasicComputeComputeTypeHDInsight', 'ComputeTypeBasicComputeComputeTypeDataFactory', 'ComputeTypeBasicComputeComputeTypeDatabricks', 'ComputeTypeBasicComputeComputeTypeDataLakeAnalytics', 'ComputeTypeBasicComputeComputeTypeSynapseSpark' - ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachine. -func (VM VirtualMachine) MarshalJSON() ([]byte, error) { - VM.ComputeType = ComputeTypeBasicComputeComputeTypeVirtualMachine - objectMap := make(map[string]interface{}) - if VM.Properties != nil { - objectMap["properties"] = VM.Properties - } - if VM.ComputeLocation != nil { - objectMap["computeLocation"] = VM.ComputeLocation - } - if VM.Description != nil { - objectMap["description"] = VM.Description - } - if VM.ResourceID != nil { - objectMap["resourceId"] = VM.ResourceID - } - if VM.DisableLocalAuth != nil { - objectMap["disableLocalAuth"] = VM.DisableLocalAuth - } - if VM.ComputeType != "" { - objectMap["computeType"] = VM.ComputeType - } - return json.Marshal(objectMap) -} - -// AsAKS is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsAKS() (*AKS, bool) { - return nil, false -} - -// AsAmlCompute is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsAmlCompute() (*AmlCompute, bool) { - return nil, false -} - -// AsComputeInstance is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsComputeInstance() (*ComputeInstance, bool) { - return nil, false -} - -// AsVirtualMachine is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsVirtualMachine() (*VirtualMachine, bool) { - return &VM, true -} - -// AsHDInsight is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsHDInsight() (*HDInsight, bool) { - return nil, false -} - -// AsDataFactory is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsDataFactory() (*DataFactory, bool) { - return nil, false -} - -// AsDatabricks is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsDatabricks() (*Databricks, bool) { - return nil, false -} - -// AsDataLakeAnalytics is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { - return nil, false -} - -// AsSynapseSpark is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsSynapseSpark() (*SynapseSpark, bool) { - return nil, false -} - -// AsCompute is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsCompute() (*Compute, bool) { - return nil, false -} - -// AsBasicCompute is the BasicCompute implementation for VirtualMachine. -func (VM VirtualMachine) AsBasicCompute() (BasicCompute, bool) { - return &VM, true -} - -// VirtualMachineImage virtual Machine image for Windows AML Compute -type VirtualMachineImage struct { - // ID - Virtual Machine image path - ID *string `json:"id,omitempty"` -} - -// VirtualMachineProperties ... -type VirtualMachineProperties struct { - // VirtualMachineSize - Virtual Machine size - VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` - // SSHPort - Port open for ssh connections. - SSHPort *int32 `json:"sshPort,omitempty"` - // Address - Public IP address of the virtual machine. - Address *string `json:"address,omitempty"` - // AdministratorAccount - Admin credentials for virtual machine - AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` - // IsNotebookInstanceCompute - Indicates whether this compute will be used for running notebooks. - IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"` -} - -// VirtualMachineSecrets secrets related to a Machine Learning compute based on AKS. -type VirtualMachineSecrets struct { - // AdministratorAccount - Admin credentials for virtual machine. - AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` - // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine' - ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineSecrets. -func (vms VirtualMachineSecrets) MarshalJSON() ([]byte, error) { - vms.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine - objectMap := make(map[string]interface{}) - if vms.AdministratorAccount != nil { - objectMap["administratorAccount"] = vms.AdministratorAccount - } - if vms.ComputeType != "" { - objectMap["computeType"] = vms.ComputeType - } - return json.Marshal(objectMap) -} - -// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. -func (vms VirtualMachineSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { - return &vms, true -} - -// AsComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. -func (vms VirtualMachineSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { - return nil, false -} - -// AsBasicComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. -func (vms VirtualMachineSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { - return &vms, true -} - -// VirtualMachineSize describes the properties of a VM size. -type VirtualMachineSize struct { - // Name - READ-ONLY; The name of the virtual machine size. - Name *string `json:"name,omitempty"` - // Family - READ-ONLY; The family name of the virtual machine size. - Family *string `json:"family,omitempty"` - // VCPUs - READ-ONLY; The number of vCPUs supported by the virtual machine size. - VCPUs *int32 `json:"vCPUs,omitempty"` - // Gpus - READ-ONLY; The number of gPUs supported by the virtual machine size. - Gpus *int32 `json:"gpus,omitempty"` - // OsVhdSizeMB - READ-ONLY; The OS VHD disk size, in MB, allowed by the virtual machine size. - OsVhdSizeMB *int32 `json:"osVhdSizeMB,omitempty"` - // MaxResourceVolumeMB - READ-ONLY; The resource volume size, in MB, allowed by the virtual machine size. - MaxResourceVolumeMB *int32 `json:"maxResourceVolumeMB,omitempty"` - // MemoryGB - READ-ONLY; The amount of memory, in GB, supported by the virtual machine size. - MemoryGB *float64 `json:"memoryGB,omitempty"` - // LowPriorityCapable - READ-ONLY; Specifies if the virtual machine size supports low priority VMs. - LowPriorityCapable *bool `json:"lowPriorityCapable,omitempty"` - // PremiumIO - READ-ONLY; Specifies if the virtual machine size supports premium IO. - PremiumIO *bool `json:"premiumIO,omitempty"` - // EstimatedVMPrices - The estimated price information for using a VM. - EstimatedVMPrices *EstimatedVMPrices `json:"estimatedVMPrices,omitempty"` - // SupportedComputeTypes - Specifies the compute types supported by the virtual machine size. - SupportedComputeTypes *[]string `json:"supportedComputeTypes,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineSize. -func (vms VirtualMachineSize) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vms.EstimatedVMPrices != nil { - objectMap["estimatedVMPrices"] = vms.EstimatedVMPrices - } - if vms.SupportedComputeTypes != nil { - objectMap["supportedComputeTypes"] = vms.SupportedComputeTypes - } - return json.Marshal(objectMap) -} - -// VirtualMachineSizeListResult the List Virtual Machine size operation response. -type VirtualMachineSizeListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine sizes supported by AmlCompute. - Value *[]VirtualMachineSize `json:"value,omitempty"` -} - -// VirtualMachineSSHCredentials admin credentials for virtual machine -type VirtualMachineSSHCredentials struct { - // Username - Username of admin account - Username *string `json:"username,omitempty"` - // Password - Password of admin account - Password *string `json:"password,omitempty"` - // PublicKeyData - Public key data - PublicKeyData *string `json:"publicKeyData,omitempty"` - // PrivateKeyData - Private key data - PrivateKeyData *string `json:"privateKeyData,omitempty"` -} - -// Workspace an object that represents a machine learning workspace. -type Workspace struct { - autorest.Response `json:"-"` - // WorkspaceProperties - The properties of the machine learning workspace. - *WorkspaceProperties `json:"properties,omitempty"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // Location - Specifies the location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Contains resource tags defined as key/value pairs. - Tags map[string]*string `json:"tags"` - // Sku - The sku of the workspace. - Sku *Sku `json:"sku,omitempty"` - // SystemData - System data - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Workspace. -func (w Workspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if w.WorkspaceProperties != nil { - objectMap["properties"] = w.WorkspaceProperties - } - if w.Identity != nil { - objectMap["identity"] = w.Identity - } - if w.Location != nil { - objectMap["location"] = w.Location - } - if w.Tags != nil { - objectMap["tags"] = w.Tags - } - if w.Sku != nil { - objectMap["sku"] = w.Sku - } - if w.SystemData != nil { - objectMap["systemData"] = w.SystemData - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Workspace struct. -func (w *Workspace) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var workspaceProperties WorkspaceProperties - err = json.Unmarshal(*v, &workspaceProperties) - if err != nil { - return err - } - w.WorkspaceProperties = &workspaceProperties - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - w.Identity = &identity - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - w.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - w.Tags = tags - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - w.Sku = &sku - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - w.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - w.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - w.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - w.Type = &typeVar - } - } - } - - return nil -} - -// WorkspaceConnection workspace connection. -type WorkspaceConnection struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; ResourceId of the workspace connection. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Friendly name of the workspace connection. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type of workspace connection. - Type *string `json:"type,omitempty"` - // WorkspaceConnectionProps - Properties of workspace connection. - *WorkspaceConnectionProps `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkspaceConnection. -func (wc WorkspaceConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wc.WorkspaceConnectionProps != nil { - objectMap["properties"] = wc.WorkspaceConnectionProps - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WorkspaceConnection struct. -func (wc *WorkspaceConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wc.Type = &typeVar - } - case "properties": - if v != nil { - var workspaceConnectionProps WorkspaceConnectionProps - err = json.Unmarshal(*v, &workspaceConnectionProps) - if err != nil { - return err - } - wc.WorkspaceConnectionProps = &workspaceConnectionProps - } - } - } - - return nil -} - -// WorkspaceConnectionProps workspace Connection specific properties. -type WorkspaceConnectionProps struct { - // Category - Category of the workspace connection. - Category *string `json:"category,omitempty"` - // Target - Target of the workspace connection. - Target *string `json:"target,omitempty"` - // AuthType - Authorization type of the workspace connection. - AuthType *string `json:"authType,omitempty"` - // Value - Value details of the workspace connection. - Value *string `json:"value,omitempty"` - // ValueFormat - format for the workspace connection value. Possible values include: 'ValueFormatJSON' - ValueFormat ValueFormat `json:"valueFormat,omitempty"` -} - -// WorkspaceListResult the result of a request to list machine learning workspaces. -type WorkspaceListResult struct { - autorest.Response `json:"-"` - // 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. - Value *[]Workspace `json:"value,omitempty"` - // NextLink - The URI that can be used to request the next list of machine learning workspaces. - NextLink *string `json:"nextLink,omitempty"` -} - -// WorkspaceListResultIterator provides access to a complete listing of Workspace values. -type WorkspaceListResultIterator struct { - i int - page WorkspaceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WorkspaceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WorkspaceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter WorkspaceListResultIterator) Response() WorkspaceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter WorkspaceListResultIterator) Value() Workspace { - if !iter.page.NotDone() { - return Workspace{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WorkspaceListResultIterator type. -func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { - return WorkspaceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wlr WorkspaceListResult) IsEmpty() bool { - return wlr.Value == nil || len(*wlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wlr WorkspaceListResult) hasNextLink() bool { - return wlr.NextLink != nil && len(*wlr.NextLink) != 0 -} - -// workspaceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !wlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wlr.NextLink))) -} - -// WorkspaceListResultPage contains a page of Workspace values. -type WorkspaceListResultPage struct { - fn func(context.Context, WorkspaceListResult) (WorkspaceListResult, error) - wlr WorkspaceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wlr) - if err != nil { - return err - } - page.wlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *WorkspaceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WorkspaceListResultPage) NotDone() bool { - return !page.wlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WorkspaceListResultPage) Response() WorkspaceListResult { - return page.wlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WorkspaceListResultPage) Values() []Workspace { - if page.wlr.IsEmpty() { - return nil - } - return *page.wlr.Value -} - -// Creates a new instance of the WorkspaceListResultPage type. -func NewWorkspaceListResultPage(cur WorkspaceListResult, getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage { - return WorkspaceListResultPage{ - fn: getNextPage, - wlr: cur, - } -} - -// WorkspaceProperties the properties of a machine learning workspace. -type WorkspaceProperties struct { - // WorkspaceID - READ-ONLY; The immutable id associated with this workspace. - WorkspaceID *string `json:"workspaceId,omitempty"` - // Description - The description of this workspace. - Description *string `json:"description,omitempty"` - // FriendlyName - The friendly name for this workspace. This name in mutable - FriendlyName *string `json:"friendlyName,omitempty"` - // KeyVault - ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created - KeyVault *string `json:"keyVault,omitempty"` - // ApplicationInsights - ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created - ApplicationInsights *string `json:"applicationInsights,omitempty"` - // ContainerRegistry - ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created - ContainerRegistry *string `json:"containerRegistry,omitempty"` - // StorageAccount - ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created - StorageAccount *string `json:"storageAccount,omitempty"` - // DiscoveryURL - Url for the discovery service to identify regional endpoints for machine learning experimentation services - DiscoveryURL *string `json:"discoveryUrl,omitempty"` - // ProvisioningState - READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Encryption - The encryption settings of Azure ML workspace. - Encryption *EncryptionProperty `json:"encryption,omitempty"` - // HbiWorkspace - The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service - HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` - // ServiceProvisionedResourceGroup - READ-ONLY; The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace - ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"` - // PrivateLinkCount - READ-ONLY; Count of private connections in the workspace - PrivateLinkCount *int32 `json:"privateLinkCount,omitempty"` - // ImageBuildCompute - The compute name for image build - ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` - // AllowPublicAccessWhenBehindVnet - The flag to indicate whether to allow public access when behind VNet. - AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` - // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections in the workspace. - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // SharedPrivateLinkResources - The list of shared private link resources in this workspace. - SharedPrivateLinkResources *[]SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty"` - // NotebookInfo - READ-ONLY; The notebook info of Azure ML workspace. - NotebookInfo *NotebookResourceInfo `json:"notebookInfo,omitempty"` - // ServiceManagedResourcesSettings - The service managed resource settings. - ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` - // PrimaryUserAssignedIdentity - The user assigned identity resource id that represents the workspace identity. - PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with this workspace. - TenantID *string `json:"tenantId,omitempty"` - // StorageHnsEnabled - READ-ONLY; If the storage associated with the workspace has hierarchical namespace(HNS) enabled. - StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty"` - // MlFlowTrackingURI - READ-ONLY; The URI associated with this workspace that machine learning flow must point at to set up tracking. - MlFlowTrackingURI *string `json:"mlFlowTrackingUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkspaceProperties. -func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wp.Description != nil { - objectMap["description"] = wp.Description - } - if wp.FriendlyName != nil { - objectMap["friendlyName"] = wp.FriendlyName - } - if wp.KeyVault != nil { - objectMap["keyVault"] = wp.KeyVault - } - if wp.ApplicationInsights != nil { - objectMap["applicationInsights"] = wp.ApplicationInsights - } - if wp.ContainerRegistry != nil { - objectMap["containerRegistry"] = wp.ContainerRegistry - } - if wp.StorageAccount != nil { - objectMap["storageAccount"] = wp.StorageAccount - } - if wp.DiscoveryURL != nil { - objectMap["discoveryUrl"] = wp.DiscoveryURL - } - if wp.Encryption != nil { - objectMap["encryption"] = wp.Encryption - } - if wp.HbiWorkspace != nil { - objectMap["hbiWorkspace"] = wp.HbiWorkspace - } - if wp.ImageBuildCompute != nil { - objectMap["imageBuildCompute"] = wp.ImageBuildCompute - } - if wp.AllowPublicAccessWhenBehindVnet != nil { - objectMap["allowPublicAccessWhenBehindVnet"] = wp.AllowPublicAccessWhenBehindVnet - } - if wp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = wp.PublicNetworkAccess - } - if wp.SharedPrivateLinkResources != nil { - objectMap["sharedPrivateLinkResources"] = wp.SharedPrivateLinkResources - } - if wp.ServiceManagedResourcesSettings != nil { - objectMap["serviceManagedResourcesSettings"] = wp.ServiceManagedResourcesSettings - } - if wp.PrimaryUserAssignedIdentity != nil { - objectMap["primaryUserAssignedIdentity"] = wp.PrimaryUserAssignedIdentity - } - return json.Marshal(objectMap) -} - -// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning -// workspace. -type WorkspacePropertiesUpdateParameters struct { - // Description - The description of this workspace. - Description *string `json:"description,omitempty"` - // FriendlyName - The friendly name for this workspace. - FriendlyName *string `json:"friendlyName,omitempty"` - // ImageBuildCompute - The compute name for image build - ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` - // ServiceManagedResourcesSettings - The service managed resource settings. - ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` - // PrimaryUserAssignedIdentity - The user assigned identity resource id that represents the workspace identity. - PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` - // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` -} - -// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WorkspacesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WorkspacesClient) (Workspace, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WorkspacesCreateOrUpdateFuture.Result. -func (future *WorkspacesCreateOrUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - w.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent { - w, err = client.CreateOrUpdateResponder(w.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request") - } - } - return -} - -// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WorkspacesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WorkspacesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WorkspacesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WorkspacesDeleteFuture.Result. -func (future *WorkspacesDeleteFuture) result(client WorkspacesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// WorkspacesDiagnoseFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WorkspacesDiagnoseFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WorkspacesClient) (DiagnoseResponseResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WorkspacesDiagnoseFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WorkspacesDiagnoseFuture.Result. -func (future *WorkspacesDiagnoseFuture) result(client WorkspacesClient) (drr DiagnoseResponseResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesDiagnoseFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - drr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesDiagnoseFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if drr.Response.Response, err = future.GetResult(sender); err == nil && drr.Response.Response.StatusCode != http.StatusNoContent { - drr, err = client.DiagnoseResponder(drr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesDiagnoseFuture", "Result", drr.Response.Response, "Failure responding to request") - } - } - return -} - -// WorkspaceSku describes Workspace Sku details and features -type WorkspaceSku struct { - // 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.). - Locations *[]string `json:"locations,omitempty"` - // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` - // Tier - READ-ONLY; Sku Tier like Basic or Enterprise - Tier *string `json:"tier,omitempty"` - // ResourceType - READ-ONLY - ResourceType *string `json:"resourceType,omitempty"` - // Name - READ-ONLY - Name *string `json:"name,omitempty"` - // Capabilities - READ-ONLY; List of features/user capabilities associated with the sku - Capabilities *[]SKUCapability `json:"capabilities,omitempty"` - // Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions *[]Restriction `json:"restrictions,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkspaceSku. -func (ws WorkspaceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ws.Restrictions != nil { - objectMap["restrictions"] = ws.Restrictions - } - return json.Marshal(objectMap) -} - -// WorkspacesPrepareNotebookFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WorkspacesPrepareNotebookFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WorkspacesClient) (NotebookResourceInfo, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WorkspacesPrepareNotebookFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WorkspacesPrepareNotebookFuture.Result. -func (future *WorkspacesPrepareNotebookFuture) result(client WorkspacesClient) (nri NotebookResourceInfo, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesPrepareNotebookFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - nri.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesPrepareNotebookFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if nri.Response.Response, err = future.GetResult(sender); err == nil && nri.Response.Response.StatusCode != http.StatusNoContent { - nri, err = client.PrepareNotebookResponder(nri.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesPrepareNotebookFuture", "Result", nri.Response.Response, "Failure responding to request") - } - } - return -} - -// WorkspacesResyncKeysFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WorkspacesResyncKeysFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WorkspacesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WorkspacesResyncKeysFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WorkspacesResyncKeysFuture.Result. -func (future *WorkspacesResyncKeysFuture) result(client WorkspacesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesResyncKeysFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesResyncKeysFuture") - return - } - ar.Response = future.Response() - return -} - -// WorkspaceUpdateParameters the parameters for updating a machine learning workspace. -type WorkspaceUpdateParameters struct { - // Tags - The resource tags for the machine learning workspace. - Tags map[string]*string `json:"tags"` - // Sku - The sku of the workspace. - Sku *Sku `json:"sku,omitempty"` - // Identity - The identity of the resource. - Identity *Identity `json:"identity,omitempty"` - // WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with. - *WorkspacePropertiesUpdateParameters `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters. -func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wup.Tags != nil { - objectMap["tags"] = wup.Tags - } - if wup.Sku != nil { - objectMap["sku"] = wup.Sku - } - if wup.Identity != nil { - objectMap["identity"] = wup.Identity - } - if wup.WorkspacePropertiesUpdateParameters != nil { - objectMap["properties"] = wup.WorkspacePropertiesUpdateParameters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WorkspaceUpdateParameters struct. -func (wup *WorkspaceUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - wup.Tags = tags - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - wup.Sku = &sku - } - case "identity": - if v != nil { - var identity Identity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - wup.Identity = &identity - } - case "properties": - if v != nil { - var workspacePropertiesUpdateParameters WorkspacePropertiesUpdateParameters - err = json.Unmarshal(*v, &workspacePropertiesUpdateParameters) - if err != nil { - return err - } - wup.WorkspacePropertiesUpdateParameters = &workspacePropertiesUpdateParameters - } - } - } - - return nil -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/operations.go deleted file mode 100644 index 455ef71df189..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/operations.go +++ /dev/null @@ -1,98 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available Azure Machine Learning Workspaces REST API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.MachineLearningServices/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/privateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/privateendpointconnections.go deleted file mode 100644 index 1f0f97767f16..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/privateendpointconnections.go +++ /dev/null @@ -1,385 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateEndpointConnectionsClient is the these APIs allow end users to operate on Azure Machine Learning Workspace -// resources. -type PrivateEndpointConnectionsClient struct { - BaseClient -} - -// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. -func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { - return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { - return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate update the state of specified private endpoint connection associated with the workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace -// properties - the private endpoint connection properties. -func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: properties, - Constraints: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("machinelearningservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithJSON(properties), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified private endpoint connection associated with the workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace -func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.PrivateEndpointConnectionsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified private endpoint connection associated with the workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace -func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.PrivateEndpointConnectionsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all the private endpoint connections associated with the workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateEndpointConnectionListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.PrivateEndpointConnectionsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/privatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/privatelinkresources.go deleted file mode 100644 index 4b0b38e566a7..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/privatelinkresources.go +++ /dev/null @@ -1,119 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateLinkResourcesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace -// resources. -type PrivateLinkResourcesClient struct { - BaseClient -} - -// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. -func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { - return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { - return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets the private link resources that need to be created for a workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateLinkResourceListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.PrivateLinkResourcesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkResourcesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateLinkResourcesClient) ListResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/quotas.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/quotas.go deleted file mode 100644 index 8684645d2662..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/quotas.go +++ /dev/null @@ -1,241 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// QuotasClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. -type QuotasClient struct { - BaseClient -} - -// NewQuotasClient creates an instance of the QuotasClient client. -func NewQuotasClient(subscriptionID string) QuotasClient { - return NewQuotasClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewQuotasClientWithBaseURI creates an instance of the QuotasClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { - return QuotasClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets the currently assigned Workspace Quotas based on VMFamily. -// Parameters: -// location - the location for which resource usage is queried. -func (client QuotasClient) List(ctx context.Context, location string) (result ListWorkspaceQuotasPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.List") - defer func() { - sc := -1 - if result.lwq.Response.Response != nil { - sc = result.lwq.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.QuotasClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lwq.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure sending request") - return - } - - result.lwq, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure responding to request") - return - } - if result.lwq.hasNextLink() && result.lwq.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client QuotasClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/quotas", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client QuotasClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client QuotasClient) ListResponder(resp *http.Response) (result ListWorkspaceQuotas, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client QuotasClient) listNextResults(ctx context.Context, lastResults ListWorkspaceQuotas) (result ListWorkspaceQuotas, err error) { - req, err := lastResults.listWorkspaceQuotasPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client QuotasClient) ListComplete(ctx context.Context, location string) (result ListWorkspaceQuotasIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} - -// Update update quota for each VM family in workspace. -// Parameters: -// location - the location for update quota is queried. -// parameters - quota update parameters. -func (client QuotasClient) Update(ctx context.Context, location string, parameters QuotaUpdateParameters) (result UpdateWorkspaceQuotasResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.QuotasClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, location, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client QuotasClient) UpdatePreparer(ctx context.Context, location string, parameters QuotaUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/updateQuotas", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client QuotasClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client QuotasClient) UpdateResponder(resp *http.Response) (result UpdateWorkspaceQuotasResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/usages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/usages.go deleted file mode 100644 index 103788cd7cd1..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/usages.go +++ /dev/null @@ -1,156 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsagesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. -type UsagesClient struct { - BaseClient -} - -// NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets the current usage information as well as limits for AML resources for given subscription and location. -// Parameters: -// location - the location for which resource usage is queried. -func (client UsagesClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") - defer func() { - sc := -1 - if result.lur.Response.Response != nil { - sc = result.lur.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.UsagesClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lur.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", resp, "Failure sending request") - return - } - - result.lur, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", resp, "Failure responding to request") - return - } - if result.lur.hasNextLink() && result.lur.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsagesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsagesClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client UsagesClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { - req, err := lastResults.listUsagesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsagesClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/version.go deleted file mode 100644 index 3467c9840afe..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package machinelearningservices - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " machinelearningservices/2021-07-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/virtualmachinesizes.go deleted file mode 100644 index 49f0432e5771..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/virtualmachinesizes.go +++ /dev/null @@ -1,116 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineSizesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace -// resources. -type VirtualMachineSizesClient struct { - BaseClient -} - -// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. -func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { - return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { - return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List returns supported VM Sizes in a location -// Parameters: -// location - the location upon which virtual-machine-sizes is queried. -func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.VirtualMachineSizesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaceconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaceconnections.go deleted file mode 100644 index 82638d766889..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaceconnections.go +++ /dev/null @@ -1,393 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WorkspaceConnectionsClient is the these APIs allow end users to operate on Azure Machine Learning Workspace -// resources. -type WorkspaceConnectionsClient struct { - BaseClient -} - -// NewWorkspaceConnectionsClient creates an instance of the WorkspaceConnectionsClient client. -func NewWorkspaceConnectionsClient(subscriptionID string) WorkspaceConnectionsClient { - return NewWorkspaceConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWorkspaceConnectionsClientWithBaseURI creates an instance of the WorkspaceConnectionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewWorkspaceConnectionsClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceConnectionsClient { - return WorkspaceConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create add a new workspace connection. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// connectionName - friendly name of the workspace connection -// parameters - the object for creating or updating a new workspace connection -func (client WorkspaceConnectionsClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, parameters WorkspaceConnection) (result WorkspaceConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceConnectionsClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspaceConnectionsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, workspaceName, connectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client WorkspaceConnectionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string, parameters WorkspaceConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspaceConnectionsClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client WorkspaceConnectionsClient) CreateResponder(resp *http.Response) (result WorkspaceConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a workspace connection. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// connectionName - friendly name of the workspace connection -func (client WorkspaceConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceConnectionsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspaceConnectionsClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WorkspaceConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspaceConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WorkspaceConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the detail of a workspace connection. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// connectionName - friendly name of the workspace connection -func (client WorkspaceConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string) (result WorkspaceConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspaceConnectionsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WorkspaceConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspaceConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WorkspaceConnectionsClient) GetResponder(resp *http.Response) (result WorkspaceConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all connections under a AML workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// target - target of the workspace connection. -// category - category of the workspace connection. -func (client WorkspaceConnectionsClient) List(ctx context.Context, resourceGroupName string, workspaceName string, target string, category string) (result PaginatedWorkspaceConnectionsList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceConnectionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspaceConnectionsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName, target, category) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceConnectionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WorkspaceConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, target string, category string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(target) > 0 { - queryParameters["target"] = autorest.Encode("query", target) - } - if len(category) > 0 { - queryParameters["category"] = autorest.Encode("query", category) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspaceConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WorkspaceConnectionsClient) ListResponder(resp *http.Response) (result PaginatedWorkspaceConnectionsList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspacefeatures.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspacefeatures.go deleted file mode 100644 index ff33f6cbe561..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspacefeatures.go +++ /dev/null @@ -1,160 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WorkspaceFeaturesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. -type WorkspaceFeaturesClient struct { - BaseClient -} - -// NewWorkspaceFeaturesClient creates an instance of the WorkspaceFeaturesClient client. -func NewWorkspaceFeaturesClient(subscriptionID string) WorkspaceFeaturesClient { - return NewWorkspaceFeaturesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWorkspaceFeaturesClientWithBaseURI creates an instance of the WorkspaceFeaturesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewWorkspaceFeaturesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceFeaturesClient { - return WorkspaceFeaturesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all enabled features for a workspace -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspaceFeaturesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result ListAmlUserFeatureResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceFeaturesClient.List") - defer func() { - sc := -1 - if result.laufr.Response.Response != nil { - sc = result.laufr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspaceFeaturesClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.laufr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", resp, "Failure sending request") - return - } - - result.laufr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", resp, "Failure responding to request") - return - } - if result.laufr.hasNextLink() && result.laufr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WorkspaceFeaturesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspaceFeaturesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WorkspaceFeaturesClient) ListResponder(resp *http.Response) (result ListAmlUserFeatureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client WorkspaceFeaturesClient) listNextResults(ctx context.Context, lastResults ListAmlUserFeatureResult) (result ListAmlUserFeatureResult, err error) { - req, err := lastResults.listAmlUserFeatureResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client WorkspaceFeaturesClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ListAmlUserFeatureResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceFeaturesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, workspaceName) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaces.go deleted file mode 100644 index c8ceaf3962bd..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaces.go +++ /dev/null @@ -1,1341 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WorkspacesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. -type WorkspacesClient struct { - BaseClient -} - -// NewWorkspacesClient creates an instance of the WorkspacesClient client. -func NewWorkspacesClient(subscriptionID string) WorkspacesClient { - return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { - return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a workspace with the specified parameters. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// parameters - the parameters for creating or updating a machine learning workspace. -func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (result WorkspacesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.WorkspaceProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Encryption", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Encryption.KeyVaultProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Encryption.KeyVaultProperties.KeyVaultArmID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.WorkspaceProperties.Encryption.KeyVaultProperties.KeyIdentifier", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) CreateOrUpdateSender(req *http.Request) (future WorkspacesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a machine learning workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspacesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) DeleteSender(req *http.Request) (future WorkspacesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Diagnose sends the diagnose request. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// parameters - the parameter of diagnosing workspace health -func (client WorkspacesClient) Diagnose(ctx context.Context, resourceGroupName string, workspaceName string, parameters *DiagnoseWorkspaceParameters) (result WorkspacesDiagnoseFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Diagnose") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "Diagnose", err.Error()) - } - - req, err := client.DiagnosePreparer(ctx, resourceGroupName, workspaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Diagnose", nil, "Failure preparing request") - return - } - - result, err = client.DiagnoseSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Diagnose", result.Response(), "Failure sending request") - return - } - - return -} - -// DiagnosePreparer prepares the Diagnose request. -func (client WorkspacesClient) DiagnosePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters *DiagnoseWorkspaceParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DiagnoseSender sends the Diagnose request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) DiagnoseSender(req *http.Request) (future WorkspacesDiagnoseFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DiagnoseResponder handles the response to the Diagnose request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) DiagnoseResponder(resp *http.Response) (result DiagnoseResponseResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets the properties of the specified machine learning workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all the available machine learning workspaces under the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// skip - continuation token for pagination. -func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skip string) (result WorkspaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.wlr.Response.Response != nil { - sc = result.wlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ListByResourceGroup", err.Error()) - } - - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.wlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.wlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.wlr.hasNextLink() && result.wlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client WorkspacesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, skip string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(skip) > 0 { - queryParameters["$skip"] = autorest.Encode("query", skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client WorkspacesClient) listByResourceGroupNextResults(ctx context.Context, lastResults WorkspaceListResult) (result WorkspaceListResult, err error) { - req, err := lastResults.workspaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skip string) (result WorkspaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, skip) - return -} - -// ListBySubscription lists all the available machine learning workspaces under the specified subscription. -// Parameters: -// skip - continuation token for pagination. -func (client WorkspacesClient) ListBySubscription(ctx context.Context, skip string) (result WorkspaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") - defer func() { - sc := -1 - if result.wlr.Response.Response != nil { - sc = result.wlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ListBySubscription", err.Error()) - } - - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.wlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.wlr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.wlr.hasNextLink() && result.wlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client WorkspacesClient) ListBySubscriptionPreparer(ctx context.Context, skip string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(skip) > 0 { - queryParameters["$skip"] = autorest.Encode("query", skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client WorkspacesClient) listBySubscriptionNextResults(ctx context.Context, lastResults WorkspaceListResult) (result WorkspaceListResult, err error) { - req, err := lastResults.workspaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client WorkspacesClient) ListBySubscriptionComplete(ctx context.Context, skip string) (result WorkspaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, skip) - return -} - -// ListKeys lists all the keys associated with this workspace. This includes keys for the storage account, app insights -// and password for container registry -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result ListWorkspaceKeysResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ListKeys", err.Error()) - } - - req, err := client.ListKeysPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", nil, "Failure preparing request") - return - } - - resp, err := client.ListKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", resp, "Failure sending request") - return - } - - result, err = client.ListKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", resp, "Failure responding to request") - return - } - - return -} - -// ListKeysPreparer prepares the ListKeys request. -func (client WorkspacesClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListKeysSender sends the ListKeys request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListKeysResponder handles the response to the ListKeys request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListKeysResponder(resp *http.Response) (result ListWorkspaceKeysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListNotebookAccessToken return notebook access token and refresh token -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) ListNotebookAccessToken(ctx context.Context, resourceGroupName string, workspaceName string) (result NotebookAccessTokenResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListNotebookAccessToken") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ListNotebookAccessToken", err.Error()) - } - - req, err := client.ListNotebookAccessTokenPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListNotebookAccessToken", nil, "Failure preparing request") - return - } - - resp, err := client.ListNotebookAccessTokenSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListNotebookAccessToken", resp, "Failure sending request") - return - } - - result, err = client.ListNotebookAccessTokenResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListNotebookAccessToken", resp, "Failure responding to request") - return - } - - return -} - -// ListNotebookAccessTokenPreparer prepares the ListNotebookAccessToken request. -func (client WorkspacesClient) ListNotebookAccessTokenPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNotebookAccessTokenSender sends the ListNotebookAccessToken request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListNotebookAccessTokenSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListNotebookAccessTokenResponder handles the response to the ListNotebookAccessToken request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListNotebookAccessTokenResponder(resp *http.Response) (result NotebookAccessTokenResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListNotebookKeys list keys of a notebook. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) ListNotebookKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result ListNotebookKeysResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListNotebookKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ListNotebookKeys", err.Error()) - } - - req, err := client.ListNotebookKeysPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListNotebookKeys", nil, "Failure preparing request") - return - } - - resp, err := client.ListNotebookKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListNotebookKeys", resp, "Failure sending request") - return - } - - result, err = client.ListNotebookKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListNotebookKeys", resp, "Failure responding to request") - return - } - - return -} - -// ListNotebookKeysPreparer prepares the ListNotebookKeys request. -func (client WorkspacesClient) ListNotebookKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNotebookKeysSender sends the ListNotebookKeys request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListNotebookKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListNotebookKeysResponder handles the response to the ListNotebookKeys request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListNotebookKeysResponder(resp *http.Response) (result ListNotebookKeysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOutboundNetworkDependenciesEndpoints sends the list outbound network dependencies endpoints request. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) ListOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, workspaceName string) (result ExternalFQDNResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListOutboundNetworkDependenciesEndpoints") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ListOutboundNetworkDependenciesEndpoints", err.Error()) - } - - req, err := client.ListOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") - return - } - - resp, err := client.ListOutboundNetworkDependenciesEndpointsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") - return - } - - result, err = client.ListOutboundNetworkDependenciesEndpointsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") - return - } - - return -} - -// ListOutboundNetworkDependenciesEndpointsPreparer prepares the ListOutboundNetworkDependenciesEndpoints request. -func (client WorkspacesClient) ListOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOutboundNetworkDependenciesEndpointsSender sends the ListOutboundNetworkDependenciesEndpoints request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOutboundNetworkDependenciesEndpointsResponder handles the response to the ListOutboundNetworkDependenciesEndpoints request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ExternalFQDNResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListStorageAccountKeys list storage account keys of a workspace. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) ListStorageAccountKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result ListStorageAccountKeysResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListStorageAccountKeys") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ListStorageAccountKeys", err.Error()) - } - - req, err := client.ListStorageAccountKeysPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListStorageAccountKeys", nil, "Failure preparing request") - return - } - - resp, err := client.ListStorageAccountKeysSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListStorageAccountKeys", resp, "Failure sending request") - return - } - - result, err = client.ListStorageAccountKeysResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListStorageAccountKeys", resp, "Failure responding to request") - return - } - - return -} - -// ListStorageAccountKeysPreparer prepares the ListStorageAccountKeys request. -func (client WorkspacesClient) ListStorageAccountKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListStorageAccountKeysSender sends the ListStorageAccountKeys request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ListStorageAccountKeysSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListStorageAccountKeysResponder handles the response to the ListStorageAccountKeys request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ListStorageAccountKeysResponder(resp *http.Response) (result ListStorageAccountKeysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// PrepareNotebook prepare a notebook. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) PrepareNotebook(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspacesPrepareNotebookFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.PrepareNotebook") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "PrepareNotebook", err.Error()) - } - - req, err := client.PrepareNotebookPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "PrepareNotebook", nil, "Failure preparing request") - return - } - - result, err = client.PrepareNotebookSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "PrepareNotebook", result.Response(), "Failure sending request") - return - } - - return -} - -// PrepareNotebookPreparer prepares the PrepareNotebook request. -func (client WorkspacesClient) PrepareNotebookPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PrepareNotebookSender sends the PrepareNotebook request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) PrepareNotebookSender(req *http.Request) (future WorkspacesPrepareNotebookFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PrepareNotebookResponder handles the response to the PrepareNotebook request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) PrepareNotebookResponder(resp *http.Response) (result NotebookResourceInfo, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ResyncKeys resync all the keys associated with this workspace. This includes keys for the storage account, app -// insights and password for container registry -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -func (client WorkspacesClient) ResyncKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspacesResyncKeysFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ResyncKeys") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "ResyncKeys", err.Error()) - } - - req, err := client.ResyncKeysPreparer(ctx, resourceGroupName, workspaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", nil, "Failure preparing request") - return - } - - result, err = client.ResyncKeysSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", result.Response(), "Failure sending request") - return - } - - return -} - -// ResyncKeysPreparer prepares the ResyncKeys request. -func (client WorkspacesClient) ResyncKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/resyncKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResyncKeysSender sends the ResyncKeys request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) ResyncKeysSender(req *http.Request) (future WorkspacesResyncKeysFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResyncKeysResponder handles the response to the ResyncKeys request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) ResyncKeysResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates a machine learning workspace with the specified parameters. -// Parameters: -// resourceGroupName - the name of the resource group. The name is case insensitive. -// workspaceName - name of Azure Machine Learning workspace. -// parameters - the parameters for updating a machine learning workspace. -func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (result Workspace, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspacesClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "workspaceName": autorest.Encode("path", workspaceName), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspacesClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaceskus.go deleted file mode 100644 index b7e6febf047b..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices/workspaceskus.go +++ /dev/null @@ -1,151 +0,0 @@ -package machinelearningservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WorkspaceSkusClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. -type WorkspaceSkusClient struct { - BaseClient -} - -// NewWorkspaceSkusClient creates an instance of the WorkspaceSkusClient client. -func NewWorkspaceSkusClient(subscriptionID string) WorkspaceSkusClient { - return NewWorkspaceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWorkspaceSkusClientWithBaseURI creates an instance of the WorkspaceSkusClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWorkspaceSkusClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceSkusClient { - return WorkspaceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all skus with associated features -func (client WorkspaceSkusClient) List(ctx context.Context) (result SkuListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceSkusClient.List") - defer func() { - sc := -1 - if result.slr.Response.Response != nil { - sc = result.slr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("machinelearningservices.WorkspaceSkusClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceSkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.slr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceSkusClient", "List", resp, "Failure sending request") - return - } - - result.slr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceSkusClient", "List", resp, "Failure responding to request") - return - } - if result.slr.hasNextLink() && result.slr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WorkspaceSkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client WorkspaceSkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WorkspaceSkusClient) ListResponder(resp *http.Response) (result SkuListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client WorkspaceSkusClient) listNextResults(ctx context.Context, lastResults SkuListResult) (result SkuListResult, err error) { - req, err := lastResults.skuListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceSkusClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceSkusClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceSkusClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client WorkspaceSkusClient) ListComplete(ctx context.Context) (result SkuListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceSkusClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/README.md new file mode 100644 index 000000000000..f491c0476ee4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/README.md @@ -0,0 +1,168 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes` Documentation + +The `machinelearningcomputes` SDK allows for interaction with the Azure Resource Manager Service `machinelearningservices` (API Version `2022-05-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes" +``` + + +### Client Initialization + +```go +client := machinelearningcomputes.NewMachineLearningComputesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeCreateOrUpdate` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +payload := machinelearningcomputes.ComputeResource{ + // ... +} + + +if err := client.ComputeCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeDelete` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +if err := client.ComputeDeleteThenPoll(ctx, id, machinelearningcomputes.DefaultComputeDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeGet` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +read, err := client.ComputeGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeList` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +// alternatively `client.ComputeList(ctx, id, machinelearningcomputes.DefaultComputeListOperationOptions())` can be used to do batched pagination +items, err := client.ComputeListComplete(ctx, id, machinelearningcomputes.DefaultComputeListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeListKeys` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +read, err := client.ComputeListKeys(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeListNodes` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +// alternatively `client.ComputeListNodes(ctx, id)` can be used to do batched pagination +items, err := client.ComputeListNodesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeRestart` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +if err := client.ComputeRestartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeStart` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +if err := client.ComputeStartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeStop` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +if err := client.ComputeStopThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `MachineLearningComputesClient.ComputeUpdate` + +```go +ctx := context.TODO() +id := machinelearningcomputes.NewComputeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "computeValue") + +payload := machinelearningcomputes.ClusterUpdateParameters{ + // ... +} + + +if err := client.ComputeUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/client.go new file mode 100644 index 000000000000..2a90758d680d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/client.go @@ -0,0 +1,18 @@ +package machinelearningcomputes + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MachineLearningComputesClient struct { + Client autorest.Client + baseUri string +} + +func NewMachineLearningComputesClientWithBaseURI(endpoint string) MachineLearningComputesClient { + return MachineLearningComputesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/constants.go new file mode 100644 index 000000000000..86734912afdd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/constants.go @@ -0,0 +1,1008 @@ +package machinelearningcomputes + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AllocationState string + +const ( + AllocationStateResizing AllocationState = "Resizing" + AllocationStateSteady AllocationState = "Steady" +) + +func PossibleValuesForAllocationState() []string { + return []string{ + string(AllocationStateResizing), + string(AllocationStateSteady), + } +} + +func parseAllocationState(input string) (*AllocationState, error) { + vals := map[string]AllocationState{ + "resizing": AllocationStateResizing, + "steady": AllocationStateSteady, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AllocationState(input) + return &out, nil +} + +type ApplicationSharingPolicy string + +const ( + ApplicationSharingPolicyPersonal ApplicationSharingPolicy = "Personal" + ApplicationSharingPolicyShared ApplicationSharingPolicy = "Shared" +) + +func PossibleValuesForApplicationSharingPolicy() []string { + return []string{ + string(ApplicationSharingPolicyPersonal), + string(ApplicationSharingPolicyShared), + } +} + +func parseApplicationSharingPolicy(input string) (*ApplicationSharingPolicy, error) { + vals := map[string]ApplicationSharingPolicy{ + "personal": ApplicationSharingPolicyPersonal, + "shared": ApplicationSharingPolicyShared, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationSharingPolicy(input) + return &out, nil +} + +type Autosave string + +const ( + AutosaveLocal Autosave = "Local" + AutosaveNone Autosave = "None" + AutosaveRemote Autosave = "Remote" +) + +func PossibleValuesForAutosave() []string { + return []string{ + string(AutosaveLocal), + string(AutosaveNone), + string(AutosaveRemote), + } +} + +func parseAutosave(input string) (*Autosave, error) { + vals := map[string]Autosave{ + "local": AutosaveLocal, + "none": AutosaveNone, + "remote": AutosaveRemote, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Autosave(input) + return &out, nil +} + +type Caching string + +const ( + CachingNone Caching = "None" + CachingReadOnly Caching = "ReadOnly" + CachingReadWrite Caching = "ReadWrite" +) + +func PossibleValuesForCaching() []string { + return []string{ + string(CachingNone), + string(CachingReadOnly), + string(CachingReadWrite), + } +} + +func parseCaching(input string) (*Caching, error) { + vals := map[string]Caching{ + "none": CachingNone, + "readonly": CachingReadOnly, + "readwrite": CachingReadWrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Caching(input) + return &out, nil +} + +type ClusterPurpose string + +const ( + ClusterPurposeDenseProd ClusterPurpose = "DenseProd" + ClusterPurposeDevTest ClusterPurpose = "DevTest" + ClusterPurposeFastProd ClusterPurpose = "FastProd" +) + +func PossibleValuesForClusterPurpose() []string { + return []string{ + string(ClusterPurposeDenseProd), + string(ClusterPurposeDevTest), + string(ClusterPurposeFastProd), + } +} + +func parseClusterPurpose(input string) (*ClusterPurpose, error) { + vals := map[string]ClusterPurpose{ + "denseprod": ClusterPurposeDenseProd, + "devtest": ClusterPurposeDevTest, + "fastprod": ClusterPurposeFastProd, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterPurpose(input) + return &out, nil +} + +type ComputeInstanceAuthorizationType string + +const ( + ComputeInstanceAuthorizationTypePersonal ComputeInstanceAuthorizationType = "personal" +) + +func PossibleValuesForComputeInstanceAuthorizationType() []string { + return []string{ + string(ComputeInstanceAuthorizationTypePersonal), + } +} + +func parseComputeInstanceAuthorizationType(input string) (*ComputeInstanceAuthorizationType, error) { + vals := map[string]ComputeInstanceAuthorizationType{ + "personal": ComputeInstanceAuthorizationTypePersonal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComputeInstanceAuthorizationType(input) + return &out, nil +} + +type ComputeInstanceState string + +const ( + ComputeInstanceStateCreateFailed ComputeInstanceState = "CreateFailed" + ComputeInstanceStateCreating ComputeInstanceState = "Creating" + ComputeInstanceStateDeleting ComputeInstanceState = "Deleting" + ComputeInstanceStateJobRunning ComputeInstanceState = "JobRunning" + ComputeInstanceStateRestarting ComputeInstanceState = "Restarting" + ComputeInstanceStateRunning ComputeInstanceState = "Running" + ComputeInstanceStateSettingUp ComputeInstanceState = "SettingUp" + ComputeInstanceStateSetupFailed ComputeInstanceState = "SetupFailed" + ComputeInstanceStateStarting ComputeInstanceState = "Starting" + ComputeInstanceStateStopped ComputeInstanceState = "Stopped" + ComputeInstanceStateStopping ComputeInstanceState = "Stopping" + ComputeInstanceStateUnknown ComputeInstanceState = "Unknown" + ComputeInstanceStateUnusable ComputeInstanceState = "Unusable" + ComputeInstanceStateUserSettingUp ComputeInstanceState = "UserSettingUp" + ComputeInstanceStateUserSetupFailed ComputeInstanceState = "UserSetupFailed" +) + +func PossibleValuesForComputeInstanceState() []string { + return []string{ + string(ComputeInstanceStateCreateFailed), + string(ComputeInstanceStateCreating), + string(ComputeInstanceStateDeleting), + string(ComputeInstanceStateJobRunning), + string(ComputeInstanceStateRestarting), + string(ComputeInstanceStateRunning), + string(ComputeInstanceStateSettingUp), + string(ComputeInstanceStateSetupFailed), + string(ComputeInstanceStateStarting), + string(ComputeInstanceStateStopped), + string(ComputeInstanceStateStopping), + string(ComputeInstanceStateUnknown), + string(ComputeInstanceStateUnusable), + string(ComputeInstanceStateUserSettingUp), + string(ComputeInstanceStateUserSetupFailed), + } +} + +func parseComputeInstanceState(input string) (*ComputeInstanceState, error) { + vals := map[string]ComputeInstanceState{ + "createfailed": ComputeInstanceStateCreateFailed, + "creating": ComputeInstanceStateCreating, + "deleting": ComputeInstanceStateDeleting, + "jobrunning": ComputeInstanceStateJobRunning, + "restarting": ComputeInstanceStateRestarting, + "running": ComputeInstanceStateRunning, + "settingup": ComputeInstanceStateSettingUp, + "setupfailed": ComputeInstanceStateSetupFailed, + "starting": ComputeInstanceStateStarting, + "stopped": ComputeInstanceStateStopped, + "stopping": ComputeInstanceStateStopping, + "unknown": ComputeInstanceStateUnknown, + "unusable": ComputeInstanceStateUnusable, + "usersettingup": ComputeInstanceStateUserSettingUp, + "usersetupfailed": ComputeInstanceStateUserSetupFailed, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComputeInstanceState(input) + return &out, nil +} + +type ComputePowerAction string + +const ( + ComputePowerActionStart ComputePowerAction = "Start" + ComputePowerActionStop ComputePowerAction = "Stop" +) + +func PossibleValuesForComputePowerAction() []string { + return []string{ + string(ComputePowerActionStart), + string(ComputePowerActionStop), + } +} + +func parseComputePowerAction(input string) (*ComputePowerAction, error) { + vals := map[string]ComputePowerAction{ + "start": ComputePowerActionStart, + "stop": ComputePowerActionStop, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComputePowerAction(input) + return &out, nil +} + +type ComputeType string + +const ( + ComputeTypeAKS ComputeType = "AKS" + ComputeTypeAmlCompute ComputeType = "AmlCompute" + ComputeTypeComputeInstance ComputeType = "ComputeInstance" + ComputeTypeDataFactory ComputeType = "DataFactory" + ComputeTypeDataLakeAnalytics ComputeType = "DataLakeAnalytics" + ComputeTypeDatabricks ComputeType = "Databricks" + ComputeTypeHDInsight ComputeType = "HDInsight" + ComputeTypeKubernetes ComputeType = "Kubernetes" + ComputeTypeSynapseSpark ComputeType = "SynapseSpark" + ComputeTypeVirtualMachine ComputeType = "VirtualMachine" +) + +func PossibleValuesForComputeType() []string { + return []string{ + string(ComputeTypeAKS), + string(ComputeTypeAmlCompute), + string(ComputeTypeComputeInstance), + string(ComputeTypeDataFactory), + string(ComputeTypeDataLakeAnalytics), + string(ComputeTypeDatabricks), + string(ComputeTypeHDInsight), + string(ComputeTypeKubernetes), + string(ComputeTypeSynapseSpark), + string(ComputeTypeVirtualMachine), + } +} + +func parseComputeType(input string) (*ComputeType, error) { + vals := map[string]ComputeType{ + "aks": ComputeTypeAKS, + "amlcompute": ComputeTypeAmlCompute, + "computeinstance": ComputeTypeComputeInstance, + "datafactory": ComputeTypeDataFactory, + "datalakeanalytics": ComputeTypeDataLakeAnalytics, + "databricks": ComputeTypeDatabricks, + "hdinsight": ComputeTypeHDInsight, + "kubernetes": ComputeTypeKubernetes, + "synapsespark": ComputeTypeSynapseSpark, + "virtualmachine": ComputeTypeVirtualMachine, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComputeType(input) + return &out, nil +} + +type LoadBalancerType string + +const ( + LoadBalancerTypeInternalLoadBalancer LoadBalancerType = "InternalLoadBalancer" + LoadBalancerTypePublicIP LoadBalancerType = "PublicIp" +) + +func PossibleValuesForLoadBalancerType() []string { + return []string{ + string(LoadBalancerTypeInternalLoadBalancer), + string(LoadBalancerTypePublicIP), + } +} + +func parseLoadBalancerType(input string) (*LoadBalancerType, error) { + vals := map[string]LoadBalancerType{ + "internalloadbalancer": LoadBalancerTypeInternalLoadBalancer, + "publicip": LoadBalancerTypePublicIP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerType(input) + return &out, nil +} + +type MountAction string + +const ( + MountActionMount MountAction = "Mount" + MountActionUnmount MountAction = "Unmount" +) + +func PossibleValuesForMountAction() []string { + return []string{ + string(MountActionMount), + string(MountActionUnmount), + } +} + +func parseMountAction(input string) (*MountAction, error) { + vals := map[string]MountAction{ + "mount": MountActionMount, + "unmount": MountActionUnmount, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MountAction(input) + return &out, nil +} + +type MountState string + +const ( + MountStateMountFailed MountState = "MountFailed" + MountStateMountRequested MountState = "MountRequested" + MountStateMounted MountState = "Mounted" + MountStateUnmountFailed MountState = "UnmountFailed" + MountStateUnmountRequested MountState = "UnmountRequested" + MountStateUnmounted MountState = "Unmounted" +) + +func PossibleValuesForMountState() []string { + return []string{ + string(MountStateMountFailed), + string(MountStateMountRequested), + string(MountStateMounted), + string(MountStateUnmountFailed), + string(MountStateUnmountRequested), + string(MountStateUnmounted), + } +} + +func parseMountState(input string) (*MountState, error) { + vals := map[string]MountState{ + "mountfailed": MountStateMountFailed, + "mountrequested": MountStateMountRequested, + "mounted": MountStateMounted, + "unmountfailed": MountStateUnmountFailed, + "unmountrequested": MountStateUnmountRequested, + "unmounted": MountStateUnmounted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MountState(input) + return &out, nil +} + +type Network string + +const ( + NetworkBridge Network = "Bridge" + NetworkHost Network = "Host" +) + +func PossibleValuesForNetwork() []string { + return []string{ + string(NetworkBridge), + string(NetworkHost), + } +} + +func parseNetwork(input string) (*Network, error) { + vals := map[string]Network{ + "bridge": NetworkBridge, + "host": NetworkHost, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Network(input) + return &out, nil +} + +type NodeState string + +const ( + NodeStateIdle NodeState = "idle" + NodeStateLeaving NodeState = "leaving" + NodeStatePreempted NodeState = "preempted" + NodeStatePreparing NodeState = "preparing" + NodeStateRunning NodeState = "running" + NodeStateUnusable NodeState = "unusable" +) + +func PossibleValuesForNodeState() []string { + return []string{ + string(NodeStateIdle), + string(NodeStateLeaving), + string(NodeStatePreempted), + string(NodeStatePreparing), + string(NodeStateRunning), + string(NodeStateUnusable), + } +} + +func parseNodeState(input string) (*NodeState, error) { + vals := map[string]NodeState{ + "idle": NodeStateIdle, + "leaving": NodeStateLeaving, + "preempted": NodeStatePreempted, + "preparing": NodeStatePreparing, + "running": NodeStateRunning, + "unusable": NodeStateUnusable, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NodeState(input) + return &out, nil +} + +type OperationName string + +const ( + OperationNameCreate OperationName = "Create" + OperationNameDelete OperationName = "Delete" + OperationNameReimage OperationName = "Reimage" + OperationNameRestart OperationName = "Restart" + OperationNameStart OperationName = "Start" + OperationNameStop OperationName = "Stop" +) + +func PossibleValuesForOperationName() []string { + return []string{ + string(OperationNameCreate), + string(OperationNameDelete), + string(OperationNameReimage), + string(OperationNameRestart), + string(OperationNameStart), + string(OperationNameStop), + } +} + +func parseOperationName(input string) (*OperationName, error) { + vals := map[string]OperationName{ + "create": OperationNameCreate, + "delete": OperationNameDelete, + "reimage": OperationNameReimage, + "restart": OperationNameRestart, + "start": OperationNameStart, + "stop": OperationNameStop, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperationName(input) + return &out, nil +} + +type OperationStatus string + +const ( + OperationStatusCreateFailed OperationStatus = "CreateFailed" + OperationStatusDeleteFailed OperationStatus = "DeleteFailed" + OperationStatusInProgress OperationStatus = "InProgress" + OperationStatusReimageFailed OperationStatus = "ReimageFailed" + OperationStatusRestartFailed OperationStatus = "RestartFailed" + OperationStatusStartFailed OperationStatus = "StartFailed" + OperationStatusStopFailed OperationStatus = "StopFailed" + OperationStatusSucceeded OperationStatus = "Succeeded" +) + +func PossibleValuesForOperationStatus() []string { + return []string{ + string(OperationStatusCreateFailed), + string(OperationStatusDeleteFailed), + string(OperationStatusInProgress), + string(OperationStatusReimageFailed), + string(OperationStatusRestartFailed), + string(OperationStatusStartFailed), + string(OperationStatusStopFailed), + string(OperationStatusSucceeded), + } +} + +func parseOperationStatus(input string) (*OperationStatus, error) { + vals := map[string]OperationStatus{ + "createfailed": OperationStatusCreateFailed, + "deletefailed": OperationStatusDeleteFailed, + "inprogress": OperationStatusInProgress, + "reimagefailed": OperationStatusReimageFailed, + "restartfailed": OperationStatusRestartFailed, + "startfailed": OperationStatusStartFailed, + "stopfailed": OperationStatusStopFailed, + "succeeded": OperationStatusSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperationStatus(input) + return &out, nil +} + +type OperationTrigger string + +const ( + OperationTriggerIdleShutdown OperationTrigger = "IdleShutdown" + OperationTriggerSchedule OperationTrigger = "Schedule" + OperationTriggerUser OperationTrigger = "User" +) + +func PossibleValuesForOperationTrigger() []string { + return []string{ + string(OperationTriggerIdleShutdown), + string(OperationTriggerSchedule), + string(OperationTriggerUser), + } +} + +func parseOperationTrigger(input string) (*OperationTrigger, error) { + vals := map[string]OperationTrigger{ + "idleshutdown": OperationTriggerIdleShutdown, + "schedule": OperationTriggerSchedule, + "user": OperationTriggerUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperationTrigger(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeWindows), + } +} + +func parseOsType(input string) (*OsType, error) { + vals := map[string]OsType{ + "linux": OsTypeLinux, + "windows": OsTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OsType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUnknown ProvisioningState = "Unknown" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUnknown), + string(ProvisioningStateUpdating), + } +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "unknown": ProvisioningStateUnknown, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type ProvisioningStatus string + +const ( + ProvisioningStatusCompleted ProvisioningStatus = "Completed" + ProvisioningStatusFailed ProvisioningStatus = "Failed" + ProvisioningStatusProvisioning ProvisioningStatus = "Provisioning" +) + +func PossibleValuesForProvisioningStatus() []string { + return []string{ + string(ProvisioningStatusCompleted), + string(ProvisioningStatusFailed), + string(ProvisioningStatusProvisioning), + } +} + +func parseProvisioningStatus(input string) (*ProvisioningStatus, error) { + vals := map[string]ProvisioningStatus{ + "completed": ProvisioningStatusCompleted, + "failed": ProvisioningStatusFailed, + "provisioning": ProvisioningStatusProvisioning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningStatus(input) + return &out, nil +} + +type RemoteLoginPortPublicAccess string + +const ( + RemoteLoginPortPublicAccessDisabled RemoteLoginPortPublicAccess = "Disabled" + RemoteLoginPortPublicAccessEnabled RemoteLoginPortPublicAccess = "Enabled" + RemoteLoginPortPublicAccessNotSpecified RemoteLoginPortPublicAccess = "NotSpecified" +) + +func PossibleValuesForRemoteLoginPortPublicAccess() []string { + return []string{ + string(RemoteLoginPortPublicAccessDisabled), + string(RemoteLoginPortPublicAccessEnabled), + string(RemoteLoginPortPublicAccessNotSpecified), + } +} + +func parseRemoteLoginPortPublicAccess(input string) (*RemoteLoginPortPublicAccess, error) { + vals := map[string]RemoteLoginPortPublicAccess{ + "disabled": RemoteLoginPortPublicAccessDisabled, + "enabled": RemoteLoginPortPublicAccessEnabled, + "notspecified": RemoteLoginPortPublicAccessNotSpecified, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RemoteLoginPortPublicAccess(input) + return &out, nil +} + +type ScheduleProvisioningState string + +const ( + ScheduleProvisioningStateCompleted ScheduleProvisioningState = "Completed" + ScheduleProvisioningStateFailed ScheduleProvisioningState = "Failed" + ScheduleProvisioningStateProvisioning ScheduleProvisioningState = "Provisioning" +) + +func PossibleValuesForScheduleProvisioningState() []string { + return []string{ + string(ScheduleProvisioningStateCompleted), + string(ScheduleProvisioningStateFailed), + string(ScheduleProvisioningStateProvisioning), + } +} + +func parseScheduleProvisioningState(input string) (*ScheduleProvisioningState, error) { + vals := map[string]ScheduleProvisioningState{ + "completed": ScheduleProvisioningStateCompleted, + "failed": ScheduleProvisioningStateFailed, + "provisioning": ScheduleProvisioningStateProvisioning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScheduleProvisioningState(input) + return &out, nil +} + +type ScheduleStatus string + +const ( + ScheduleStatusDisabled ScheduleStatus = "Disabled" + ScheduleStatusEnabled ScheduleStatus = "Enabled" +) + +func PossibleValuesForScheduleStatus() []string { + return []string{ + string(ScheduleStatusDisabled), + string(ScheduleStatusEnabled), + } +} + +func parseScheduleStatus(input string) (*ScheduleStatus, error) { + vals := map[string]ScheduleStatus{ + "disabled": ScheduleStatusDisabled, + "enabled": ScheduleStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScheduleStatus(input) + return &out, nil +} + +type SkuTier string + +const ( + SkuTierBasic SkuTier = "Basic" + SkuTierFree SkuTier = "Free" + SkuTierPremium SkuTier = "Premium" + SkuTierStandard SkuTier = "Standard" +) + +func PossibleValuesForSkuTier() []string { + return []string{ + string(SkuTierBasic), + string(SkuTierFree), + string(SkuTierPremium), + string(SkuTierStandard), + } +} + +func parseSkuTier(input string) (*SkuTier, error) { + vals := map[string]SkuTier{ + "basic": SkuTierBasic, + "free": SkuTierFree, + "premium": SkuTierPremium, + "standard": SkuTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkuTier(input) + return &out, nil +} + +type SourceType string + +const ( + SourceTypeDataset SourceType = "Dataset" + SourceTypeDatastore SourceType = "Datastore" + SourceTypeURI SourceType = "URI" +) + +func PossibleValuesForSourceType() []string { + return []string{ + string(SourceTypeDataset), + string(SourceTypeDatastore), + string(SourceTypeURI), + } +} + +func parseSourceType(input string) (*SourceType, error) { + vals := map[string]SourceType{ + "dataset": SourceTypeDataset, + "datastore": SourceTypeDatastore, + "uri": SourceTypeURI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SourceType(input) + return &out, nil +} + +type SshPublicAccess string + +const ( + SshPublicAccessDisabled SshPublicAccess = "Disabled" + SshPublicAccessEnabled SshPublicAccess = "Enabled" +) + +func PossibleValuesForSshPublicAccess() []string { + return []string{ + string(SshPublicAccessDisabled), + string(SshPublicAccessEnabled), + } +} + +func parseSshPublicAccess(input string) (*SshPublicAccess, error) { + vals := map[string]SshPublicAccess{ + "disabled": SshPublicAccessDisabled, + "enabled": SshPublicAccessEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SshPublicAccess(input) + return &out, nil +} + +type SslConfigStatus string + +const ( + SslConfigStatusAuto SslConfigStatus = "Auto" + SslConfigStatusDisabled SslConfigStatus = "Disabled" + SslConfigStatusEnabled SslConfigStatus = "Enabled" +) + +func PossibleValuesForSslConfigStatus() []string { + return []string{ + string(SslConfigStatusAuto), + string(SslConfigStatusDisabled), + string(SslConfigStatusEnabled), + } +} + +func parseSslConfigStatus(input string) (*SslConfigStatus, error) { + vals := map[string]SslConfigStatus{ + "auto": SslConfigStatusAuto, + "disabled": SslConfigStatusDisabled, + "enabled": SslConfigStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SslConfigStatus(input) + return &out, nil +} + +type StorageAccountType string + +const ( + StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" + StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" +) + +func PossibleValuesForStorageAccountType() []string { + return []string{ + string(StorageAccountTypePremiumLRS), + string(StorageAccountTypeStandardLRS), + } +} + +func parseStorageAccountType(input string) (*StorageAccountType, error) { + vals := map[string]StorageAccountType{ + "premium_lrs": StorageAccountTypePremiumLRS, + "standard_lrs": StorageAccountTypeStandardLRS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StorageAccountType(input) + return &out, nil +} + +type UnderlyingResourceAction string + +const ( + UnderlyingResourceActionDelete UnderlyingResourceAction = "Delete" + UnderlyingResourceActionDetach UnderlyingResourceAction = "Detach" +) + +func PossibleValuesForUnderlyingResourceAction() []string { + return []string{ + string(UnderlyingResourceActionDelete), + string(UnderlyingResourceActionDetach), + } +} + +func parseUnderlyingResourceAction(input string) (*UnderlyingResourceAction, error) { + vals := map[string]UnderlyingResourceAction{ + "delete": UnderlyingResourceActionDelete, + "detach": UnderlyingResourceActionDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UnderlyingResourceAction(input) + return &out, nil +} + +type VmPriority string + +const ( + VmPriorityDedicated VmPriority = "Dedicated" + VmPriorityLowPriority VmPriority = "LowPriority" +) + +func PossibleValuesForVmPriority() []string { + return []string{ + string(VmPriorityDedicated), + string(VmPriorityLowPriority), + } +} + +func parseVmPriority(input string) (*VmPriority, error) { + vals := map[string]VmPriority{ + "dedicated": VmPriorityDedicated, + "lowpriority": VmPriorityLowPriority, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VmPriority(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/id_compute.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/id_compute.go new file mode 100644 index 000000000000..79e6415c8e7c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/id_compute.go @@ -0,0 +1,137 @@ +package machinelearningcomputes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = ComputeId{} + +// ComputeId is a struct representing the Resource ID for a Compute +type ComputeId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string + ComputeName string +} + +// NewComputeID returns a new ComputeId struct +func NewComputeID(subscriptionId string, resourceGroupName string, workspaceName string, computeName string) ComputeId { + return ComputeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + ComputeName: computeName, + } +} + +// ParseComputeID parses 'input' into a ComputeId +func ParseComputeID(input string) (*ComputeId, error) { + parser := resourceids.NewParserFromResourceIdType(ComputeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ComputeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'workspaceName' was not found in the resource id %q", input) + } + + if id.ComputeName, ok = parsed.Parsed["computeName"]; !ok { + return nil, fmt.Errorf("the segment 'computeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseComputeIDInsensitively parses 'input' case-insensitively into a ComputeId +// note: this method should only be used for API response data and not user input +func ParseComputeIDInsensitively(input string) (*ComputeId, error) { + parser := resourceids.NewParserFromResourceIdType(ComputeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ComputeId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'workspaceName' was not found in the resource id %q", input) + } + + if id.ComputeName, ok = parsed.Parsed["computeName"]; !ok { + return nil, fmt.Errorf("the segment 'computeName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateComputeID checks that 'input' can be parsed as a Compute ID +func ValidateComputeID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseComputeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Compute ID +func (id ComputeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MachineLearningServices/workspaces/%s/computes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.ComputeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Compute ID +func (id ComputeId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftMachineLearningServices", "Microsoft.MachineLearningServices", "Microsoft.MachineLearningServices"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + resourceids.StaticSegment("staticComputes", "computes", "computes"), + resourceids.UserSpecifiedSegment("computeName", "computeValue"), + } +} + +// String returns a human-readable description of this Compute ID +func (id ComputeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + fmt.Sprintf("Compute Name: %q", id.ComputeName), + } + return fmt.Sprintf("Compute (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/id_workspace.go new file mode 100644 index 000000000000..f328772fcdbe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/id_workspace.go @@ -0,0 +1,124 @@ +package machinelearningcomputes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = WorkspaceId{} + +// WorkspaceId is a struct representing the Resource ID for a Workspace +type WorkspaceId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string +} + +// NewWorkspaceID returns a new WorkspaceId struct +func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + } +} + +// ParseWorkspaceID parses 'input' into a WorkspaceId +func ParseWorkspaceID(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'workspaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId +// note: this method should only be used for API response data and not user input +func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'workspaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID +func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Workspace ID +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MachineLearningServices/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Workspace ID +func (id WorkspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftMachineLearningServices", "Microsoft.MachineLearningServices", "Microsoft.MachineLearningServices"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + } +} + +// String returns a human-readable description of this Workspace ID +func (id WorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computecreateorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computecreateorupdate_autorest.go new file mode 100644 index 000000000000..1443eec30b84 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computecreateorupdate_autorest.go @@ -0,0 +1,79 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeCreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ComputeCreateOrUpdate ... +func (c MachineLearningComputesClient) ComputeCreateOrUpdate(ctx context.Context, id ComputeId, input ComputeResource) (result ComputeCreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForComputeCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeCreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForComputeCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeCreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ComputeCreateOrUpdateThenPoll performs ComputeCreateOrUpdate then polls until it's completed +func (c MachineLearningComputesClient) ComputeCreateOrUpdateThenPoll(ctx context.Context, id ComputeId, input ComputeResource) error { + result, err := c.ComputeCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ComputeCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ComputeCreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForComputeCreateOrUpdate prepares the ComputeCreateOrUpdate request. +func (c MachineLearningComputesClient) preparerForComputeCreateOrUpdate(ctx context.Context, id ComputeId, input ComputeResource) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForComputeCreateOrUpdate sends the ComputeCreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c MachineLearningComputesClient) senderForComputeCreateOrUpdate(ctx context.Context, req *http.Request) (future ComputeCreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computedelete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computedelete_autorest.go new file mode 100644 index 000000000000..46874ff670cb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computedelete_autorest.go @@ -0,0 +1,107 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeDeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +type ComputeDeleteOperationOptions struct { + UnderlyingResourceAction *UnderlyingResourceAction +} + +func DefaultComputeDeleteOperationOptions() ComputeDeleteOperationOptions { + return ComputeDeleteOperationOptions{} +} + +func (o ComputeDeleteOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ComputeDeleteOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.UnderlyingResourceAction != nil { + out["underlyingResourceAction"] = *o.UnderlyingResourceAction + } + + return out +} + +// ComputeDelete ... +func (c MachineLearningComputesClient) ComputeDelete(ctx context.Context, id ComputeId, options ComputeDeleteOperationOptions) (result ComputeDeleteOperationResponse, err error) { + req, err := c.preparerForComputeDelete(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeDelete", nil, "Failure preparing request") + return + } + + result, err = c.senderForComputeDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeDelete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ComputeDeleteThenPoll performs ComputeDelete then polls until it's completed +func (c MachineLearningComputesClient) ComputeDeleteThenPoll(ctx context.Context, id ComputeId, options ComputeDeleteOperationOptions) error { + result, err := c.ComputeDelete(ctx, id, options) + if err != nil { + return fmt.Errorf("performing ComputeDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ComputeDelete: %+v", err) + } + + return nil +} + +// preparerForComputeDelete prepares the ComputeDelete request. +func (c MachineLearningComputesClient) preparerForComputeDelete(ctx context.Context, id ComputeId, options ComputeDeleteOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForComputeDelete sends the ComputeDelete request. The method will close the +// http.Response Body if it receives an error. +func (c MachineLearningComputesClient) senderForComputeDelete(ctx context.Context, req *http.Request) (future ComputeDeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computeget_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computeget_autorest.go new file mode 100644 index 000000000000..7fa6b0848b83 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computeget_autorest.go @@ -0,0 +1,68 @@ +package machinelearningcomputes + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeGetOperationResponse struct { + HttpResponse *http.Response + Model *ComputeResource +} + +// ComputeGet ... +func (c MachineLearningComputesClient) ComputeGet(ctx context.Context, id ComputeId) (result ComputeGetOperationResponse, err error) { + req, err := c.preparerForComputeGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeGet", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeGet", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForComputeGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeGet", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForComputeGet prepares the ComputeGet request. +func (c MachineLearningComputesClient) preparerForComputeGet(ctx context.Context, id ComputeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForComputeGet handles the response to the ComputeGet request. The method always +// closes the http.Response Body. +func (c MachineLearningComputesClient) responderForComputeGet(resp *http.Response) (result ComputeGetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelist_autorest.go new file mode 100644 index 000000000000..bc9336d63f42 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelist_autorest.go @@ -0,0 +1,215 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeListOperationResponse struct { + HttpResponse *http.Response + Model *[]ComputeResource + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ComputeListOperationResponse, error) +} + +type ComputeListCompleteResult struct { + Items []ComputeResource +} + +func (r ComputeListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ComputeListOperationResponse) LoadMore(ctx context.Context) (resp ComputeListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ComputeListOperationOptions struct { + Skip *string +} + +func DefaultComputeListOperationOptions() ComputeListOperationOptions { + return ComputeListOperationOptions{} +} + +func (o ComputeListOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ComputeListOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Skip != nil { + out["$skip"] = *o.Skip + } + + return out +} + +// ComputeList ... +func (c MachineLearningComputesClient) ComputeList(ctx context.Context, id WorkspaceId, options ComputeListOperationOptions) (resp ComputeListOperationResponse, err error) { + req, err := c.preparerForComputeList(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForComputeList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForComputeList prepares the ComputeList request. +func (c MachineLearningComputesClient) preparerForComputeList(ctx context.Context, id WorkspaceId, options ComputeListOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/computes", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForComputeListWithNextLink prepares the ComputeList request with the given nextLink token. +func (c MachineLearningComputesClient) preparerForComputeListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForComputeList handles the response to the ComputeList request. The method always +// closes the http.Response Body. +func (c MachineLearningComputesClient) responderForComputeList(resp *http.Response) (result ComputeListOperationResponse, err error) { + type page struct { + Values []ComputeResource `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ComputeListOperationResponse, err error) { + req, err := c.preparerForComputeListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForComputeList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ComputeListComplete retrieves all of the results into a single object +func (c MachineLearningComputesClient) ComputeListComplete(ctx context.Context, id WorkspaceId, options ComputeListOperationOptions) (ComputeListCompleteResult, error) { + return c.ComputeListCompleteMatchingPredicate(ctx, id, options, ComputeResourceOperationPredicate{}) +} + +// ComputeListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c MachineLearningComputesClient) ComputeListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ComputeListOperationOptions, predicate ComputeResourceOperationPredicate) (resp ComputeListCompleteResult, err error) { + items := make([]ComputeResource, 0) + + page, err := c.ComputeList(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ComputeListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelistkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelistkeys_autorest.go new file mode 100644 index 000000000000..44452c47ef7e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelistkeys_autorest.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "io/ioutil" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeListKeysOperationResponse struct { + HttpResponse *http.Response + Model *ComputeSecrets +} + +// ComputeListKeys ... +func (c MachineLearningComputesClient) ComputeListKeys(ctx context.Context, id ComputeId) (result ComputeListKeysOperationResponse, err error) { + req, err := c.preparerForComputeListKeys(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListKeys", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListKeys", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForComputeListKeys(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListKeys", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForComputeListKeys prepares the ComputeListKeys request. +func (c MachineLearningComputesClient) preparerForComputeListKeys(ctx context.Context, id ComputeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/listKeys", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForComputeListKeys handles the response to the ComputeListKeys request. The method always +// closes the http.Response Body. +func (c MachineLearningComputesClient) responderForComputeListKeys(resp *http.Response) (result ComputeListKeysOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.HttpResponse = resp + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return result, fmt.Errorf("reading response body for ComputeSecrets: %+v", err) + } + model, err := unmarshalComputeSecretsImplementation(b) + if err != nil { + return + } + result.Model = &model + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelistnodes_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelistnodes_autorest.go new file mode 100644 index 000000000000..f199717e58a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computelistnodes_autorest.go @@ -0,0 +1,186 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeListNodesOperationResponse struct { + HttpResponse *http.Response + Model *[]AmlComputeNodesInformation + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ComputeListNodesOperationResponse, error) +} + +type ComputeListNodesCompleteResult struct { + Items []AmlComputeNodesInformation +} + +func (r ComputeListNodesOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ComputeListNodesOperationResponse) LoadMore(ctx context.Context) (resp ComputeListNodesOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// ComputeListNodes ... +func (c MachineLearningComputesClient) ComputeListNodes(ctx context.Context, id ComputeId) (resp ComputeListNodesOperationResponse, err error) { + req, err := c.preparerForComputeListNodes(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListNodes", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListNodes", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForComputeListNodes(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListNodes", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForComputeListNodes prepares the ComputeListNodes request. +func (c MachineLearningComputesClient) preparerForComputeListNodes(ctx context.Context, id ComputeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/listNodes", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForComputeListNodesWithNextLink prepares the ComputeListNodes request with the given nextLink token. +func (c MachineLearningComputesClient) preparerForComputeListNodesWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForComputeListNodes handles the response to the ComputeListNodes request. The method always +// closes the http.Response Body. +func (c MachineLearningComputesClient) responderForComputeListNodes(resp *http.Response) (result ComputeListNodesOperationResponse, err error) { + type page struct { + Values []AmlComputeNodesInformation `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ComputeListNodesOperationResponse, err error) { + req, err := c.preparerForComputeListNodesWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListNodes", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListNodes", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForComputeListNodes(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeListNodes", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ComputeListNodesComplete retrieves all of the results into a single object +func (c MachineLearningComputesClient) ComputeListNodesComplete(ctx context.Context, id ComputeId) (ComputeListNodesCompleteResult, error) { + return c.ComputeListNodesCompleteMatchingPredicate(ctx, id, AmlComputeNodesInformationOperationPredicate{}) +} + +// ComputeListNodesCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c MachineLearningComputesClient) ComputeListNodesCompleteMatchingPredicate(ctx context.Context, id ComputeId, predicate AmlComputeNodesInformationOperationPredicate) (resp ComputeListNodesCompleteResult, err error) { + items := make([]AmlComputeNodesInformation, 0) + + page, err := c.ComputeListNodes(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ComputeListNodesCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computerestart_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computerestart_autorest.go new file mode 100644 index 000000000000..c38f9be15ae7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computerestart_autorest.go @@ -0,0 +1,78 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeRestartOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ComputeRestart ... +func (c MachineLearningComputesClient) ComputeRestart(ctx context.Context, id ComputeId) (result ComputeRestartOperationResponse, err error) { + req, err := c.preparerForComputeRestart(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeRestart", nil, "Failure preparing request") + return + } + + result, err = c.senderForComputeRestart(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeRestart", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ComputeRestartThenPoll performs ComputeRestart then polls until it's completed +func (c MachineLearningComputesClient) ComputeRestartThenPoll(ctx context.Context, id ComputeId) error { + result, err := c.ComputeRestart(ctx, id) + if err != nil { + return fmt.Errorf("performing ComputeRestart: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ComputeRestart: %+v", err) + } + + return nil +} + +// preparerForComputeRestart prepares the ComputeRestart request. +func (c MachineLearningComputesClient) preparerForComputeRestart(ctx context.Context, id ComputeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/restart", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForComputeRestart sends the ComputeRestart request. The method will close the +// http.Response Body if it receives an error. +func (c MachineLearningComputesClient) senderForComputeRestart(ctx context.Context, req *http.Request) (future ComputeRestartOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computestart_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computestart_autorest.go new file mode 100644 index 000000000000..72e1246e90e2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computestart_autorest.go @@ -0,0 +1,78 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeStartOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ComputeStart ... +func (c MachineLearningComputesClient) ComputeStart(ctx context.Context, id ComputeId) (result ComputeStartOperationResponse, err error) { + req, err := c.preparerForComputeStart(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeStart", nil, "Failure preparing request") + return + } + + result, err = c.senderForComputeStart(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeStart", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ComputeStartThenPoll performs ComputeStart then polls until it's completed +func (c MachineLearningComputesClient) ComputeStartThenPoll(ctx context.Context, id ComputeId) error { + result, err := c.ComputeStart(ctx, id) + if err != nil { + return fmt.Errorf("performing ComputeStart: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ComputeStart: %+v", err) + } + + return nil +} + +// preparerForComputeStart prepares the ComputeStart request. +func (c MachineLearningComputesClient) preparerForComputeStart(ctx context.Context, id ComputeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/start", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForComputeStart sends the ComputeStart request. The method will close the +// http.Response Body if it receives an error. +func (c MachineLearningComputesClient) senderForComputeStart(ctx context.Context, req *http.Request) (future ComputeStartOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computestop_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computestop_autorest.go new file mode 100644 index 000000000000..1076dcfa0909 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computestop_autorest.go @@ -0,0 +1,78 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeStopOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ComputeStop ... +func (c MachineLearningComputesClient) ComputeStop(ctx context.Context, id ComputeId) (result ComputeStopOperationResponse, err error) { + req, err := c.preparerForComputeStop(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeStop", nil, "Failure preparing request") + return + } + + result, err = c.senderForComputeStop(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeStop", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ComputeStopThenPoll performs ComputeStop then polls until it's completed +func (c MachineLearningComputesClient) ComputeStopThenPoll(ctx context.Context, id ComputeId) error { + result, err := c.ComputeStop(ctx, id) + if err != nil { + return fmt.Errorf("performing ComputeStop: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ComputeStop: %+v", err) + } + + return nil +} + +// preparerForComputeStop prepares the ComputeStop request. +func (c MachineLearningComputesClient) preparerForComputeStop(ctx context.Context, id ComputeId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/stop", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForComputeStop sends the ComputeStop request. The method will close the +// http.Response Body if it receives an error. +func (c MachineLearningComputesClient) senderForComputeStop(ctx context.Context, req *http.Request) (future ComputeStopOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computeupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computeupdate_autorest.go new file mode 100644 index 000000000000..43534c9a0ed6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/method_computeupdate_autorest.go @@ -0,0 +1,79 @@ +package machinelearningcomputes + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ComputeUpdate ... +func (c MachineLearningComputesClient) ComputeUpdate(ctx context.Context, id ComputeId, input ClusterUpdateParameters) (result ComputeUpdateOperationResponse, err error) { + req, err := c.preparerForComputeUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForComputeUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningcomputes.MachineLearningComputesClient", "ComputeUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ComputeUpdateThenPoll performs ComputeUpdate then polls until it's completed +func (c MachineLearningComputesClient) ComputeUpdateThenPoll(ctx context.Context, id ComputeId, input ClusterUpdateParameters) error { + result, err := c.ComputeUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ComputeUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ComputeUpdate: %+v", err) + } + + return nil +} + +// preparerForComputeUpdate prepares the ComputeUpdate request. +func (c MachineLearningComputesClient) preparerForComputeUpdate(ctx context.Context, id ComputeId, input ClusterUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForComputeUpdate sends the ComputeUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c MachineLearningComputesClient) senderForComputeUpdate(ctx context.Context, req *http.Request) (future ComputeUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aks.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aks.go new file mode 100644 index 000000000000..c1e56af49cac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aks.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = AKS{} + +type AKS struct { + Properties *AKSSchemaProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *AKS) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *AKS) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *AKS) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *AKS) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = AKS{} + +func (s AKS) MarshalJSON() ([]byte, error) { + type wrapper AKS + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AKS: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AKS: %+v", err) + } + decoded["computeType"] = "AKS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AKS: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_akscomputesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_akscomputesecrets.go new file mode 100644 index 000000000000..1631eeb546fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_akscomputesecrets.go @@ -0,0 +1,43 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ComputeSecrets = AksComputeSecrets{} + +type AksComputeSecrets struct { + AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` + ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` + UserKubeConfig *string `json:"userKubeConfig,omitempty"` + + // Fields inherited from ComputeSecrets +} + +var _ json.Marshaler = AksComputeSecrets{} + +func (s AksComputeSecrets) MarshalJSON() ([]byte, error) { + type wrapper AksComputeSecrets + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AksComputeSecrets: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AksComputeSecrets: %+v", err) + } + decoded["computeType"] = "AKS" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AksComputeSecrets: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aksnetworkingconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aksnetworkingconfiguration.go new file mode 100644 index 000000000000..3cee75f3447c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aksnetworkingconfiguration.go @@ -0,0 +1,11 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AksNetworkingConfiguration struct { + DnsServiceIP *string `json:"dnsServiceIP,omitempty"` + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + ServiceCidr *string `json:"serviceCidr,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aksschemaproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aksschemaproperties.go new file mode 100644 index 000000000000..770b1c64e7d0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_aksschemaproperties.go @@ -0,0 +1,16 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AKSSchemaProperties struct { + AgentCount *int64 `json:"agentCount,omitempty"` + AgentVmSize *string `json:"agentVmSize,omitempty"` + AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` + ClusterFqdn *string `json:"clusterFqdn,omitempty"` + ClusterPurpose *ClusterPurpose `json:"clusterPurpose,omitempty"` + LoadBalancerSubnet *string `json:"loadBalancerSubnet,omitempty"` + LoadBalancerType *LoadBalancerType `json:"loadBalancerType,omitempty"` + SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` + SystemServices *[]SystemService `json:"systemServices,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcompute.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcompute.go new file mode 100644 index 000000000000..3f1c2957bf47 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcompute.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = AmlCompute{} + +type AmlCompute struct { + Properties *AmlComputeProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *AmlCompute) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *AmlCompute) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *AmlCompute) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *AmlCompute) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = AmlCompute{} + +func (s AmlCompute) MarshalJSON() ([]byte, error) { + type wrapper AmlCompute + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AmlCompute: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AmlCompute: %+v", err) + } + decoded["computeType"] = "AmlCompute" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AmlCompute: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputenodeinformation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputenodeinformation.go new file mode 100644 index 000000000000..3a46b5212970 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputenodeinformation.go @@ -0,0 +1,13 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmlComputeNodeInformation struct { + NodeId *string `json:"nodeId,omitempty"` + NodeState *NodeState `json:"nodeState,omitempty"` + Port *float64 `json:"port,omitempty"` + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + RunId *string `json:"runId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputenodesinformation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputenodesinformation.go new file mode 100644 index 000000000000..9f6b0b8dbd4e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputenodesinformation.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmlComputeNodesInformation struct { + NextLink *string `json:"nextLink,omitempty"` + Nodes *[]AmlComputeNodeInformation `json:"nodes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputeproperties.go new file mode 100644 index 000000000000..aa98d7846616 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_amlcomputeproperties.go @@ -0,0 +1,42 @@ +package machinelearningcomputes + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmlComputeProperties struct { + AllocationState *AllocationState `json:"allocationState,omitempty"` + AllocationStateTransitionTime *string `json:"allocationStateTransitionTime,omitempty"` + CurrentNodeCount *int64 `json:"currentNodeCount,omitempty"` + EnableNodePublicIP *bool `json:"enableNodePublicIp,omitempty"` + Errors *[]ErrorResponse `json:"errors,omitempty"` + IsolatedNetwork *bool `json:"isolatedNetwork,omitempty"` + NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"` + OsType *OsType `json:"osType,omitempty"` + PropertyBag *interface{} `json:"propertyBag,omitempty"` + RemoteLoginPortPublicAccess *RemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"` + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + Subnet *ResourceId `json:"subnet,omitempty"` + TargetNodeCount *int64 `json:"targetNodeCount,omitempty"` + UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` + VirtualMachineImage *VirtualMachineImage `json:"virtualMachineImage,omitempty"` + VmPriority *VmPriority `json:"vmPriority,omitempty"` + VmSize *string `json:"vmSize,omitempty"` +} + +func (o *AmlComputeProperties) GetAllocationStateTransitionTimeAsTime() (*time.Time, error) { + if o.AllocationStateTransitionTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.AllocationStateTransitionTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *AmlComputeProperties) SetAllocationStateTransitionTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.AllocationStateTransitionTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_assigneduser.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_assigneduser.go new file mode 100644 index 000000000000..1cea1e46a435 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_assigneduser.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AssignedUser struct { + ObjectId string `json:"objectId"` + TenantId string `json:"tenantId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_autopauseproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_autopauseproperties.go new file mode 100644 index 000000000000..7275a113dc36 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_autopauseproperties.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutoPauseProperties struct { + DelayInMinutes *int64 `json:"delayInMinutes,omitempty"` + Enabled *bool `json:"enabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_autoscaleproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_autoscaleproperties.go new file mode 100644 index 000000000000..477fb67c36c1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_autoscaleproperties.go @@ -0,0 +1,10 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutoScaleProperties struct { + Enabled *bool `json:"enabled,omitempty"` + MaxNodeCount *int64 `json:"maxNodeCount,omitempty"` + MinNodeCount *int64 `json:"minNodeCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_clusterupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_clusterupdateparameters.go new file mode 100644 index 000000000000..409c14c3c9ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_clusterupdateparameters.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterUpdateParameters struct { + Properties *ClusterUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_clusterupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_clusterupdateproperties.go new file mode 100644 index 000000000000..734e2b1dcf67 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_clusterupdateproperties.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterUpdateProperties struct { + Properties *ScaleSettingsInformation `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_compute.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_compute.go new file mode 100644 index 000000000000..f7de7f3b28c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_compute.go @@ -0,0 +1,120 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Compute interface { +} + +func unmarshalComputeImplementation(input []byte) (Compute, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling Compute into map[string]interface: %+v", err) + } + + value, ok := temp["computeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKS") { + var out AKS + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AKS: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "AmlCompute") { + var out AmlCompute + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AmlCompute: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ComputeInstance") { + var out ComputeInstance + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ComputeInstance: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DataFactory") { + var out DataFactory + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DataFactory: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "DataLakeAnalytics") { + var out DataLakeAnalytics + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DataLakeAnalytics: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Databricks") { + var out Databricks + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into Databricks: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HDInsight") { + var out HDInsight + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HDInsight: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Kubernetes") { + var out Kubernetes + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into Kubernetes: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "SynapseSpark") { + var out SynapseSpark + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into SynapseSpark: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualMachine") { + var out VirtualMachine + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualMachine: %+v", err) + } + return out, nil + } + + type RawComputeImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawComputeImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstance.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstance.go new file mode 100644 index 000000000000..292c0c1a3753 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstance.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = ComputeInstance{} + +type ComputeInstance struct { + Properties *ComputeInstanceProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *ComputeInstance) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *ComputeInstance) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *ComputeInstance) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *ComputeInstance) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = ComputeInstance{} + +func (s ComputeInstance) MarshalJSON() ([]byte, error) { + type wrapper ComputeInstance + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ComputeInstance: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ComputeInstance: %+v", err) + } + decoded["computeType"] = "ComputeInstance" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ComputeInstance: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceapplication.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceapplication.go new file mode 100644 index 000000000000..29069347cc26 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceapplication.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceApplication struct { + DisplayName *string `json:"displayName,omitempty"` + EndpointUri *string `json:"endpointUri,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceconnectivityendpoints.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceconnectivityendpoints.go new file mode 100644 index 000000000000..806067ce6264 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceconnectivityendpoints.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceConnectivityEndpoints struct { + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + PublicIPAddress *string `json:"publicIpAddress,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancecontainer.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancecontainer.go new file mode 100644 index 000000000000..e21fffac9043 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancecontainer.go @@ -0,0 +1,13 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceContainer struct { + Autosave *Autosave `json:"autosave,omitempty"` + Environment *ComputeInstanceEnvironmentInfo `json:"environment,omitempty"` + Gpu *string `json:"gpu,omitempty"` + Name *string `json:"name,omitempty"` + Network *Network `json:"network,omitempty"` + Services *[]interface{} `json:"services,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancecreatedby.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancecreatedby.go new file mode 100644 index 000000000000..8badc26c3a4b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancecreatedby.go @@ -0,0 +1,10 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceCreatedBy struct { + UserId *string `json:"userId,omitempty"` + UserName *string `json:"userName,omitempty"` + UserOrgId *string `json:"userOrgId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancedatadisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancedatadisk.go new file mode 100644 index 000000000000..f7f2bb4a6238 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancedatadisk.go @@ -0,0 +1,11 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceDataDisk struct { + Caching *Caching `json:"caching,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + Lun *int64 `json:"lun,omitempty"` + StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancedatamount.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancedatamount.go new file mode 100644 index 000000000000..9da0d27488f8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancedatamount.go @@ -0,0 +1,34 @@ +package machinelearningcomputes + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceDataMount struct { + CreatedBy *string `json:"createdBy,omitempty"` + Error *string `json:"error,omitempty"` + MountAction *MountAction `json:"mountAction,omitempty"` + MountName *string `json:"mountName,omitempty"` + MountPath *string `json:"mountPath,omitempty"` + MountState *MountState `json:"mountState,omitempty"` + MountedOn *string `json:"mountedOn,omitempty"` + Source *string `json:"source,omitempty"` + SourceType *SourceType `json:"sourceType,omitempty"` +} + +func (o *ComputeInstanceDataMount) GetMountedOnAsTime() (*time.Time, error) { + if o.MountedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.MountedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *ComputeInstanceDataMount) SetMountedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.MountedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceenvironmentinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceenvironmentinfo.go new file mode 100644 index 000000000000..7b87a09917b6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceenvironmentinfo.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceEnvironmentInfo struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancelastoperation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancelastoperation.go new file mode 100644 index 000000000000..6f2a41075830 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancelastoperation.go @@ -0,0 +1,29 @@ +package machinelearningcomputes + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceLastOperation struct { + OperationName *OperationName `json:"operationName,omitempty"` + OperationStatus *OperationStatus `json:"operationStatus,omitempty"` + OperationTime *string `json:"operationTime,omitempty"` + OperationTrigger *OperationTrigger `json:"operationTrigger,omitempty"` +} + +func (o *ComputeInstanceLastOperation) GetOperationTimeAsTime() (*time.Time, error) { + if o.OperationTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.OperationTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *ComputeInstanceLastOperation) SetOperationTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.OperationTime = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceproperties.go new file mode 100644 index 000000000000..21620dd82e1b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceproperties.go @@ -0,0 +1,26 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceProperties struct { + ApplicationSharingPolicy *ApplicationSharingPolicy `json:"applicationSharingPolicy,omitempty"` + Applications *[]ComputeInstanceApplication `json:"applications,omitempty"` + ComputeInstanceAuthorizationType *ComputeInstanceAuthorizationType `json:"computeInstanceAuthorizationType,omitempty"` + ConnectivityEndpoints *ComputeInstanceConnectivityEndpoints `json:"connectivityEndpoints,omitempty"` + Containers *[]ComputeInstanceContainer `json:"containers,omitempty"` + CreatedBy *ComputeInstanceCreatedBy `json:"createdBy,omitempty"` + DataDisks *[]ComputeInstanceDataDisk `json:"dataDisks,omitempty"` + DataMounts *[]ComputeInstanceDataMount `json:"dataMounts,omitempty"` + EnableNodePublicIP *bool `json:"enableNodePublicIp,omitempty"` + Errors *[]ErrorResponse `json:"errors,omitempty"` + LastOperation *ComputeInstanceLastOperation `json:"lastOperation,omitempty"` + PersonalComputeInstanceSettings *PersonalComputeInstanceSettings `json:"personalComputeInstanceSettings,omitempty"` + Schedules *ComputeSchedules `json:"schedules,omitempty"` + SetupScripts *SetupScripts `json:"setupScripts,omitempty"` + SshSettings *ComputeInstanceSshSettings `json:"sshSettings,omitempty"` + State *ComputeInstanceState `json:"state,omitempty"` + Subnet *ResourceId `json:"subnet,omitempty"` + Versions *ComputeInstanceVersion `json:"versions,omitempty"` + VmSize *string `json:"vmSize,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancesshsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancesshsettings.go new file mode 100644 index 000000000000..2afa3fea0cb4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstancesshsettings.go @@ -0,0 +1,11 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceSshSettings struct { + AdminPublicKey *string `json:"adminPublicKey,omitempty"` + AdminUserName *string `json:"adminUserName,omitempty"` + SshPort *int64 `json:"sshPort,omitempty"` + SshPublicAccess *SshPublicAccess `json:"sshPublicAccess,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceversion.go new file mode 100644 index 000000000000..f197ea76f1ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeinstanceversion.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeInstanceVersion struct { + Runtime *string `json:"runtime,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeresource.go new file mode 100644 index 000000000000..4d4a4646b3ee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeresource.go @@ -0,0 +1,57 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeResource struct { + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties Compute `json:"properties"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ComputeResource{} + +func (s *ComputeResource) UnmarshalJSON(bytes []byte) error { + type alias ComputeResource + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ComputeResource: %+v", err) + } + + s.Id = decoded.Id + s.Identity = decoded.Identity + s.Location = decoded.Location + s.Name = decoded.Name + s.Sku = decoded.Sku + s.SystemData = decoded.SystemData + s.Tags = decoded.Tags + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ComputeResource into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalComputeImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ComputeResource': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeschedules.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeschedules.go new file mode 100644 index 000000000000..d30d36696b83 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computeschedules.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeSchedules struct { + ComputeStartStop *[]ComputeStartStopSchedule `json:"computeStartStop,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computesecrets.go new file mode 100644 index 000000000000..f8dc798f94c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computesecrets.go @@ -0,0 +1,64 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeSecrets interface { +} + +func unmarshalComputeSecretsImplementation(input []byte) (ComputeSecrets, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ComputeSecrets into map[string]interface: %+v", err) + } + + value, ok := temp["computeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKS") { + var out AksComputeSecrets + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AksComputeSecrets: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Databricks") { + var out DatabricksComputeSecrets + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DatabricksComputeSecrets: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualMachine") { + var out VirtualMachineSecrets + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualMachineSecrets: %+v", err) + } + return out, nil + } + + type RawComputeSecretsImpl struct { + Type string `json:"-"` + Values map[string]interface{} `json:"-"` + } + out := RawComputeSecretsImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computestartstopschedule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computestartstopschedule.go new file mode 100644 index 000000000000..5d78482328dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_computestartstopschedule.go @@ -0,0 +1,11 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeStartStopSchedule struct { + Action *ComputePowerAction `json:"action,omitempty"` + Id *string `json:"id,omitempty"` + ProvisioningStatus *ProvisioningStatus `json:"provisioningStatus,omitempty"` + Schedule *ScheduleBase `json:"schedule,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databricks.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databricks.go new file mode 100644 index 000000000000..3018dda2dea1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databricks.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = Databricks{} + +type Databricks struct { + Properties *DatabricksProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *Databricks) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *Databricks) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *Databricks) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *Databricks) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = Databricks{} + +func (s Databricks) MarshalJSON() ([]byte, error) { + type wrapper Databricks + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling Databricks: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling Databricks: %+v", err) + } + decoded["computeType"] = "Databricks" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling Databricks: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databrickscomputesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databrickscomputesecrets.go new file mode 100644 index 000000000000..8beb92158896 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databrickscomputesecrets.go @@ -0,0 +1,41 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ComputeSecrets = DatabricksComputeSecrets{} + +type DatabricksComputeSecrets struct { + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + + // Fields inherited from ComputeSecrets +} + +var _ json.Marshaler = DatabricksComputeSecrets{} + +func (s DatabricksComputeSecrets) MarshalJSON() ([]byte, error) { + type wrapper DatabricksComputeSecrets + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DatabricksComputeSecrets: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DatabricksComputeSecrets: %+v", err) + } + decoded["computeType"] = "Databricks" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DatabricksComputeSecrets: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databricksproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databricksproperties.go new file mode 100644 index 000000000000..9a390a9c79cf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_databricksproperties.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabricksProperties struct { + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + WorkspaceUrl *string `json:"workspaceUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datafactory.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datafactory.go new file mode 100644 index 000000000000..25a38345b026 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datafactory.go @@ -0,0 +1,76 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = DataFactory{} + +type DataFactory struct { + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *DataFactory) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataFactory) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *DataFactory) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataFactory) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = DataFactory{} + +func (s DataFactory) MarshalJSON() ([]byte, error) { + type wrapper DataFactory + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DataFactory: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DataFactory: %+v", err) + } + decoded["computeType"] = "DataFactory" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DataFactory: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datalakeanalytics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datalakeanalytics.go new file mode 100644 index 000000000000..346316396bdd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datalakeanalytics.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = DataLakeAnalytics{} + +type DataLakeAnalytics struct { + Properties *DataLakeAnalyticsSchemaProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *DataLakeAnalytics) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataLakeAnalytics) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *DataLakeAnalytics) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *DataLakeAnalytics) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = DataLakeAnalytics{} + +func (s DataLakeAnalytics) MarshalJSON() ([]byte, error) { + type wrapper DataLakeAnalytics + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DataLakeAnalytics: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DataLakeAnalytics: %+v", err) + } + decoded["computeType"] = "DataLakeAnalytics" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DataLakeAnalytics: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datalakeanalyticsschemaproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datalakeanalyticsschemaproperties.go new file mode 100644 index 000000000000..18acd597a1bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_datalakeanalyticsschemaproperties.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataLakeAnalyticsSchemaProperties struct { + DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_erroradditionalinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_erroradditionalinfo.go new file mode 100644 index 000000000000..c8bfdef68776 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_erroradditionalinfo.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ErrorAdditionalInfo struct { + Info *interface{} `json:"info,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_errordetail.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_errordetail.go new file mode 100644 index 000000000000..c517f46aee88 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_errordetail.go @@ -0,0 +1,12 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ErrorDetail struct { + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` + Code *string `json:"code,omitempty"` + Details *[]ErrorDetail `json:"details,omitempty"` + Message *string `json:"message,omitempty"` + Target *string `json:"target,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_errorresponse.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_errorresponse.go new file mode 100644 index 000000000000..4d4b4e9be549 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_errorresponse.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ErrorResponse struct { + Error *ErrorDetail `json:"error,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_hdinsight.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_hdinsight.go new file mode 100644 index 000000000000..d0034c74c633 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_hdinsight.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = HDInsight{} + +type HDInsight struct { + Properties *HDInsightProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *HDInsight) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *HDInsight) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *HDInsight) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *HDInsight) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = HDInsight{} + +func (s HDInsight) MarshalJSON() ([]byte, error) { + type wrapper HDInsight + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HDInsight: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HDInsight: %+v", err) + } + decoded["computeType"] = "HDInsight" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HDInsight: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_hdinsightproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_hdinsightproperties.go new file mode 100644 index 000000000000..ae520cc46e83 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_hdinsightproperties.go @@ -0,0 +1,10 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HDInsightProperties struct { + Address *string `json:"address,omitempty"` + AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"` + SshPort *int64 `json:"sshPort,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_instancetypeschema.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_instancetypeschema.go new file mode 100644 index 000000000000..3d54d19ad88b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_instancetypeschema.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceTypeSchema struct { + NodeSelector *map[string]string `json:"nodeSelector,omitempty"` + Resources *InstanceTypeSchemaResources `json:"resources,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_instancetypeschemaresources.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_instancetypeschemaresources.go new file mode 100644 index 000000000000..436be5b40918 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_instancetypeschemaresources.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceTypeSchemaResources struct { + Limits *map[string]string `json:"limits,omitempty"` + Requests *map[string]string `json:"requests,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_kubernetes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_kubernetes.go new file mode 100644 index 000000000000..7818fb5fdf9d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_kubernetes.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = Kubernetes{} + +type Kubernetes struct { + Properties *KubernetesProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *Kubernetes) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *Kubernetes) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *Kubernetes) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *Kubernetes) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = Kubernetes{} + +func (s Kubernetes) MarshalJSON() ([]byte, error) { + type wrapper Kubernetes + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling Kubernetes: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling Kubernetes: %+v", err) + } + decoded["computeType"] = "Kubernetes" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling Kubernetes: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_kubernetesproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_kubernetesproperties.go new file mode 100644 index 000000000000..2c027ee1f074 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_kubernetesproperties.go @@ -0,0 +1,15 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KubernetesProperties struct { + DefaultInstanceType *string `json:"defaultInstanceType,omitempty"` + ExtensionInstanceReleaseTrain *string `json:"extensionInstanceReleaseTrain,omitempty"` + ExtensionPrincipalId *string `json:"extensionPrincipalId,omitempty"` + InstanceTypes *map[string]InstanceTypeSchema `json:"instanceTypes,omitempty"` + Namespace *string `json:"namespace,omitempty"` + RelayConnectionString *string `json:"relayConnectionString,omitempty"` + ServiceBusConnectionString *string `json:"serviceBusConnectionString,omitempty"` + VcName *string `json:"vcName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_nodestatecounts.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_nodestatecounts.go new file mode 100644 index 000000000000..b52b2988fe39 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_nodestatecounts.go @@ -0,0 +1,13 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NodeStateCounts struct { + IdleNodeCount *int64 `json:"idleNodeCount,omitempty"` + LeavingNodeCount *int64 `json:"leavingNodeCount,omitempty"` + PreemptedNodeCount *int64 `json:"preemptedNodeCount,omitempty"` + PreparingNodeCount *int64 `json:"preparingNodeCount,omitempty"` + RunningNodeCount *int64 `json:"runningNodeCount,omitempty"` + UnusableNodeCount *int64 `json:"unusableNodeCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_personalcomputeinstancesettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_personalcomputeinstancesettings.go new file mode 100644 index 000000000000..684e03b3706b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_personalcomputeinstancesettings.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PersonalComputeInstanceSettings struct { + AssignedUser *AssignedUser `json:"assignedUser,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_resourceid.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_resourceid.go new file mode 100644 index 000000000000..f4a566848d27 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_resourceid.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceId struct { + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scalesettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scalesettings.go new file mode 100644 index 000000000000..1ca12f87d348 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scalesettings.go @@ -0,0 +1,10 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScaleSettings struct { + MaxNodeCount int64 `json:"maxNodeCount"` + MinNodeCount *int64 `json:"minNodeCount,omitempty"` + NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scalesettingsinformation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scalesettingsinformation.go new file mode 100644 index 000000000000..779e0d1092ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scalesettingsinformation.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScaleSettingsInformation struct { + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_schedulebase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_schedulebase.go new file mode 100644 index 000000000000..be4a7bf9c5a0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_schedulebase.go @@ -0,0 +1,10 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScheduleBase struct { + Id *string `json:"id,omitempty"` + ProvisioningStatus *ScheduleProvisioningState `json:"provisioningStatus,omitempty"` + Status *ScheduleStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scriptreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scriptreference.go new file mode 100644 index 000000000000..521b22711591 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scriptreference.go @@ -0,0 +1,11 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScriptReference struct { + ScriptArguments *string `json:"scriptArguments,omitempty"` + ScriptData *string `json:"scriptData,omitempty"` + ScriptSource *string `json:"scriptSource,omitempty"` + Timeout *string `json:"timeout,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scriptstoexecute.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scriptstoexecute.go new file mode 100644 index 000000000000..71c845ef62f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_scriptstoexecute.go @@ -0,0 +1,9 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScriptsToExecute struct { + CreationScript *ScriptReference `json:"creationScript,omitempty"` + StartupScript *ScriptReference `json:"startupScript,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_setupscripts.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_setupscripts.go new file mode 100644 index 000000000000..9a08bcab361b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_setupscripts.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SetupScripts struct { + Scripts *ScriptsToExecute `json:"scripts,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_sku.go new file mode 100644 index 000000000000..8e5c1cdb9126 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_sku.go @@ -0,0 +1,12 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Sku struct { + Capacity *int64 `json:"capacity,omitempty"` + Family *string `json:"family,omitempty"` + Name string `json:"name"` + Size *string `json:"size,omitempty"` + Tier *SkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_sslconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_sslconfiguration.go new file mode 100644 index 000000000000..71a4753d55d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_sslconfiguration.go @@ -0,0 +1,13 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SslConfiguration struct { + Cert *string `json:"cert,omitempty"` + Cname *string `json:"cname,omitempty"` + Key *string `json:"key,omitempty"` + LeafDomainLabel *string `json:"leafDomainLabel,omitempty"` + OverwriteExistingDomain *bool `json:"overwriteExistingDomain,omitempty"` + Status *SslConfigStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_synapsespark.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_synapsespark.go new file mode 100644 index 000000000000..494454096eac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_synapsespark.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = SynapseSpark{} + +type SynapseSpark struct { + Properties *SynapseSparkProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *SynapseSpark) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *SynapseSpark) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *SynapseSpark) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *SynapseSpark) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = SynapseSpark{} + +func (s SynapseSpark) MarshalJSON() ([]byte, error) { + type wrapper SynapseSpark + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling SynapseSpark: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling SynapseSpark: %+v", err) + } + decoded["computeType"] = "SynapseSpark" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling SynapseSpark: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_synapsesparkproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_synapsesparkproperties.go new file mode 100644 index 000000000000..78b3d2e5ea6a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_synapsesparkproperties.go @@ -0,0 +1,17 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SynapseSparkProperties struct { + AutoPauseProperties *AutoPauseProperties `json:"autoPauseProperties,omitempty"` + AutoScaleProperties *AutoScaleProperties `json:"autoScaleProperties,omitempty"` + NodeCount *int64 `json:"nodeCount,omitempty"` + NodeSize *string `json:"nodeSize,omitempty"` + NodeSizeFamily *string `json:"nodeSizeFamily,omitempty"` + PoolName *string `json:"poolName,omitempty"` + ResourceGroup *string `json:"resourceGroup,omitempty"` + SparkVersion *string `json:"sparkVersion,omitempty"` + SubscriptionId *string `json:"subscriptionId,omitempty"` + WorkspaceName *string `json:"workspaceName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_systemservice.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_systemservice.go new file mode 100644 index 000000000000..8d21f387886a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_systemservice.go @@ -0,0 +1,10 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SystemService struct { + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + SystemServiceType *string `json:"systemServiceType,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_useraccountcredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_useraccountcredentials.go new file mode 100644 index 000000000000..0ab389fc16c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_useraccountcredentials.go @@ -0,0 +1,10 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UserAccountCredentials struct { + AdminUserName string `json:"adminUserName"` + AdminUserPassword *string `json:"adminUserPassword,omitempty"` + AdminUserSshPublicKey *string `json:"adminUserSshPublicKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachine.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachine.go new file mode 100644 index 000000000000..6a07ffd4f6e6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachine.go @@ -0,0 +1,77 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ Compute = VirtualMachine{} + +type VirtualMachine struct { + Properties *VirtualMachineSchemaProperties `json:"properties,omitempty"` + + // Fields inherited from Compute + ComputeLocation *string `json:"computeLocation,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + Description *string `json:"description,omitempty"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + ModifiedOn *string `json:"modifiedOn,omitempty"` + ProvisioningErrors *[]ErrorResponse `json:"provisioningErrors,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} + +func (o *VirtualMachine) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualMachine) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} + +func (o *VirtualMachine) GetModifiedOnAsTime() (*time.Time, error) { + if o.ModifiedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualMachine) SetModifiedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedOn = &formatted +} + +var _ json.Marshaler = VirtualMachine{} + +func (s VirtualMachine) MarshalJSON() ([]byte, error) { + type wrapper VirtualMachine + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualMachine: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualMachine: %+v", err) + } + decoded["computeType"] = "VirtualMachine" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualMachine: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachineimage.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachineimage.go new file mode 100644 index 000000000000..9f5b42c0e089 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachineimage.go @@ -0,0 +1,8 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineImage struct { + Id string `json:"id"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachineschemaproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachineschemaproperties.go new file mode 100644 index 000000000000..234cb9957edd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachineschemaproperties.go @@ -0,0 +1,13 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineSchemaProperties struct { + Address *string `json:"address,omitempty"` + AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"` + IsNotebookInstanceCompute *bool `json:"isNotebookInstanceCompute,omitempty"` + NotebookServerPort *int64 `json:"notebookServerPort,omitempty"` + SshPort *int64 `json:"sshPort,omitempty"` + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachinesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachinesecrets.go new file mode 100644 index 000000000000..9db81884f8fe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachinesecrets.go @@ -0,0 +1,41 @@ +package machinelearningcomputes + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ComputeSecrets = VirtualMachineSecrets{} + +type VirtualMachineSecrets struct { + AdministratorAccount *VirtualMachineSshCredentials `json:"administratorAccount,omitempty"` + + // Fields inherited from ComputeSecrets +} + +var _ json.Marshaler = VirtualMachineSecrets{} + +func (s VirtualMachineSecrets) MarshalJSON() ([]byte, error) { + type wrapper VirtualMachineSecrets + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualMachineSecrets: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualMachineSecrets: %+v", err) + } + decoded["computeType"] = "VirtualMachine" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualMachineSecrets: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachinesshcredentials.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachinesshcredentials.go new file mode 100644 index 000000000000..980c4958b1b6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/model_virtualmachinesshcredentials.go @@ -0,0 +1,11 @@ +package machinelearningcomputes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineSshCredentials struct { + Password *string `json:"password,omitempty"` + PrivateKeyData *string `json:"privateKeyData,omitempty"` + PublicKeyData *string `json:"publicKeyData,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/predicates.go new file mode 100644 index 000000000000..16a369c02bb7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/predicates.go @@ -0,0 +1,42 @@ +package machinelearningcomputes + +type AmlComputeNodesInformationOperationPredicate struct { + NextLink *string +} + +func (p AmlComputeNodesInformationOperationPredicate) Matches(input AmlComputeNodesInformation) bool { + + if p.NextLink != nil && (input.NextLink == nil && *p.NextLink != *input.NextLink) { + return false + } + + return true +} + +type ComputeResourceOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p ComputeResourceOperationPredicate) Matches(input ComputeResource) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && (input.Location == nil && *p.Location != *input.Location) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/version.go new file mode 100644 index 000000000000..6f70cff32824 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes/version.go @@ -0,0 +1,12 @@ +package machinelearningcomputes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-05-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/machinelearningcomputes/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/README.md new file mode 100644 index 000000000000..aa8ddfe580e6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/README.md @@ -0,0 +1,194 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces` Documentation + +The `workspaces` SDK allows for interaction with the Azure Resource Manager Service `machinelearningservices` (API Version `2022-05-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces" +``` + + +### Client Initialization + +```go +client := workspaces.NewWorkspacesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `WorkspacesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +payload := workspaces.Workspace{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `WorkspacesClient.Delete` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `WorkspacesClient.Diagnose` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +payload := workspaces.DiagnoseWorkspaceParameters{ + // ... +} + + +if err := client.DiagnoseThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `WorkspacesClient.Get` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WorkspacesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := workspaces.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id, workspaces.DefaultListByResourceGroupOperationOptions())` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id, workspaces.DefaultListByResourceGroupOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `WorkspacesClient.ListBySubscription` + +```go +ctx := context.TODO() +id := workspaces.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id, workspaces.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id, workspaces.DefaultListBySubscriptionOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `WorkspacesClient.ListKeys` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +read, err := client.ListKeys(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WorkspacesClient.ListNotebookAccessToken` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +read, err := client.ListNotebookAccessToken(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WorkspacesClient.ResyncKeys` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +if err := client.ResyncKeysThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `WorkspacesClient.Update` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +payload := workspaces.WorkspaceUpdateParameters{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `WorkspacesClient.WorkspaceFeaturesList` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") + +// alternatively `client.WorkspaceFeaturesList(ctx, id)` can be used to do batched pagination +items, err := client.WorkspaceFeaturesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/client.go new file mode 100644 index 000000000000..02d022fa85e3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/client.go @@ -0,0 +1,18 @@ +package workspaces + +import "github.com/Azure/go-autorest/autorest" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WorkspacesClient struct { + Client autorest.Client + baseUri string +} + +func NewWorkspacesClientWithBaseURI(endpoint string) WorkspacesClient { + return WorkspacesClient{ + Client: autorest.NewClientWithUserAgent(userAgent()), + baseUri: endpoint, + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/constants.go new file mode 100644 index 000000000000..59c4efddbb95 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/constants.go @@ -0,0 +1,241 @@ +package workspaces + +import "strings" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnoseResultLevel string + +const ( + DiagnoseResultLevelError DiagnoseResultLevel = "Error" + DiagnoseResultLevelInformation DiagnoseResultLevel = "Information" + DiagnoseResultLevelWarning DiagnoseResultLevel = "Warning" +) + +func PossibleValuesForDiagnoseResultLevel() []string { + return []string{ + string(DiagnoseResultLevelError), + string(DiagnoseResultLevelInformation), + string(DiagnoseResultLevelWarning), + } +} + +func parseDiagnoseResultLevel(input string) (*DiagnoseResultLevel, error) { + vals := map[string]DiagnoseResultLevel{ + "error": DiagnoseResultLevelError, + "information": DiagnoseResultLevelInformation, + "warning": DiagnoseResultLevelWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiagnoseResultLevel(input) + return &out, nil +} + +type EncryptionStatus string + +const ( + EncryptionStatusDisabled EncryptionStatus = "Disabled" + EncryptionStatusEnabled EncryptionStatus = "Enabled" +) + +func PossibleValuesForEncryptionStatus() []string { + return []string{ + string(EncryptionStatusDisabled), + string(EncryptionStatusEnabled), + } +} + +func parseEncryptionStatus(input string) (*EncryptionStatus, error) { + vals := map[string]EncryptionStatus{ + "disabled": EncryptionStatusDisabled, + "enabled": EncryptionStatusEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionStatus(input) + return &out, nil +} + +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string { + return []string{ + string(PrivateEndpointConnectionProvisioningStateCreating), + string(PrivateEndpointConnectionProvisioningStateDeleting), + string(PrivateEndpointConnectionProvisioningStateFailed), + string(PrivateEndpointConnectionProvisioningStateSucceeded), + } +} + +func parsePrivateEndpointConnectionProvisioningState(input string) (*PrivateEndpointConnectionProvisioningState, error) { + vals := map[string]PrivateEndpointConnectionProvisioningState{ + "creating": PrivateEndpointConnectionProvisioningStateCreating, + "deleting": PrivateEndpointConnectionProvisioningStateDeleting, + "failed": PrivateEndpointConnectionProvisioningStateFailed, + "succeeded": PrivateEndpointConnectionProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateEndpointConnectionProvisioningState(input) + return &out, nil +} + +type PrivateEndpointServiceConnectionStatus string + +const ( + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected" + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" + PrivateEndpointServiceConnectionStatusTimeout PrivateEndpointServiceConnectionStatus = "Timeout" +) + +func PossibleValuesForPrivateEndpointServiceConnectionStatus() []string { + return []string{ + string(PrivateEndpointServiceConnectionStatusApproved), + string(PrivateEndpointServiceConnectionStatusDisconnected), + string(PrivateEndpointServiceConnectionStatusPending), + string(PrivateEndpointServiceConnectionStatusRejected), + string(PrivateEndpointServiceConnectionStatusTimeout), + } +} + +func parsePrivateEndpointServiceConnectionStatus(input string) (*PrivateEndpointServiceConnectionStatus, error) { + vals := map[string]PrivateEndpointServiceConnectionStatus{ + "approved": PrivateEndpointServiceConnectionStatusApproved, + "disconnected": PrivateEndpointServiceConnectionStatusDisconnected, + "pending": PrivateEndpointServiceConnectionStatusPending, + "rejected": PrivateEndpointServiceConnectionStatusRejected, + "timeout": PrivateEndpointServiceConnectionStatusTimeout, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PrivateEndpointServiceConnectionStatus(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUnknown ProvisioningState = "Unknown" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUnknown), + string(ProvisioningStateUpdating), + } +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "unknown": ProvisioningStateUnknown, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +func PossibleValuesForPublicNetworkAccess() []string { + return []string{ + string(PublicNetworkAccessDisabled), + string(PublicNetworkAccessEnabled), + } +} + +func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { + vals := map[string]PublicNetworkAccess{ + "disabled": PublicNetworkAccessDisabled, + "enabled": PublicNetworkAccessEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicNetworkAccess(input) + return &out, nil +} + +type SkuTier string + +const ( + SkuTierBasic SkuTier = "Basic" + SkuTierFree SkuTier = "Free" + SkuTierPremium SkuTier = "Premium" + SkuTierStandard SkuTier = "Standard" +) + +func PossibleValuesForSkuTier() []string { + return []string{ + string(SkuTierBasic), + string(SkuTierFree), + string(SkuTierPremium), + string(SkuTierStandard), + } +} + +func parseSkuTier(input string) (*SkuTier, error) { + vals := map[string]SkuTier{ + "basic": SkuTierBasic, + "free": SkuTierFree, + "premium": SkuTierPremium, + "standard": SkuTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkuTier(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/id_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/id_workspace.go new file mode 100644 index 000000000000..48a69d781439 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/id_workspace.go @@ -0,0 +1,124 @@ +package workspaces + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.ResourceId = WorkspaceId{} + +// WorkspaceId is a struct representing the Resource ID for a Workspace +type WorkspaceId struct { + SubscriptionId string + ResourceGroupName string + WorkspaceName string +} + +// NewWorkspaceID returns a new WorkspaceId struct +func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + WorkspaceName: workspaceName, + } +} + +// ParseWorkspaceID parses 'input' into a WorkspaceId +func ParseWorkspaceID(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'workspaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId +// note: this method should only be used for API response data and not user input +func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(WorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := WorkspaceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, fmt.Errorf("the segment 'subscriptionId' was not found in the resource id %q", input) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, fmt.Errorf("the segment 'resourceGroupName' was not found in the resource id %q", input) + } + + if id.WorkspaceName, ok = parsed.Parsed["workspaceName"]; !ok { + return nil, fmt.Errorf("the segment 'workspaceName' was not found in the resource id %q", input) + } + + return &id, nil +} + +// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID +func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Workspace ID +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.MachineLearningServices/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Workspace ID +func (id WorkspaceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftMachineLearningServices", "Microsoft.MachineLearningServices", "Microsoft.MachineLearningServices"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), + } +} + +// String returns a human-readable description of this Workspace ID +func (id WorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_createorupdate_autorest.go new file mode 100644 index 000000000000..7e742b0f05f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_createorupdate_autorest.go @@ -0,0 +1,79 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// CreateOrUpdate ... +func (c WorkspacesClient) CreateOrUpdate(ctx context.Context, id WorkspaceId, input Workspace) (result CreateOrUpdateOperationResponse, err error) { + req, err := c.preparerForCreateOrUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = c.senderForCreateOrUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c WorkspacesClient) CreateOrUpdateThenPoll(ctx context.Context, id WorkspaceId, input Workspace) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} + +// preparerForCreateOrUpdate prepares the CreateOrUpdate request. +func (c WorkspacesClient) preparerForCreateOrUpdate(ctx context.Context, id WorkspaceId, input Workspace) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (c WorkspacesClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_delete_autorest.go new file mode 100644 index 000000000000..3475fce1278b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_delete_autorest.go @@ -0,0 +1,78 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Delete ... +func (c WorkspacesClient) Delete(ctx context.Context, id WorkspaceId) (result DeleteOperationResponse, err error) { + req, err := c.preparerForDelete(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = c.senderForDelete(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Delete", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c WorkspacesClient) DeleteThenPoll(ctx context.Context, id WorkspaceId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} + +// preparerForDelete prepares the Delete request. +func (c WorkspacesClient) preparerForDelete(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsDelete(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDelete sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (c WorkspacesClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_diagnose_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_diagnose_autorest.go new file mode 100644 index 000000000000..529c1a73c702 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_diagnose_autorest.go @@ -0,0 +1,79 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnoseOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Diagnose ... +func (c WorkspacesClient) Diagnose(ctx context.Context, id WorkspaceId, input DiagnoseWorkspaceParameters) (result DiagnoseOperationResponse, err error) { + req, err := c.preparerForDiagnose(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Diagnose", nil, "Failure preparing request") + return + } + + result, err = c.senderForDiagnose(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Diagnose", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// DiagnoseThenPoll performs Diagnose then polls until it's completed +func (c WorkspacesClient) DiagnoseThenPoll(ctx context.Context, id WorkspaceId, input DiagnoseWorkspaceParameters) error { + result, err := c.Diagnose(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Diagnose: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Diagnose: %+v", err) + } + + return nil +} + +// preparerForDiagnose prepares the Diagnose request. +func (c WorkspacesClient) preparerForDiagnose(ctx context.Context, id WorkspaceId, input DiagnoseWorkspaceParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/diagnose", id.ID())), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForDiagnose sends the Diagnose request. The method will close the +// http.Response Body if it receives an error. +func (c WorkspacesClient) senderForDiagnose(ctx context.Context, req *http.Request) (future DiagnoseOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_get_autorest.go new file mode 100644 index 000000000000..c16924832e34 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_get_autorest.go @@ -0,0 +1,68 @@ +package workspaces + +import ( + "context" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + Model *Workspace +} + +// Get ... +func (c WorkspacesClient) Get(ctx context.Context, id WorkspaceId) (result GetOperationResponse, err error) { + req, err := c.preparerForGet(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Get", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForGet(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Get", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForGet prepares the Get request. +func (c WorkspacesClient) preparerForGet(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForGet handles the response to the Get request. The method always +// closes the http.Response Body. +func (c WorkspacesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listbyresourcegroup_autorest.go new file mode 100644 index 000000000000..2cae8b108960 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listbyresourcegroup_autorest.go @@ -0,0 +1,216 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + Model *[]Workspace + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupOperationResponse, error) +} + +type ListByResourceGroupCompleteResult struct { + Items []Workspace +} + +func (r ListByResourceGroupOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListByResourceGroupOperationResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ListByResourceGroupOperationOptions struct { + Skip *string +} + +func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions { + return ListByResourceGroupOperationOptions{} +} + +func (o ListByResourceGroupOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListByResourceGroupOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Skip != nil { + out["$skip"] = *o.Skip + } + + return out +} + +// ListByResourceGroup ... +func (c WorkspacesClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (resp ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroup(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListByResourceGroup", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListByResourceGroup(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListByResourceGroup", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListByResourceGroup prepares the ListByResourceGroup request. +func (c WorkspacesClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.MachineLearningServices/workspaces", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListByResourceGroupWithNextLink prepares the ListByResourceGroup request with the given nextLink token. +func (c WorkspacesClient) preparerForListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (c WorkspacesClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { + type page struct { + Values []Workspace `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupOperationResponse, err error) { + req, err := c.preparerForListByResourceGroupWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListByResourceGroup", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListByResourceGroup(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListByResourceGroup", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListByResourceGroupComplete retrieves all of the results into a single object +func (c WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, options, WorkspaceOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c WorkspacesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate WorkspaceOperationPredicate) (resp ListByResourceGroupCompleteResult, err error) { + items := make([]Workspace, 0) + + page, err := c.ListByResourceGroup(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListByResourceGroupCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listbysubscription_autorest.go new file mode 100644 index 000000000000..fc7991eaf8bf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listbysubscription_autorest.go @@ -0,0 +1,216 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + Model *[]Workspace + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (ListBySubscriptionOperationResponse, error) +} + +type ListBySubscriptionCompleteResult struct { + Items []Workspace +} + +func (r ListBySubscriptionOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r ListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp ListBySubscriptionOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +type ListBySubscriptionOperationOptions struct { + Skip *string +} + +func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions { + return ListBySubscriptionOperationOptions{} +} + +func (o ListBySubscriptionOperationOptions) toHeaders() map[string]interface{} { + out := make(map[string]interface{}) + + return out +} + +func (o ListBySubscriptionOperationOptions) toQueryString() map[string]interface{} { + out := make(map[string]interface{}) + + if o.Skip != nil { + out["$skip"] = *o.Skip + } + + return out +} + +// ListBySubscription ... +func (c WorkspacesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (resp ListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForListBySubscription(ctx, id, options) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListBySubscription", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForListBySubscription(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListBySubscription", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForListBySubscription prepares the ListBySubscription request. +func (c WorkspacesClient) preparerForListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + for k, v := range options.toQueryString() { + queryParameters[k] = autorest.Encode("query", v) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithHeaders(options.toHeaders()), + autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.MachineLearningServices/workspaces", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForListBySubscriptionWithNextLink prepares the ListBySubscription request with the given nextLink token. +func (c WorkspacesClient) preparerForListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListBySubscription handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (c WorkspacesClient) responderForListBySubscription(resp *http.Response) (result ListBySubscriptionOperationResponse, err error) { + type page struct { + Values []Workspace `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListBySubscriptionOperationResponse, err error) { + req, err := c.preparerForListBySubscriptionWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListBySubscription", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListBySubscription(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListBySubscription", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// ListBySubscriptionComplete retrieves all of the results into a single object +func (c WorkspacesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, options, WorkspaceOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c WorkspacesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate WorkspaceOperationPredicate) (resp ListBySubscriptionCompleteResult, err error) { + items := make([]Workspace, 0) + + page, err := c.ListBySubscription(ctx, id, options) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := ListBySubscriptionCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listkeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listkeys_autorest.go new file mode 100644 index 000000000000..3c92bf9045f1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listkeys_autorest.go @@ -0,0 +1,69 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListKeysOperationResponse struct { + HttpResponse *http.Response + Model *ListWorkspaceKeysResult +} + +// ListKeys ... +func (c WorkspacesClient) ListKeys(ctx context.Context, id WorkspaceId) (result ListKeysOperationResponse, err error) { + req, err := c.preparerForListKeys(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListKeys", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListKeys", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListKeys(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListKeys", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForListKeys prepares the ListKeys request. +func (c WorkspacesClient) preparerForListKeys(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/listKeys", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListKeys handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (c WorkspacesClient) responderForListKeys(resp *http.Response) (result ListKeysOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listnotebookaccesstoken_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listnotebookaccesstoken_autorest.go new file mode 100644 index 000000000000..96dc4184ec19 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_listnotebookaccesstoken_autorest.go @@ -0,0 +1,69 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListNotebookAccessTokenOperationResponse struct { + HttpResponse *http.Response + Model *NotebookAccessTokenResult +} + +// ListNotebookAccessToken ... +func (c WorkspacesClient) ListNotebookAccessToken(ctx context.Context, id WorkspaceId) (result ListNotebookAccessTokenOperationResponse, err error) { + req, err := c.preparerForListNotebookAccessToken(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListNotebookAccessToken", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListNotebookAccessToken", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForListNotebookAccessToken(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ListNotebookAccessToken", result.HttpResponse, "Failure responding to request") + return + } + + return +} + +// preparerForListNotebookAccessToken prepares the ListNotebookAccessToken request. +func (c WorkspacesClient) preparerForListNotebookAccessToken(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/listNotebookAccessToken", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForListNotebookAccessToken handles the response to the ListNotebookAccessToken request. The method always +// closes the http.Response Body. +func (c WorkspacesClient) responderForListNotebookAccessToken(resp *http.Response) (result ListNotebookAccessTokenOperationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Model), + autorest.ByClosing()) + result.HttpResponse = resp + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_resynckeys_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_resynckeys_autorest.go new file mode 100644 index 000000000000..109fd06a5da6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_resynckeys_autorest.go @@ -0,0 +1,78 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResyncKeysOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// ResyncKeys ... +func (c WorkspacesClient) ResyncKeys(ctx context.Context, id WorkspaceId) (result ResyncKeysOperationResponse, err error) { + req, err := c.preparerForResyncKeys(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ResyncKeys", nil, "Failure preparing request") + return + } + + result, err = c.senderForResyncKeys(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "ResyncKeys", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// ResyncKeysThenPoll performs ResyncKeys then polls until it's completed +func (c WorkspacesClient) ResyncKeysThenPoll(ctx context.Context, id WorkspaceId) error { + result, err := c.ResyncKeys(ctx, id) + if err != nil { + return fmt.Errorf("performing ResyncKeys: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after ResyncKeys: %+v", err) + } + + return nil +} + +// preparerForResyncKeys prepares the ResyncKeys request. +func (c WorkspacesClient) preparerForResyncKeys(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/resyncKeys", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForResyncKeys sends the ResyncKeys request. The method will close the +// http.Response Body if it receives an error. +func (c WorkspacesClient) senderForResyncKeys(ctx context.Context, req *http.Request) (future ResyncKeysOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_update_autorest.go new file mode 100644 index 000000000000..7185c498d564 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_update_autorest.go @@ -0,0 +1,79 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/hashicorp/go-azure-helpers/polling" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + Poller polling.LongRunningPoller + HttpResponse *http.Response +} + +// Update ... +func (c WorkspacesClient) Update(ctx context.Context, id WorkspaceId, input WorkspaceUpdateParameters) (result UpdateOperationResponse, err error) { + req, err := c.preparerForUpdate(ctx, id, input) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = c.senderForUpdate(ctx, req) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "Update", result.HttpResponse, "Failure sending request") + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c WorkspacesClient) UpdateThenPoll(ctx context.Context, id WorkspaceId, input WorkspaceUpdateParameters) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} + +// preparerForUpdate prepares the Update request. +func (c WorkspacesClient) preparerForUpdate(ctx context.Context, id WorkspaceId, input WorkspaceUpdateParameters) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(id.ID()), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// senderForUpdate sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (c WorkspacesClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { + var resp *http.Response + resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + return + } + + future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_workspacefeatureslist_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_workspacefeatureslist_autorest.go new file mode 100644 index 000000000000..a6832f3aecac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/method_workspacefeatureslist_autorest.go @@ -0,0 +1,186 @@ +package workspaces + +import ( + "context" + "fmt" + "net/http" + "net/url" + + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WorkspaceFeaturesListOperationResponse struct { + HttpResponse *http.Response + Model *[]AmlUserFeature + + nextLink *string + nextPageFunc func(ctx context.Context, nextLink string) (WorkspaceFeaturesListOperationResponse, error) +} + +type WorkspaceFeaturesListCompleteResult struct { + Items []AmlUserFeature +} + +func (r WorkspaceFeaturesListOperationResponse) HasMore() bool { + return r.nextLink != nil +} + +func (r WorkspaceFeaturesListOperationResponse) LoadMore(ctx context.Context) (resp WorkspaceFeaturesListOperationResponse, err error) { + if !r.HasMore() { + err = fmt.Errorf("no more pages returned") + return + } + return r.nextPageFunc(ctx, *r.nextLink) +} + +// WorkspaceFeaturesList ... +func (c WorkspacesClient) WorkspaceFeaturesList(ctx context.Context, id WorkspaceId) (resp WorkspaceFeaturesListOperationResponse, err error) { + req, err := c.preparerForWorkspaceFeaturesList(ctx, id) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "WorkspaceFeaturesList", nil, "Failure preparing request") + return + } + + resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "WorkspaceFeaturesList", resp.HttpResponse, "Failure sending request") + return + } + + resp, err = c.responderForWorkspaceFeaturesList(resp.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "WorkspaceFeaturesList", resp.HttpResponse, "Failure responding to request") + return + } + return +} + +// preparerForWorkspaceFeaturesList prepares the WorkspaceFeaturesList request. +func (c WorkspacesClient) preparerForWorkspaceFeaturesList(ctx context.Context, id WorkspaceId) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": defaultApiVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(fmt.Sprintf("%s/features", id.ID())), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// preparerForWorkspaceFeaturesListWithNextLink prepares the WorkspaceFeaturesList request with the given nextLink token. +func (c WorkspacesClient) preparerForWorkspaceFeaturesListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { + uri, err := url.Parse(nextLink) + if err != nil { + return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) + } + queryParameters := map[string]interface{}{} + for k, v := range uri.Query() { + if len(v) == 0 { + continue + } + val := v[0] + val = autorest.Encode("query", val) + queryParameters[k] = val + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsGet(), + autorest.WithBaseURL(c.baseUri), + autorest.WithPath(uri.Path), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// responderForWorkspaceFeaturesList handles the response to the WorkspaceFeaturesList request. The method always +// closes the http.Response Body. +func (c WorkspacesClient) responderForWorkspaceFeaturesList(resp *http.Response) (result WorkspaceFeaturesListOperationResponse, err error) { + type page struct { + Values []AmlUserFeature `json:"value"` + NextLink *string `json:"nextLink"` + } + var respObj page + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&respObj), + autorest.ByClosing()) + result.HttpResponse = resp + result.Model = &respObj.Values + result.nextLink = respObj.NextLink + if respObj.NextLink != nil { + result.nextPageFunc = func(ctx context.Context, nextLink string) (result WorkspaceFeaturesListOperationResponse, err error) { + req, err := c.preparerForWorkspaceFeaturesListWithNextLink(ctx, nextLink) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "WorkspaceFeaturesList", nil, "Failure preparing request") + return + } + + result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "WorkspaceFeaturesList", result.HttpResponse, "Failure sending request") + return + } + + result, err = c.responderForWorkspaceFeaturesList(result.HttpResponse) + if err != nil { + err = autorest.NewErrorWithError(err, "workspaces.WorkspacesClient", "WorkspaceFeaturesList", result.HttpResponse, "Failure responding to request") + return + } + + return + } + } + return +} + +// WorkspaceFeaturesListComplete retrieves all of the results into a single object +func (c WorkspacesClient) WorkspaceFeaturesListComplete(ctx context.Context, id WorkspaceId) (WorkspaceFeaturesListCompleteResult, error) { + return c.WorkspaceFeaturesListCompleteMatchingPredicate(ctx, id, AmlUserFeatureOperationPredicate{}) +} + +// WorkspaceFeaturesListCompleteMatchingPredicate retrieves all of the results and then applied the predicate +func (c WorkspacesClient) WorkspaceFeaturesListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AmlUserFeatureOperationPredicate) (resp WorkspaceFeaturesListCompleteResult, err error) { + items := make([]AmlUserFeature, 0) + + page, err := c.WorkspaceFeaturesList(ctx, id) + if err != nil { + err = fmt.Errorf("loading the initial page: %+v", err) + return + } + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + for page.HasMore() { + page, err = page.LoadMore(ctx) + if err != nil { + err = fmt.Errorf("loading the next page: %+v", err) + return + } + + if page.Model != nil { + for _, v := range *page.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + } + + out := WorkspaceFeaturesListCompleteResult{ + Items: items, + } + return out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_amluserfeature.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_amluserfeature.go new file mode 100644 index 000000000000..ce034ac031c0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_amluserfeature.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AmlUserFeature struct { + Description *string `json:"description,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_cosmosdbsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_cosmosdbsettings.go new file mode 100644 index 000000000000..f1f754cfb7c7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_cosmosdbsettings.go @@ -0,0 +1,8 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CosmosDbSettings struct { + CollectionsThroughput *int64 `json:"collectionsThroughput,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoserequestproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoserequestproperties.go new file mode 100644 index 000000000000..f088a220b35f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoserequestproperties.go @@ -0,0 +1,16 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnoseRequestProperties struct { + ApplicationInsights *map[string]interface{} `json:"applicationInsights,omitempty"` + ContainerRegistry *map[string]interface{} `json:"containerRegistry,omitempty"` + DnsResolution *map[string]interface{} `json:"dnsResolution,omitempty"` + KeyVault *map[string]interface{} `json:"keyVault,omitempty"` + Nsg *map[string]interface{} `json:"nsg,omitempty"` + Others *map[string]interface{} `json:"others,omitempty"` + ResourceLock *map[string]interface{} `json:"resourceLock,omitempty"` + StorageAccount *map[string]interface{} `json:"storageAccount,omitempty"` + Udr *map[string]interface{} `json:"udr,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresponseresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresponseresult.go new file mode 100644 index 000000000000..4573147de8e8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresponseresult.go @@ -0,0 +1,8 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnoseResponseResult struct { + Value *DiagnoseResponseResultValue `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresponseresultvalue.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresponseresultvalue.go new file mode 100644 index 000000000000..bd00a772cc4d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresponseresultvalue.go @@ -0,0 +1,16 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnoseResponseResultValue struct { + ApplicationInsightsResults *[]DiagnoseResult `json:"applicationInsightsResults,omitempty"` + ContainerRegistryResults *[]DiagnoseResult `json:"containerRegistryResults,omitempty"` + DnsResolutionResults *[]DiagnoseResult `json:"dnsResolutionResults,omitempty"` + KeyVaultResults *[]DiagnoseResult `json:"keyVaultResults,omitempty"` + NetworkSecurityRuleResults *[]DiagnoseResult `json:"networkSecurityRuleResults,omitempty"` + OtherResults *[]DiagnoseResult `json:"otherResults,omitempty"` + ResourceLockResults *[]DiagnoseResult `json:"resourceLockResults,omitempty"` + StorageAccountResults *[]DiagnoseResult `json:"storageAccountResults,omitempty"` + UserDefinedRouteResults *[]DiagnoseResult `json:"userDefinedRouteResults,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresult.go new file mode 100644 index 000000000000..7bb1f52bee40 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseresult.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnoseResult struct { + Code *string `json:"code,omitempty"` + Level *DiagnoseResultLevel `json:"level,omitempty"` + Message *string `json:"message,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseworkspaceparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseworkspaceparameters.go new file mode 100644 index 000000000000..e74877f4cbdc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_diagnoseworkspaceparameters.go @@ -0,0 +1,8 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnoseWorkspaceParameters struct { + Value *DiagnoseRequestProperties `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_encryptionkeyvaultproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_encryptionkeyvaultproperties.go new file mode 100644 index 000000000000..eaffc7fe2616 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_encryptionkeyvaultproperties.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionKeyVaultProperties struct { + IdentityClientId *string `json:"identityClientId,omitempty"` + KeyIdentifier string `json:"keyIdentifier"` + KeyVaultArmId string `json:"keyVaultArmId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_encryptionproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_encryptionproperty.go new file mode 100644 index 000000000000..63ca950b6352 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_encryptionproperty.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionProperty struct { + Identity *IdentityForCmk `json:"identity,omitempty"` + KeyVaultProperties EncryptionKeyVaultProperties `json:"keyVaultProperties"` + Status EncryptionStatus `json:"status"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_identityforcmk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_identityforcmk.go new file mode 100644 index 000000000000..288f4d6cdc9f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_identityforcmk.go @@ -0,0 +1,8 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IdentityForCmk struct { + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_listnotebookkeysresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_listnotebookkeysresult.go new file mode 100644 index 000000000000..41ce8e2dae77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_listnotebookkeysresult.go @@ -0,0 +1,9 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListNotebookKeysResult struct { + PrimaryAccessKey *string `json:"primaryAccessKey,omitempty"` + SecondaryAccessKey *string `json:"secondaryAccessKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_listworkspacekeysresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_listworkspacekeysresult.go new file mode 100644 index 000000000000..112c5d97a708 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_listworkspacekeysresult.go @@ -0,0 +1,12 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListWorkspaceKeysResult struct { + AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` + ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` + NotebookAccessKeys *ListNotebookKeysResult `json:"notebookAccessKeys,omitempty"` + UserStorageKey *string `json:"userStorageKey,omitempty"` + UserStorageResourceId *string `json:"userStorageResourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookaccesstokenresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookaccesstokenresult.go new file mode 100644 index 000000000000..8e3b5c6600ec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookaccesstokenresult.go @@ -0,0 +1,15 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NotebookAccessTokenResult struct { + AccessToken *string `json:"accessToken,omitempty"` + ExpiresIn *int64 `json:"expiresIn,omitempty"` + HostName *string `json:"hostName,omitempty"` + NotebookResourceId *string `json:"notebookResourceId,omitempty"` + PublicDns *string `json:"publicDns,omitempty"` + RefreshToken *string `json:"refreshToken,omitempty"` + Scope *string `json:"scope,omitempty"` + TokenType *string `json:"tokenType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookpreparationerror.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookpreparationerror.go new file mode 100644 index 000000000000..623ef1aa15ea --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookpreparationerror.go @@ -0,0 +1,9 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NotebookPreparationError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + StatusCode *int64 `json:"statusCode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookresourceinfo.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookresourceinfo.go new file mode 100644 index 000000000000..d3734f4291b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_notebookresourceinfo.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NotebookResourceInfo struct { + Fqdn *string `json:"fqdn,omitempty"` + NotebookPreparationError *NotebookPreparationError `json:"notebookPreparationError,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_password.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_password.go new file mode 100644 index 000000000000..4556b8a8c694 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_password.go @@ -0,0 +1,9 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Password struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpoint.go new file mode 100644 index 000000000000..1630d268a421 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpoint.go @@ -0,0 +1,9 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpoint struct { + Id *string `json:"id,omitempty"` + SubnetArmId *string `json:"subnetArmId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpointconnection.go new file mode 100644 index 000000000000..e838c643891f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpointconnection.go @@ -0,0 +1,21 @@ +package workspaces + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpointconnectionproperties.go new file mode 100644 index 000000000000..34f25f6a480a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privateendpointconnectionproperties.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState"` + ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privatelinkserviceconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privatelinkserviceconnectionstate.go new file mode 100644 index 000000000000..1bca40e3dfd9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_privatelinkserviceconnectionstate.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkServiceConnectionState struct { + ActionsRequired *string `json:"actionsRequired,omitempty"` + Description *string `json:"description,omitempty"` + Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_registrylistcredentialsresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_registrylistcredentialsresult.go new file mode 100644 index 000000000000..e4f50cf1aff4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_registrylistcredentialsresult.go @@ -0,0 +1,10 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegistryListCredentialsResult struct { + Location *string `json:"location,omitempty"` + Passwords *[]Password `json:"passwords,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_servicemanagedresourcessettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_servicemanagedresourcessettings.go new file mode 100644 index 000000000000..0599d10f00a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_servicemanagedresourcessettings.go @@ -0,0 +1,8 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceManagedResourcesSettings struct { + CosmosDb *CosmosDbSettings `json:"cosmosDb,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sharedprivatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sharedprivatelinkresource.go new file mode 100644 index 000000000000..3fea7381a661 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sharedprivatelinkresource.go @@ -0,0 +1,9 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SharedPrivateLinkResource struct { + Name *string `json:"name,omitempty"` + Properties *SharedPrivateLinkResourceProperty `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sharedprivatelinkresourceproperty.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sharedprivatelinkresourceproperty.go new file mode 100644 index 000000000000..cfa93bf77b24 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sharedprivatelinkresourceproperty.go @@ -0,0 +1,11 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SharedPrivateLinkResourceProperty struct { + GroupId *string `json:"groupId,omitempty"` + PrivateLinkResourceId *string `json:"privateLinkResourceId,omitempty"` + RequestMessage *string `json:"requestMessage,omitempty"` + Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sku.go new file mode 100644 index 000000000000..0463a27a38ee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_sku.go @@ -0,0 +1,12 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Sku struct { + Capacity *int64 `json:"capacity,omitempty"` + Family *string `json:"family,omitempty"` + Name string `json:"name"` + Size *string `json:"size,omitempty"` + Tier *SkuTier `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspace.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspace.go new file mode 100644 index 000000000000..c5cb433065d6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspace.go @@ -0,0 +1,21 @@ +package workspaces + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Workspace struct { + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *WorkspaceProperties `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspaceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspaceproperties.go new file mode 100644 index 000000000000..7bfef4014159 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspaceproperties.go @@ -0,0 +1,32 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WorkspaceProperties struct { + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + ApplicationInsights *string `json:"applicationInsights,omitempty"` + ContainerRegistry *string `json:"containerRegistry,omitempty"` + Description *string `json:"description,omitempty"` + DiscoveryUrl *string `json:"discoveryUrl,omitempty"` + Encryption *EncryptionProperty `json:"encryption,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + KeyVault *string `json:"keyVault,omitempty"` + MlFlowTrackingUri *string `json:"mlFlowTrackingUri,omitempty"` + NotebookInfo *NotebookResourceInfo `json:"notebookInfo,omitempty"` + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + PrivateLinkCount *int64 `json:"privateLinkCount,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` + ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"` + SharedPrivateLinkResources *[]SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty"` + StorageAccount *string `json:"storageAccount,omitempty"` + StorageHnsEnabled *bool `json:"storageHnsEnabled,omitempty"` + TenantId *string `json:"tenantId,omitempty"` + V1LegacyMode *bool `json:"v1LegacyMode,omitempty"` + WorkspaceId *string `json:"workspaceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspacepropertiesupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspacepropertiesupdateparameters.go new file mode 100644 index 000000000000..fe474a96ad66 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspacepropertiesupdateparameters.go @@ -0,0 +1,15 @@ +package workspaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WorkspacePropertiesUpdateParameters struct { + ApplicationInsights *string `json:"applicationInsights,omitempty"` + ContainerRegistry *string `json:"containerRegistry,omitempty"` + Description *string `json:"description,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + PrimaryUserAssignedIdentity *string `json:"primaryUserAssignedIdentity,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + ServiceManagedResourcesSettings *ServiceManagedResourcesSettings `json:"serviceManagedResourcesSettings,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspaceupdateparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspaceupdateparameters.go new file mode 100644 index 000000000000..0322a7064f94 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/model_workspaceupdateparameters.go @@ -0,0 +1,15 @@ +package workspaces + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WorkspaceUpdateParameters struct { + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Properties *WorkspacePropertiesUpdateParameters `json:"properties,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/predicates.go new file mode 100644 index 000000000000..0decd041e97d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/predicates.go @@ -0,0 +1,52 @@ +package workspaces + +type AmlUserFeatureOperationPredicate struct { + Description *string + DisplayName *string + Id *string +} + +func (p AmlUserFeatureOperationPredicate) Matches(input AmlUserFeature) bool { + + if p.Description != nil && (input.Description == nil && *p.Description != *input.Description) { + return false + } + + if p.DisplayName != nil && (input.DisplayName == nil && *p.DisplayName != *input.DisplayName) { + return false + } + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + return true +} + +type WorkspaceOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p WorkspaceOperationPredicate) Matches(input Workspace) bool { + + if p.Id != nil && (input.Id == nil && *p.Id != *input.Id) { + return false + } + + if p.Location != nil && (input.Location == nil && *p.Location != *input.Location) { + return false + } + + if p.Name != nil && (input.Name == nil && *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil && *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/version.go new file mode 100644 index 000000000000..1f21c124c2f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces/version.go @@ -0,0 +1,12 @@ +package workspaces + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-05-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/workspaces/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 565516490fc0..f53283a584f9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -32,7 +32,6 @@ github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2022-02-01/kusto github.com/Azure/azure-sdk-for-go/services/logic/mgmt/2019-05-01/logic github.com/Azure/azure-sdk-for-go/services/logz/mgmt/2020-10-01/logz -github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2021-07-01/machinelearningservices github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2021-05-01/media github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2020-10-01/insights @@ -259,6 +258,8 @@ github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-08-01/scheduled github.com/hashicorp/go-azure-sdk/resource-manager/iotcentral/2021-11-01-preview/apps github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2022-07-07/clusters github.com/hashicorp/go-azure-sdk/resource-manager/loadtestservice/2021-12-01-preview/loadtests +github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/machinelearningcomputes +github.com/hashicorp/go-azure-sdk/resource-manager/machinelearningservices/2022-05-01/workspaces github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2021-05-01/configurationassignments github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2021-05-01/maintenanceconfigurations github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2021-05-01/publicmaintenanceconfigurations diff --git a/website/docs/r/machine_learning_workspace.html.markdown b/website/docs/r/machine_learning_workspace.html.markdown index 56147fa251c0..df7ba2fbf447 100644 --- a/website/docs/r/machine_learning_workspace.html.markdown +++ b/website/docs/r/machine_learning_workspace.html.markdown @@ -364,7 +364,7 @@ The following arguments are supported: * `public_network_access_enabled` - (Optional) Enable public access when this Machine Learning Workspace is behind VNet. -~> **NOTE:** `public_network_access_enabled` is deprecated and will be removed in favour of the property `public_access_behind_virtual_network_enabled` in version 4.0 of the AzureRM Provider. +~> **NOTE:** `public_access_behind_virtual_network_enabled` is deprecated and will be removed in favour of the property `public_network_access_enabled`. * `image_build_compute_name` - (Optional) The compute name for image build of the Machine Learning Workspace. @@ -376,6 +376,8 @@ The following arguments are supported: * `primary_user_assigned_identity` - (Optional) The user assigned identity id that represents the workspace identity. +* `v1_legacy_mode_enabled` - (Optional) Enable V1 API features, enabling `v1_legacy_mode` may prevent you from using features provided by the v2 API. Defaults to `false`. + * `sku_name` - (Optional) SKU/edition of the Machine Learning Workspace, possible values are `Basic`. Defaults to `Basic`. * `tags` - (Optional) A mapping of tags to assign to the resource.