From 8e02bcf124f239ae423ddbd4a148d405a9bb5eaa Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 24 Jun 2020 09:01:43 +0000 Subject: [PATCH] Generated from 3124c890a6cb5f7bec426ce3a51de230ce6d50cd Fixing LinterDiff --- .../databricks/databricksapi/interfaces.go | 11 + .../mgmt/2018-04-01/databricks/models.go | 486 ++++++++++++++++-- .../mgmt/2018-04-01/databricks/operations.go | 1 - .../mgmt/2018-04-01/databricks/version.go | 2 +- .../mgmt/2018-04-01/databricks/vnetpeering.go | 439 ++++++++++++++++ .../mgmt/2018-04-01/databricks/workspaces.go | 30 +- 6 files changed, 904 insertions(+), 65 deletions(-) create mode 100644 services/databricks/mgmt/2018-04-01/databricks/vnetpeering.go diff --git a/services/databricks/mgmt/2018-04-01/databricks/databricksapi/interfaces.go b/services/databricks/mgmt/2018-04-01/databricks/databricksapi/interfaces.go index cf94c13c3106..a095ffff4e86 100644 --- a/services/databricks/mgmt/2018-04-01/databricks/databricksapi/interfaces.go +++ b/services/databricks/mgmt/2018-04-01/databricks/databricksapi/interfaces.go @@ -36,6 +36,17 @@ type WorkspacesClientAPI interface { var _ WorkspacesClientAPI = (*databricks.WorkspacesClient)(nil) +// VNetPeeringClientAPI contains the set of methods on the VNetPeeringClient type. +type VNetPeeringClientAPI interface { + CreateOrUpdate(ctx context.Context, virtualNetworkPeeringParameters databricks.VirtualNetworkPeering, resourceGroupName string, workspaceName string, peeringName string) (result databricks.VNetPeeringCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, peeringName string) (result databricks.VNetPeeringDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, peeringName string) (result databricks.VirtualNetworkPeering, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result databricks.VirtualNetworkPeeringListPage, err error) + ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result databricks.VirtualNetworkPeeringListIterator, err error) +} + +var _ VNetPeeringClientAPI = (*databricks.VNetPeeringClient)(nil) + // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { List(ctx context.Context) (result databricks.OperationListResultPage, err error) diff --git a/services/databricks/mgmt/2018-04-01/databricks/models.go b/services/databricks/mgmt/2018-04-01/databricks/models.go index 590f03bb1d5b..34c9d4934cab 100644 --- a/services/databricks/mgmt/2018-04-01/databricks/models.go +++ b/services/databricks/mgmt/2018-04-01/databricks/models.go @@ -22,6 +22,7 @@ import ( "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" "github.com/satori/go.uuid" @@ -48,37 +49,117 @@ func PossibleCustomParameterTypeValues() []CustomParameterType { return []CustomParameterType{Bool, Object, String} } -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string +// KeySource enumerates the values for key source. +type KeySource string + +const ( + // Default ... + Default KeySource = "Default" + // MicrosoftKeyvault ... + MicrosoftKeyvault KeySource = "Microsoft.Keyvault" +) + +// PossibleKeySourceValues returns an array of possible values for the KeySource const type. +func PossibleKeySourceValues() []KeySource { + return []KeySource{Default, MicrosoftKeyvault} +} + +// PeeringProvisioningState enumerates the values for peering provisioning state. +type PeeringProvisioningState string const ( - // Accepted ... - Accepted ProvisioningState = "Accepted" - // Canceled ... - Canceled ProvisioningState = "Canceled" - // Created ... - Created ProvisioningState = "Created" - // Creating ... - Creating ProvisioningState = "Creating" - // Deleted ... - Deleted ProvisioningState = "Deleted" // Deleting ... - Deleting ProvisioningState = "Deleting" + Deleting PeeringProvisioningState = "Deleting" // Failed ... - Failed ProvisioningState = "Failed" - // Ready ... - Ready ProvisioningState = "Ready" - // Running ... - Running ProvisioningState = "Running" + Failed PeeringProvisioningState = "Failed" // Succeeded ... - Succeeded ProvisioningState = "Succeeded" + Succeeded PeeringProvisioningState = "Succeeded" // Updating ... - Updating ProvisioningState = "Updating" + Updating PeeringProvisioningState = "Updating" +) + +// PossiblePeeringProvisioningStateValues returns an array of possible values for the PeeringProvisioningState const type. +func PossiblePeeringProvisioningStateValues() []PeeringProvisioningState { + return []PeeringProvisioningState{Deleting, Failed, Succeeded, Updating} +} + +// PeeringState enumerates the values for peering state. +type PeeringState string + +const ( + // Connected ... + Connected PeeringState = "Connected" + // Disconnected ... + Disconnected PeeringState = "Disconnected" + // Initiated ... + Initiated PeeringState = "Initiated" +) + +// PossiblePeeringStateValues returns an array of possible values for the PeeringState const type. +func PossiblePeeringStateValues() []PeeringState { + return []PeeringState{Connected, Disconnected, Initiated} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateAccepted ... + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreated ... + ProvisioningStateCreated ProvisioningState = "Created" + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleted ... + ProvisioningStateDeleted ProvisioningState = "Deleted" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateReady ... + ProvisioningStateReady ProvisioningState = "Ready" + // ProvisioningStateRunning ... + ProvisioningStateRunning ProvisioningState = "Running" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Accepted, Canceled, Created, Creating, Deleted, Deleting, Failed, Ready, Running, Succeeded, Updating} + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateCreated, ProvisioningStateCreating, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateReady, ProvisioningStateRunning, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the +// virtual network. +type AddressSpace struct { + // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` +} + +// CreatedBy provides details of the entity that created/updated the workspace. +type CreatedBy struct { + // Oid - READ-ONLY; The Object ID that created the workspace. + Oid *uuid.UUID `json:"oid,omitempty"` + // Puid - READ-ONLY; The Personal Object ID corresponding to the object ID above + Puid *string `json:"puid,omitempty"` + // ApplicationID - READ-ONLY; The application ID of the application that initiated the creation of the workspace. For example, Azure Portal. + ApplicationID *uuid.UUID `json:"applicationId,omitempty"` +} + +// Encryption the object that contains details of encryption used on the workspace. +type Encryption struct { + // KeySource - The encryption keySource (provider). Possible values (case-insensitive): Default, Microsoft.Keyvault. Possible values include: 'Default', 'MicrosoftKeyvault' + KeySource KeySource `json:"keySource,omitempty"` + // KeyName - The name of KeyVault key. + KeyName *string `json:"KeyName,omitempty"` + // KeyVersion - The version of KeyVault key. + KeyVersion *string `json:"keyversion,omitempty"` + // KeyVaultURI - The Uri of KeyVault. + KeyVaultURI *string `json:"keyvaulturi,omitempty"` } // ErrorDetail ... @@ -109,6 +190,16 @@ type ErrorResponse struct { Error *ErrorInfo `json:"error,omitempty"` } +// ManagedIdentityConfiguration the Managed Identity details for storage account. +type ManagedIdentityConfiguration struct { + // PrincipalID - READ-ONLY; The objectId of the Managed Identity that is linked to the Managed Storage account. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant Id where the Managed Identity is created. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + // Type - READ-ONLY; The type of Identity created. It can be either SystemAssigned or UserAssigned. + Type *string `json:"type,omitempty"` +} + // Operation REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -318,6 +409,317 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// VirtualNetworkPeering peerings in a VirtualNetwork resource +type VirtualNetworkPeering struct { + autorest.Response `json:"-"` + // VirtualNetworkPeeringPropertiesFormat - List of properties for vNet Peering + *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` + // Name - READ-ONLY; Name of the virtual network peering resource + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; type of the virtual network peering resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkPeering. +func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnp.VirtualNetworkPeeringPropertiesFormat != nil { + objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. +func (vnp *VirtualNetworkPeering) 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 virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat + err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat) + if err != nil { + return err + } + vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vnp.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vnp.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vnp.Type = &typeVar + } + } + } + + return nil +} + +// VirtualNetworkPeeringList gets all virtual network peerings under a workspace. +type VirtualNetworkPeeringList struct { + autorest.Response `json:"-"` + // Value - List of virtual network peerings on workspace. + Value *[]VirtualNetworkPeering `json:"value,omitempty"` + // NextLink - URL to get the next set of virtual network peering list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualNetworkPeeringListIterator provides access to a complete listing of VirtualNetworkPeering values. +type VirtualNetworkPeeringListIterator struct { + i int + page VirtualNetworkPeeringListPage +} + +// 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 *VirtualNetworkPeeringListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListIterator.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 *VirtualNetworkPeeringListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualNetworkPeeringListIterator) 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 VirtualNetworkPeeringListIterator) Response() VirtualNetworkPeeringList { + 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 VirtualNetworkPeeringListIterator) Value() VirtualNetworkPeering { + if !iter.page.NotDone() { + return VirtualNetworkPeering{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualNetworkPeeringListIterator type. +func NewVirtualNetworkPeeringListIterator(page VirtualNetworkPeeringListPage) VirtualNetworkPeeringListIterator { + return VirtualNetworkPeeringListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vnpl VirtualNetworkPeeringList) IsEmpty() bool { + return vnpl.Value == nil || len(*vnpl.Value) == 0 +} + +// virtualNetworkPeeringListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vnpl VirtualNetworkPeeringList) virtualNetworkPeeringListPreparer(ctx context.Context) (*http.Request, error) { + if vnpl.NextLink == nil || len(to.String(vnpl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vnpl.NextLink))) +} + +// VirtualNetworkPeeringListPage contains a page of VirtualNetworkPeering values. +type VirtualNetworkPeeringListPage struct { + fn func(context.Context, VirtualNetworkPeeringList) (VirtualNetworkPeeringList, error) + vnpl VirtualNetworkPeeringList +} + +// 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 *VirtualNetworkPeeringListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.vnpl) + if err != nil { + return err + } + page.vnpl = next + 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 *VirtualNetworkPeeringListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualNetworkPeeringListPage) NotDone() bool { + return !page.vnpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualNetworkPeeringListPage) Response() VirtualNetworkPeeringList { + return page.vnpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualNetworkPeeringListPage) Values() []VirtualNetworkPeering { + if page.vnpl.IsEmpty() { + return nil + } + return *page.vnpl.Value +} + +// Creates a new instance of the VirtualNetworkPeeringListPage type. +func NewVirtualNetworkPeeringListPage(getNextPage func(context.Context, VirtualNetworkPeeringList) (VirtualNetworkPeeringList, error)) VirtualNetworkPeeringListPage { + return VirtualNetworkPeeringListPage{fn: getNextPage} +} + +// VirtualNetworkPeeringPropertiesFormat properties of the virtual network peering. +type VirtualNetworkPeeringPropertiesFormat struct { + // AllowVirtualNetworkAccess - Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. + AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` + // AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. + AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` + // AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network. + AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` + // UseRemoteGateways - If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. + UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` + // DatabricksVirtualNetwork - The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). + DatabricksVirtualNetwork *VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork `json:"databricksVirtualNetwork,omitempty"` + // DatabricksAddressSpace - The reference to the databricks virtual network address space. + DatabricksAddressSpace *AddressSpace `json:"databricksAddressSpace,omitempty"` + // RemoteVirtualNetwork - The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). + RemoteVirtualNetwork *VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork `json:"remoteVirtualNetwork,omitempty"` + // RemoteAddressSpace - The reference to the remote virtual network address space. + RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` + // PeeringState - READ-ONLY; The status of the virtual network peering. Possible values include: 'Initiated', 'Connected', 'Disconnected' + PeeringState PeeringState `json:"peeringState,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the virtual network peering resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState PeeringProvisioningState `json:"provisioningState,omitempty"` +} + +// VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork the remote virtual network should be in +// the same region. See here to learn more +// (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). +type VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork struct { + // ID - The Id of the databricks virtual network. + ID *string `json:"id,omitempty"` +} + +// VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork the remote virtual network should be in the +// same region. See here to learn more +// (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering). +type VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork struct { + // ID - The Id of the remote virtual network. + ID *string `json:"id,omitempty"` +} + +// VNetPeeringCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VNetPeeringCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VNetPeeringCreateOrUpdateFuture) Result(client VNetPeeringClient) (vnp VirtualNetworkPeering, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databricks.VNetPeeringCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent { + vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request") + } + } + return +} + +// VNetPeeringDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VNetPeeringDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VNetPeeringDeleteFuture) Result(client VNetPeeringClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databricks.VNetPeeringDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // Workspace information about workspace. type Workspace struct { autorest.Response `json:"-"` @@ -451,8 +853,6 @@ type WorkspaceCustomObjectParameter struct { // WorkspaceCustomParameters custom Parameters used for Cluster Creation. type WorkspaceCustomParameters struct { - // AmlWorkspaceID - The Workspace ID of an Azure Machine Learning Workspace - AmlWorkspaceID *WorkspaceCustomStringParameter `json:"amlWorkspaceId,omitempty"` // CustomVirtualNetworkID - The ID of a Virtual Network where this Databricks Cluster should be created CustomVirtualNetworkID *WorkspaceCustomStringParameter `json:"customVirtualNetworkId,omitempty"` // CustomPublicSubnetName - The name of a Public Subnet within the Virtual Network @@ -461,20 +861,10 @@ type WorkspaceCustomParameters struct { CustomPrivateSubnetName *WorkspaceCustomStringParameter `json:"customPrivateSubnetName,omitempty"` // EnableNoPublicIP - Should the Public IP be Disabled? EnableNoPublicIP *WorkspaceCustomBooleanParameter `json:"enableNoPublicIp,omitempty"` - // LoadBalancerBackendPoolName - The name of a Backend Address Pool within an Azure Load Balancer - LoadBalancerBackendPoolName *WorkspaceCustomStringParameter `json:"loadBalancerBackendPoolName,omitempty"` - // LoadBalancerID - The Resource ID of an Azure Load Balancer - LoadBalancerID *WorkspaceCustomStringParameter `json:"loadBalancerId,omitempty"` - // RelayNamespaceName - The name of an Azure Relay Namespace - RelayNamespaceName *WorkspaceCustomStringParameter `json:"relayNamespaceName,omitempty"` - // StorageAccountName - The name which should be used for the Storage Account - StorageAccountName *WorkspaceCustomStringParameter `json:"storageAccountName,omitempty"` - // StorageAccountSkuName - The SKU which should be used for this Storage Account - StorageAccountSkuName *WorkspaceCustomStringParameter `json:"storageAccountSkuName,omitempty"` - // ResourceTags - A map of Tags which should be applied to the resources used by this Databricks Cluster. - ResourceTags *WorkspaceCustomObjectParameter `json:"resourceTags,omitempty"` - // VnetAddressPrefix - The first 2 octets of the virtual network /16 address range (e.g., '10.139' for the address range 10.139.0.0/16). - VnetAddressPrefix *WorkspaceCustomStringParameter `json:"vnetAddressPrefix,omitempty"` + // PrepareEncryption - Prepare the workspace for encryption. Enables the Managed Identity for managed storage account. + PrepareEncryption *WorkspaceCustomBooleanParameter `json:"prepareEncryption,omitempty"` + // Encryption - Contains the encryption details for Customer-Managed Key (CMK) enabled workspace. + Encryption *WorkspaceEncryptionParameter `json:"encryption,omitempty"` } // WorkspaceCustomStringParameter the Value. @@ -485,6 +875,14 @@ type WorkspaceCustomStringParameter struct { Value *string `json:"value,omitempty"` } +// WorkspaceEncryptionParameter the object that contains details of encryption used on the workspace. +type WorkspaceEncryptionParameter struct { + // Type - The type of variable that this is. Possible values include: 'Bool', 'Object', 'String' + Type CustomParameterType `json:"type,omitempty"` + // Value - The value which should be used for this field. + Value *Encryption `json:"value,omitempty"` +} + // WorkspaceListResult list of workspaces. type WorkspaceListResult struct { autorest.Response `json:"-"` @@ -637,12 +1035,24 @@ type WorkspaceProperties struct { ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"` // Parameters - The workspace's custom parameters. Parameters *WorkspaceCustomParameters `json:"parameters,omitempty"` - // ProvisioningState - READ-ONLY; The workspace provisioning state. Possible values include: 'Accepted', 'Running', 'Ready', 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' + // ProvisioningState - READ-ONLY; The workspace provisioning state. Possible values include: 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateReady', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // UIDefinitionURI - The blob URI where the UI definition file is located. UIDefinitionURI *string `json:"uiDefinitionUri,omitempty"` // Authorizations - The workspace provider authorizations. Authorizations *[]WorkspaceProviderAuthorization `json:"authorizations,omitempty"` + // CreatedBy - Indicates the Object ID, PUID and Application ID of entity that created the workspace. + CreatedBy *CreatedBy `json:"createdBy,omitempty"` + // UpdatedBy - Indicates the Object ID, PUID and Application ID of entity that last updated the workspace. + UpdatedBy *CreatedBy `json:"updatedBy,omitempty"` + // CreatedDateTime - Specifies the date and time when the workspace is created. + CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` + // WorkspaceID - READ-ONLY; The unique identifier of the databricks workspace in databricks control plane. + WorkspaceID *string `json:"workspaceId,omitempty"` + // WorkspaceURL - READ-ONLY; The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net' + WorkspaceURL *string `json:"workspaceUrl,omitempty"` + // StorageAccountIdentity - The details of Managed Identity of Storage Account + StorageAccountIdentity *ManagedIdentityConfiguration `json:"storageAccountIdentity,omitempty"` } // WorkspaceProviderAuthorization the workspace provider authorization. diff --git a/services/databricks/mgmt/2018-04-01/databricks/operations.go b/services/databricks/mgmt/2018-04-01/databricks/operations.go index b0ab56d8d1c9..472fddc4adbb 100644 --- a/services/databricks/mgmt/2018-04-01/databricks/operations.go +++ b/services/databricks/mgmt/2018-04-01/databricks/operations.go @@ -101,7 +101,6 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/databricks/mgmt/2018-04-01/databricks/version.go b/services/databricks/mgmt/2018-04-01/databricks/version.go index 5bd9ba055455..9a7ea4c3b5dd 100644 --- a/services/databricks/mgmt/2018-04-01/databricks/version.go +++ b/services/databricks/mgmt/2018-04-01/databricks/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " databricks/2018-04-01" + return "Azure-SDK-For-Go/" + Version() + " databricks/2018-04-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/databricks/mgmt/2018-04-01/databricks/vnetpeering.go b/services/databricks/mgmt/2018-04-01/databricks/vnetpeering.go new file mode 100644 index 000000000000..286a6c9f87db --- /dev/null +++ b/services/databricks/mgmt/2018-04-01/databricks/vnetpeering.go @@ -0,0 +1,439 @@ +package databricks + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// VNetPeeringClient is the ARM Databricks +type VNetPeeringClient struct { + BaseClient +} + +// NewVNetPeeringClient creates an instance of the VNetPeeringClient client. +func NewVNetPeeringClient(subscriptionID string) VNetPeeringClient { + return NewVNetPeeringClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVNetPeeringClientWithBaseURI creates an instance of the VNetPeeringClient 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 NewVNetPeeringClientWithBaseURI(baseURI string, subscriptionID string) VNetPeeringClient { + return VNetPeeringClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates vNet Peering for workspace. +// Parameters: +// virtualNetworkPeeringParameters - parameters supplied to the create workspace vNet Peering. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// peeringName - the name of the workspace vNet peering. +func (client VNetPeeringClient) CreateOrUpdate(ctx context.Context, virtualNetworkPeeringParameters VirtualNetworkPeering, resourceGroupName string, workspaceName string, peeringName string) (result VNetPeeringCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VNetPeeringClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: virtualNetworkPeeringParameters, + Constraints: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteVirtualNetwork", Name: validation.Null, Rule: true, 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("databricks.VNetPeeringClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, virtualNetworkPeeringParameters, resourceGroupName, workspaceName, peeringName) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VNetPeeringClient) CreateOrUpdatePreparer(ctx context.Context, virtualNetworkPeeringParameters VirtualNetworkPeering, resourceGroupName string, workspaceName string, peeringName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2018-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + virtualNetworkPeeringParameters.Name = nil + virtualNetworkPeeringParameters.ID = nil + virtualNetworkPeeringParameters.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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", pathParameters), + autorest.WithJSON(virtualNetworkPeeringParameters), + 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 VNetPeeringClient) CreateOrUpdateSender(req *http.Request) (future VNetPeeringCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VNetPeeringClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkPeering, 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 the workspace vNetPeering. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// peeringName - the name of the workspace vNet peering. +func (client VNetPeeringClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, peeringName string) (result VNetPeeringDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VNetPeeringClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("databricks.VNetPeeringClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, peeringName) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VNetPeeringClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, peeringName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2018-04-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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", 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 VNetPeeringClient) DeleteSender(req *http.Request) (future VNetPeeringDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VNetPeeringClient) 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 +} + +// Get gets the workspace vNet Peering. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// peeringName - the name of the workspace vNet peering. +func (client VNetPeeringClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, peeringName string) (result VirtualNetworkPeering, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VNetPeeringClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("databricks.VNetPeeringClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, peeringName) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VNetPeeringClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, peeringName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2018-04-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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings/{peeringName}", 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 VNetPeeringClient) 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 VNetPeeringClient) GetResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace lists the workspace vNet Peerings. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client VNetPeeringClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result VirtualNetworkPeeringListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VNetPeeringClient.ListByWorkspace") + defer func() { + sc := -1 + if result.vnpl.Response.Response != nil { + sc = result.vnpl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("databricks.VNetPeeringClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.vnpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.vnpl, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client VNetPeeringClient) ListByWorkspacePreparer(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 = "2018-04-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.Databricks/workspaces/{workspaceName}/virtualNetworkPeerings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client VNetPeeringClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client VNetPeeringClient) ListByWorkspaceResponder(resp *http.Response) (result VirtualNetworkPeeringList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client VNetPeeringClient) listByWorkspaceNextResults(ctx context.Context, lastResults VirtualNetworkPeeringList) (result VirtualNetworkPeeringList, err error) { + req, err := lastResults.virtualNetworkPeeringListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "databricks.VNetPeeringClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client VNetPeeringClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result VirtualNetworkPeeringListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VNetPeeringClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} diff --git a/services/databricks/mgmt/2018-04-01/databricks/workspaces.go b/services/databricks/mgmt/2018-04-01/databricks/workspaces.go index 61c7727aed17..dd0736681c50 100644 --- a/services/databricks/mgmt/2018-04-01/databricks/workspaces.go +++ b/services/databricks/mgmt/2018-04-01/databricks/workspaces.go @@ -63,30 +63,16 @@ func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, parameters Wo Constraints: []validation.Constraint{{Target: "parameters.WorkspaceProperties", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.ManagedResourceGroupID", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.WorkspaceProperties.Parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.AmlWorkspaceID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.AmlWorkspaceID.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.CustomVirtualNetworkID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomVirtualNetworkID.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomVirtualNetworkID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomVirtualNetworkID.Value", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.WorkspaceProperties.Parameters.CustomPublicSubnetName", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomPublicSubnetName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.WorkspaceProperties.Parameters.CustomPrivateSubnetName", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.CustomPrivateSubnetName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.WorkspaceProperties.Parameters.EnableNoPublicIP", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.EnableNoPublicIP.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerBackendPoolName", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerBackendPoolName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerID", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.LoadBalancerID.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.RelayNamespaceName", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.RelayNamespaceName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.StorageAccountName", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.StorageAccountName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.StorageAccountSkuName", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.StorageAccountSkuName.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.ResourceTags", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.ResourceTags.Value", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.WorkspaceProperties.Parameters.VnetAddressPrefix", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.VnetAddressPrefix.Value", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.WorkspaceProperties.Parameters.PrepareEncryption", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Parameters.PrepareEncryption.Value", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}, {Target: "parameters.Sku", Name: validation.Null, Rule: false, @@ -156,7 +142,6 @@ func (client WorkspacesClient) CreateOrUpdateSender(req *http.Request) (future W func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -243,7 +228,6 @@ func (client WorkspacesClient) DeleteSender(req *http.Request) (future Workspace func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -329,8 +313,7 @@ func (client WorkspacesClient) GetSender(req *http.Request) (*http.Response, err func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -412,7 +395,6 @@ func (client WorkspacesClient) ListByResourceGroupSender(req *http.Request) (*ht func (client WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -521,7 +503,6 @@ func (client WorkspacesClient) ListBySubscriptionSender(req *http.Request) (*htt func (client WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -648,7 +629,6 @@ func (client WorkspacesClient) UpdateSender(req *http.Request) (future Workspace func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing())