diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 2dd60127b..2efdf11e6 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -universe:/Users/hector.castejon/universe \ No newline at end of file +fc26589775a1c48b14211cd11b6903d1b4ed071c \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index 900a929db..91e6341eb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,6 +13,7 @@ experimental/mocks/service/catalog/mock_account_storage_credentials_interface.go experimental/mocks/service/catalog/mock_artifact_allowlists_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_catalogs_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_connections_interface.go linguist-generated=true +experimental/mocks/service/catalog/mock_endpoints_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_external_locations_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_functions_interface.go linguist-generated=true experimental/mocks/service/catalog/mock_grants_interface.go linguist-generated=true diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index b0aeb32e1..d5736f5d4 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -104,7 +104,6 @@ func NewMockWorkspaceClient(t interface { Secrets: workspace.NewMockSecretsInterface(t), ServicePrincipals: iam.NewMockServicePrincipalsInterface(t), ServingEndpoints: serving.NewMockServingEndpointsInterface(t), - ServingEndpointsDataPlane: serving.NewMockServingEndpointsDataPlaneInterface(t), Settings: settings.NewMockSettingsInterface(t), Shares: sharing.NewMockSharesInterface(t), StatementExecution: sql.NewMockStatementExecutionInterface(t), @@ -705,14 +704,6 @@ func (m *MockWorkspaceClient) GetMockServingEndpointsAPI() *serving.MockServingE return api } -func (m *MockWorkspaceClient) GetMockServingEndpointsDataPlaneAPI() *serving.MockServingEndpointsDataPlaneInterface { - api, ok := m.WorkspaceClient.ServingEndpointsDataPlane.(*serving.MockServingEndpointsDataPlaneInterface) - if !ok { - panic(fmt.Sprintf("expected ServingEndpointsDataPlane to be *serving.MockServingEndpointsDataPlaneInterface, actual was %T", m.WorkspaceClient.ServingEndpointsDataPlane)) - } - return api -} - func (m *MockWorkspaceClient) GetMockSettingsAPI() *settings.MockSettingsInterface { api, ok := m.WorkspaceClient.Settings.(*settings.MockSettingsInterface) if !ok { diff --git a/internal/catalog_test.go b/internal/catalog_test.go index a8aa09c09..7b7e9a9ee 100644 --- a/internal/catalog_test.go +++ b/internal/catalog_test.go @@ -364,7 +364,7 @@ func TestUcAccCatalogWorkspaceBindings(t *testing.T) { _, err = w.Catalogs.Update(ctx, catalog.UpdateCatalog{ Name: created.Name, - IsolationMode: catalog.IsolationModeIsolated, + IsolationMode: catalog.IsolationModeIsolationModeIsolated, }) require.NoError(t, err) diff --git a/service/catalog/catalogs_usage_test.go b/service/catalog/catalogs_usage_test.go index d1725a701..5e984667c 100755 --- a/service/catalog/catalogs_usage_test.go +++ b/service/catalog/catalogs_usage_test.go @@ -273,8 +273,7 @@ func ExampleCatalogsAPI_Update_catalogWorkspaceBindings() { logger.Infof(ctx, "found %v", created) _, err = w.Catalogs.Update(ctx, catalog.UpdateCatalog{ - Name: created.Name, - IsolationMode: catalog.IsolationModeIsolated, + Name: created.Name, }) if err != nil { panic(err) diff --git a/service/pkg.go b/service/pkg.go index bde180e88..e5688291b 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -182,8 +182,6 @@ // // - [serving.ServingEndpointsAPI]: The Serving Endpoints API allows you to create, update, and delete model serving endpoints. // -// - [serving.ServingEndpointsDataPlaneAPI]: Serving endpoints DataPlane provides a set of operations to interact with DataPlane endpoints for Serving endpoints service. -// // - [settings.SettingsAPI]: Workspace Settings API allows users to manage settings at the workspace level. // // - [settings.AccountSettingsAPI]: Accounts Settings API allows users to manage settings at the account level. @@ -350,7 +348,6 @@ var ( _ *iam.ServicePrincipalsAPI = nil _ *iam.AccountServicePrincipalsAPI = nil _ *serving.ServingEndpointsAPI = nil - _ *serving.ServingEndpointsDataPlaneAPI = nil _ *settings.SettingsAPI = nil _ *settings.AccountSettingsAPI = nil _ *sharing.SharesAPI = nil diff --git a/service/serving/api.go b/service/serving/api.go index 892e479e9..64e30bc0d 100755 --- a/service/serving/api.go +++ b/service/serving/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Apps, Serving Endpoints, Serving Endpoints Data Plane, etc. +// These APIs allow you to manage Apps, Serving Endpoints, etc. package serving import ( @@ -1103,55 +1103,3 @@ func (a *ServingEndpointsAPI) UpdateConfigAndWait(ctx context.Context, endpointC func (a *ServingEndpointsAPI) UpdatePermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) { return a.impl.UpdatePermissions(ctx, request) } - -type ServingEndpointsDataPlaneInterface interface { - // WithImpl could be used to override low-level API implementations for unit - // testing purposes with [github.com/golang/mock] or other mocking frameworks. - // Deprecated: use MockServingEndpointsDataPlaneInterface instead. - WithImpl(impl ServingEndpointsDataPlaneService) ServingEndpointsDataPlaneInterface - - // Impl returns low-level ServingEndpointsDataPlane API implementation - // Deprecated: use MockServingEndpointsDataPlaneInterface instead. - Impl() ServingEndpointsDataPlaneService - - // Query a serving endpoint. - Query(ctx context.Context, request QueryEndpointInput) (*QueryEndpointResponse, error) -} - -func NewServingEndpointsDataPlane(client *client.DatabricksClient, - controlPlane *ServingEndpointsAPI, -) *ServingEndpointsDataPlaneAPI { - return &ServingEndpointsDataPlaneAPI{ - impl: &servingEndpointsDataPlaneImpl{ - client: client, - controlPlane: controlPlane, - }, - } -} - -// Serving endpoints DataPlane provides a set of operations to interact with -// DataPlane endpoints for Serving endpoints service. -type ServingEndpointsDataPlaneAPI struct { - // impl contains low-level REST API interface, that could be overridden - // through WithImpl(ServingEndpointsDataPlaneService) - impl ServingEndpointsDataPlaneService -} - -// WithImpl could be used to override low-level API implementations for unit -// testing purposes with [github.com/golang/mock] or other mocking frameworks. -// Deprecated: use MockServingEndpointsDataPlaneInterface instead. -func (a *ServingEndpointsDataPlaneAPI) WithImpl(impl ServingEndpointsDataPlaneService) ServingEndpointsDataPlaneInterface { - a.impl = impl - return a -} - -// Impl returns low-level ServingEndpointsDataPlane API implementation -// Deprecated: use MockServingEndpointsDataPlaneInterface instead. -func (a *ServingEndpointsDataPlaneAPI) Impl() ServingEndpointsDataPlaneService { - return a.impl -} - -// Query a serving endpoint. -func (a *ServingEndpointsDataPlaneAPI) Query(ctx context.Context, request QueryEndpointInput) (*QueryEndpointResponse, error) { - return a.impl.Query(ctx, request) -} diff --git a/service/serving/impl.go b/service/serving/impl.go index 949ebd875..c267d2002 100755 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -4,15 +4,10 @@ package serving import ( "context" - "errors" "fmt" "net/http" "github.com/databricks/databricks-sdk-go/client" - "github.com/databricks/databricks-sdk-go/httpclient" - goauth "golang.org/x/oauth2" - - "github.com/databricks/databricks-sdk-go/service/oauth2" ) // unexported type that holds implementations of just Apps API methods @@ -269,51 +264,3 @@ func (a *servingEndpointsImpl) UpdatePermissions(ctx context.Context, request Se err := a.client.Do(ctx, http.MethodPatch, path, headers, request, &servingEndpointPermissions) return &servingEndpointPermissions, err } - -// unexported type that holds implementations of just ServingEndpointsDataPlane API methods -type servingEndpointsDataPlaneImpl struct { - oauth2.DataPlaneHelper - controlPlane *ServingEndpointsAPI - client *client.DatabricksClient -} - -func (a *servingEndpointsDataPlaneImpl) Query(ctx context.Context, request QueryEndpointInput) (*QueryEndpointResponse, error) { - getRequest := GetServingEndpointRequest{ - Name: request.Name, - } - token, err := a.client.Config.GetToken() - if err != nil { - return nil, err - } - infoGetter := func() (*oauth2.DataPlaneInfo, error) { - response, err := a.controlPlane.Get(ctx, getRequest) - if err != nil { - return nil, err - } - if response.DataPlaneInfo == nil { - return nil, errors.New("resource does not support direct Data Plane access") - } - return response.DataPlaneInfo.QueryInfo, nil - } - refresh := func(info *oauth2.DataPlaneInfo) (*goauth.Token, error) { - return a.client.GetOAuthToken(ctx, info.AuthorizationDetails, token) - } - getParams := []string{ - request.Name, - } - endpointUrl, dataPlaneToken, err := a.GetDataPlaneDetails("Query", getParams, refresh, infoGetter) - if err != nil { - return nil, err - } - headers := make(map[string]string) - headers["Accept"] = "application/json" - headers["Content-Type"] = "application/json" - opts := []httpclient.DoOption{} - opts = append(opts, httpclient.WithRequestHeaders(headers)) - var queryEndpointResponse QueryEndpointResponse - opts = append(opts, httpclient.WithRequestData(request)) - opts = append(opts, httpclient.WithResponseUnmarshal(&queryEndpointResponse)) - opts = append(opts, httpclient.WithToken(dataPlaneToken)) - err = a.client.ApiClient().Do(ctx, http.MethodPost, endpointUrl, opts...) - return &queryEndpointResponse, err -} diff --git a/service/serving/interface.go b/service/serving/interface.go index 54633b661..61350c543 100755 --- a/service/serving/interface.go +++ b/service/serving/interface.go @@ -167,11 +167,3 @@ type ServingEndpointsService interface { // inherit permissions from their root object. UpdatePermissions(ctx context.Context, request ServingEndpointPermissionsRequest) (*ServingEndpointPermissions, error) } - -// Serving endpoints DataPlane provides a set of operations to interact with -// DataPlane endpoints for Serving endpoints service. -type ServingEndpointsDataPlaneService interface { - - // Query a serving endpoint. - Query(ctx context.Context, request QueryEndpointInput) (*QueryEndpointResponse, error) -} diff --git a/service/sql/model.go b/service/sql/model.go index c7db41440..6904aef74 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -287,6 +287,7 @@ func (s ChannelInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Name of the channel type ChannelName string const ChannelNameChannelNameCurrent ChannelName = `CHANNEL_NAME_CURRENT` diff --git a/workspace_client.go b/workspace_client.go index 0b48a320e..282991492 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -715,10 +715,6 @@ type WorkspaceClient struct { // applied to each served entity. ServingEndpoints serving.ServingEndpointsInterface - // Serving endpoints DataPlane provides a set of operations to interact with - // DataPlane endpoints for Serving endpoints service. - ServingEndpointsDataPlane serving.ServingEndpointsDataPlaneInterface - // Workspace Settings API allows users to manage settings at the workspace // level. Settings settings.SettingsInterface @@ -1076,7 +1072,6 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { Secrets: workspace.NewSecrets(databricksClient), ServicePrincipals: iam.NewServicePrincipals(databricksClient), ServingEndpoints: servingEndpoints, - ServingEndpointsDataPlane: serving.NewServingEndpointsDataPlane(databricksClient, servingEndpoints), Settings: settings.NewSettings(databricksClient), Shares: sharing.NewShares(databricksClient), StatementExecution: sql.NewStatementExecution(databricksClient),