From 451f81c2288dcbfc122d32a10e3d035d28c5daa0 Mon Sep 17 00:00:00 2001 From: Hector Castejon Diaz Date: Fri, 5 Jul 2024 14:39:37 +0200 Subject: [PATCH] Regenerate --- .codegen/_openapi_sha | 2 +- experimental/mocks/mock_workspace_client.go | 9 + .../catalog/mock_endpoints_interface.go | 404 ++++++++++++++++++ .../dashboards/mock_lakeview_interface.go | 108 ----- .../service/serving/mock_apps_interface.go | 59 --- .../mock_vector_search_indexes_interface.go | 59 --- service/catalog/api.go | 103 ++++- service/catalog/impl.go | 33 ++ service/catalog/interface.go | 17 +- service/catalog/model.go | 145 ++++--- service/compute/model.go | 6 +- service/dashboards/api.go | 45 -- service/dashboards/impl.go | 9 - service/dashboards/interface.go | 5 - service/dashboards/model.go | 70 --- service/jobs/model.go | 133 +++--- service/marketplace/model.go | 70 --- service/pkg.go | 3 + service/serving/api.go | 12 - service/serving/impl.go | 10 - service/serving/interface.go | 5 - service/serving/model.go | 16 +- service/settings/model.go | 6 +- service/sharing/model.go | 6 +- service/sql/api.go | 270 +----------- service/sql/interface.go | 105 +---- service/sql/model.go | 10 +- service/vectorsearch/api.go | 14 - service/vectorsearch/impl.go | 10 - service/vectorsearch/interface.go | 6 - service/vectorsearch/model.go | 35 -- workspace_client.go | 24 +- 32 files changed, 723 insertions(+), 1086 deletions(-) create mode 100644 experimental/mocks/service/catalog/mock_endpoints_interface.go diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index c4b47ca14..10657f9db 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -7437dabb9dadee402c1fc060df4c1ce8cc5369f0 \ No newline at end of file +f9166063cb5a6677c83877de2a2bb95c82958dd5 \ No newline at end of file diff --git a/experimental/mocks/mock_workspace_client.go b/experimental/mocks/mock_workspace_client.go index 0f97337cc..b0aeb32e1 100755 --- a/experimental/mocks/mock_workspace_client.go +++ b/experimental/mocks/mock_workspace_client.go @@ -61,6 +61,7 @@ func NewMockWorkspaceClient(t interface { DataSources: sql.NewMockDataSourcesInterface(t), Dbfs: files.NewMockDbfsInterface(t), DbsqlPermissions: sql.NewMockDbsqlPermissionsInterface(t), + Endpoints: catalog.NewMockEndpointsInterface(t), Experiments: ml.NewMockExperimentsInterface(t), ExternalLocations: catalog.NewMockExternalLocationsInterface(t), Files: files.NewMockFilesInterface(t), @@ -360,6 +361,14 @@ func (m *MockWorkspaceClient) GetMockDbsqlPermissionsAPI() *sql.MockDbsqlPermiss return api } +func (m *MockWorkspaceClient) GetMockEndpointsAPI() *catalog.MockEndpointsInterface { + api, ok := m.WorkspaceClient.Endpoints.(*catalog.MockEndpointsInterface) + if !ok { + panic(fmt.Sprintf("expected Endpoints to be *catalog.MockEndpointsInterface, actual was %T", m.WorkspaceClient.Endpoints)) + } + return api +} + func (m *MockWorkspaceClient) GetMockExperimentsAPI() *ml.MockExperimentsInterface { api, ok := m.WorkspaceClient.Experiments.(*ml.MockExperimentsInterface) if !ok { diff --git a/experimental/mocks/service/catalog/mock_endpoints_interface.go b/experimental/mocks/service/catalog/mock_endpoints_interface.go new file mode 100644 index 000000000..c2f86f08b --- /dev/null +++ b/experimental/mocks/service/catalog/mock_endpoints_interface.go @@ -0,0 +1,404 @@ +// Code generated by mockery v2.43.0. DO NOT EDIT. + +package catalog + +import ( + context "context" + + catalog "github.com/databricks/databricks-sdk-go/service/catalog" + + mock "github.com/stretchr/testify/mock" +) + +// MockEndpointsInterface is an autogenerated mock type for the EndpointsInterface type +type MockEndpointsInterface struct { + mock.Mock +} + +type MockEndpointsInterface_Expecter struct { + mock *mock.Mock +} + +func (_m *MockEndpointsInterface) EXPECT() *MockEndpointsInterface_Expecter { + return &MockEndpointsInterface_Expecter{mock: &_m.Mock} +} + +// Create provides a mock function with given fields: ctx, request +func (_m *MockEndpointsInterface) Create(ctx context.Context, request catalog.CreateEndpointRequest) (*catalog.Endpoint, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 *catalog.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateEndpointRequest) (*catalog.Endpoint, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.CreateEndpointRequest) *catalog.Endpoint); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.Endpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.CreateEndpointRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEndpointsInterface_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type MockEndpointsInterface_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.CreateEndpointRequest +func (_e *MockEndpointsInterface_Expecter) Create(ctx interface{}, request interface{}) *MockEndpointsInterface_Create_Call { + return &MockEndpointsInterface_Create_Call{Call: _e.mock.On("Create", ctx, request)} +} + +func (_c *MockEndpointsInterface_Create_Call) Run(run func(ctx context.Context, request catalog.CreateEndpointRequest)) *MockEndpointsInterface_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.CreateEndpointRequest)) + }) + return _c +} + +func (_c *MockEndpointsInterface_Create_Call) Return(_a0 *catalog.Endpoint, _a1 error) *MockEndpointsInterface_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEndpointsInterface_Create_Call) RunAndReturn(run func(context.Context, catalog.CreateEndpointRequest) (*catalog.Endpoint, error)) *MockEndpointsInterface_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, request +func (_m *MockEndpointsInterface) Delete(ctx context.Context, request catalog.DeleteEndpointRequest) error { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.DeleteEndpointRequest) error); ok { + r0 = rf(ctx, request) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockEndpointsInterface_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type MockEndpointsInterface_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.DeleteEndpointRequest +func (_e *MockEndpointsInterface_Expecter) Delete(ctx interface{}, request interface{}) *MockEndpointsInterface_Delete_Call { + return &MockEndpointsInterface_Delete_Call{Call: _e.mock.On("Delete", ctx, request)} +} + +func (_c *MockEndpointsInterface_Delete_Call) Run(run func(ctx context.Context, request catalog.DeleteEndpointRequest)) *MockEndpointsInterface_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.DeleteEndpointRequest)) + }) + return _c +} + +func (_c *MockEndpointsInterface_Delete_Call) Return(_a0 error) *MockEndpointsInterface_Delete_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockEndpointsInterface_Delete_Call) RunAndReturn(run func(context.Context, catalog.DeleteEndpointRequest) error) *MockEndpointsInterface_Delete_Call { + _c.Call.Return(run) + return _c +} + +// DeleteByName provides a mock function with given fields: ctx, name +func (_m *MockEndpointsInterface) DeleteByName(ctx context.Context, name string) error { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for DeleteByName") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, name) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockEndpointsInterface_DeleteByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByName' +type MockEndpointsInterface_DeleteByName_Call struct { + *mock.Call +} + +// DeleteByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockEndpointsInterface_Expecter) DeleteByName(ctx interface{}, name interface{}) *MockEndpointsInterface_DeleteByName_Call { + return &MockEndpointsInterface_DeleteByName_Call{Call: _e.mock.On("DeleteByName", ctx, name)} +} + +func (_c *MockEndpointsInterface_DeleteByName_Call) Run(run func(ctx context.Context, name string)) *MockEndpointsInterface_DeleteByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockEndpointsInterface_DeleteByName_Call) Return(_a0 error) *MockEndpointsInterface_DeleteByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockEndpointsInterface_DeleteByName_Call) RunAndReturn(run func(context.Context, string) error) *MockEndpointsInterface_DeleteByName_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: ctx, request +func (_m *MockEndpointsInterface) Get(ctx context.Context, request catalog.GetEndpointRequest) (*catalog.Endpoint, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 *catalog.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetEndpointRequest) (*catalog.Endpoint, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, catalog.GetEndpointRequest) *catalog.Endpoint); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.Endpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, catalog.GetEndpointRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEndpointsInterface_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type MockEndpointsInterface_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - ctx context.Context +// - request catalog.GetEndpointRequest +func (_e *MockEndpointsInterface_Expecter) Get(ctx interface{}, request interface{}) *MockEndpointsInterface_Get_Call { + return &MockEndpointsInterface_Get_Call{Call: _e.mock.On("Get", ctx, request)} +} + +func (_c *MockEndpointsInterface_Get_Call) Run(run func(ctx context.Context, request catalog.GetEndpointRequest)) *MockEndpointsInterface_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(catalog.GetEndpointRequest)) + }) + return _c +} + +func (_c *MockEndpointsInterface_Get_Call) Return(_a0 *catalog.Endpoint, _a1 error) *MockEndpointsInterface_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEndpointsInterface_Get_Call) RunAndReturn(run func(context.Context, catalog.GetEndpointRequest) (*catalog.Endpoint, error)) *MockEndpointsInterface_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetByName provides a mock function with given fields: ctx, name +func (_m *MockEndpointsInterface) GetByName(ctx context.Context, name string) (*catalog.Endpoint, error) { + ret := _m.Called(ctx, name) + + if len(ret) == 0 { + panic("no return value specified for GetByName") + } + + var r0 *catalog.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*catalog.Endpoint, error)); ok { + return rf(ctx, name) + } + if rf, ok := ret.Get(0).(func(context.Context, string) *catalog.Endpoint); ok { + r0 = rf(ctx, name) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*catalog.Endpoint) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, name) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockEndpointsInterface_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName' +type MockEndpointsInterface_GetByName_Call struct { + *mock.Call +} + +// GetByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *MockEndpointsInterface_Expecter) GetByName(ctx interface{}, name interface{}) *MockEndpointsInterface_GetByName_Call { + return &MockEndpointsInterface_GetByName_Call{Call: _e.mock.On("GetByName", ctx, name)} +} + +func (_c *MockEndpointsInterface_GetByName_Call) Run(run func(ctx context.Context, name string)) *MockEndpointsInterface_GetByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockEndpointsInterface_GetByName_Call) Return(_a0 *catalog.Endpoint, _a1 error) *MockEndpointsInterface_GetByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockEndpointsInterface_GetByName_Call) RunAndReturn(run func(context.Context, string) (*catalog.Endpoint, error)) *MockEndpointsInterface_GetByName_Call { + _c.Call.Return(run) + return _c +} + +// Impl provides a mock function with given fields: +func (_m *MockEndpointsInterface) Impl() catalog.EndpointsService { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Impl") + } + + var r0 catalog.EndpointsService + if rf, ok := ret.Get(0).(func() catalog.EndpointsService); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(catalog.EndpointsService) + } + } + + return r0 +} + +// MockEndpointsInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl' +type MockEndpointsInterface_Impl_Call struct { + *mock.Call +} + +// Impl is a helper method to define mock.On call +func (_e *MockEndpointsInterface_Expecter) Impl() *MockEndpointsInterface_Impl_Call { + return &MockEndpointsInterface_Impl_Call{Call: _e.mock.On("Impl")} +} + +func (_c *MockEndpointsInterface_Impl_Call) Run(run func()) *MockEndpointsInterface_Impl_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockEndpointsInterface_Impl_Call) Return(_a0 catalog.EndpointsService) *MockEndpointsInterface_Impl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockEndpointsInterface_Impl_Call) RunAndReturn(run func() catalog.EndpointsService) *MockEndpointsInterface_Impl_Call { + _c.Call.Return(run) + return _c +} + +// WithImpl provides a mock function with given fields: impl +func (_m *MockEndpointsInterface) WithImpl(impl catalog.EndpointsService) catalog.EndpointsInterface { + ret := _m.Called(impl) + + if len(ret) == 0 { + panic("no return value specified for WithImpl") + } + + var r0 catalog.EndpointsInterface + if rf, ok := ret.Get(0).(func(catalog.EndpointsService) catalog.EndpointsInterface); ok { + r0 = rf(impl) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(catalog.EndpointsInterface) + } + } + + return r0 +} + +// MockEndpointsInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl' +type MockEndpointsInterface_WithImpl_Call struct { + *mock.Call +} + +// WithImpl is a helper method to define mock.On call +// - impl catalog.EndpointsService +func (_e *MockEndpointsInterface_Expecter) WithImpl(impl interface{}) *MockEndpointsInterface_WithImpl_Call { + return &MockEndpointsInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)} +} + +func (_c *MockEndpointsInterface_WithImpl_Call) Run(run func(impl catalog.EndpointsService)) *MockEndpointsInterface_WithImpl_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(catalog.EndpointsService)) + }) + return _c +} + +func (_c *MockEndpointsInterface_WithImpl_Call) Return(_a0 catalog.EndpointsInterface) *MockEndpointsInterface_WithImpl_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockEndpointsInterface_WithImpl_Call) RunAndReturn(run func(catalog.EndpointsService) catalog.EndpointsInterface) *MockEndpointsInterface_WithImpl_Call { + _c.Call.Return(run) + return _c +} + +// NewMockEndpointsInterface creates a new instance of MockEndpointsInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockEndpointsInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *MockEndpointsInterface { + mock := &MockEndpointsInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/experimental/mocks/service/dashboards/mock_lakeview_interface.go b/experimental/mocks/service/dashboards/mock_lakeview_interface.go index 69f6bf1bc..48a91c8a8 100644 --- a/experimental/mocks/service/dashboards/mock_lakeview_interface.go +++ b/experimental/mocks/service/dashboards/mock_lakeview_interface.go @@ -914,114 +914,6 @@ func (_c *MockLakeviewInterface_Impl_Call) RunAndReturn(run func() dashboards.La return _c } -// List provides a mock function with given fields: ctx, request -func (_m *MockLakeviewInterface) List(ctx context.Context, request dashboards.ListDashboardsRequest) listing.Iterator[dashboards.Dashboard] { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for List") - } - - var r0 listing.Iterator[dashboards.Dashboard] - if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListDashboardsRequest) listing.Iterator[dashboards.Dashboard]); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(listing.Iterator[dashboards.Dashboard]) - } - } - - return r0 -} - -// MockLakeviewInterface_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List' -type MockLakeviewInterface_List_Call struct { - *mock.Call -} - -// List is a helper method to define mock.On call -// - ctx context.Context -// - request dashboards.ListDashboardsRequest -func (_e *MockLakeviewInterface_Expecter) List(ctx interface{}, request interface{}) *MockLakeviewInterface_List_Call { - return &MockLakeviewInterface_List_Call{Call: _e.mock.On("List", ctx, request)} -} - -func (_c *MockLakeviewInterface_List_Call) Run(run func(ctx context.Context, request dashboards.ListDashboardsRequest)) *MockLakeviewInterface_List_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(dashboards.ListDashboardsRequest)) - }) - return _c -} - -func (_c *MockLakeviewInterface_List_Call) Return(_a0 listing.Iterator[dashboards.Dashboard]) *MockLakeviewInterface_List_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *MockLakeviewInterface_List_Call) RunAndReturn(run func(context.Context, dashboards.ListDashboardsRequest) listing.Iterator[dashboards.Dashboard]) *MockLakeviewInterface_List_Call { - _c.Call.Return(run) - return _c -} - -// ListAll provides a mock function with given fields: ctx, request -func (_m *MockLakeviewInterface) ListAll(ctx context.Context, request dashboards.ListDashboardsRequest) ([]dashboards.Dashboard, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for ListAll") - } - - var r0 []dashboards.Dashboard - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListDashboardsRequest) ([]dashboards.Dashboard, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, dashboards.ListDashboardsRequest) []dashboards.Dashboard); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]dashboards.Dashboard) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, dashboards.ListDashboardsRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockLakeviewInterface_ListAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAll' -type MockLakeviewInterface_ListAll_Call struct { - *mock.Call -} - -// ListAll is a helper method to define mock.On call -// - ctx context.Context -// - request dashboards.ListDashboardsRequest -func (_e *MockLakeviewInterface_Expecter) ListAll(ctx interface{}, request interface{}) *MockLakeviewInterface_ListAll_Call { - return &MockLakeviewInterface_ListAll_Call{Call: _e.mock.On("ListAll", ctx, request)} -} - -func (_c *MockLakeviewInterface_ListAll_Call) Run(run func(ctx context.Context, request dashboards.ListDashboardsRequest)) *MockLakeviewInterface_ListAll_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(dashboards.ListDashboardsRequest)) - }) - return _c -} - -func (_c *MockLakeviewInterface_ListAll_Call) Return(_a0 []dashboards.Dashboard, _a1 error) *MockLakeviewInterface_ListAll_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockLakeviewInterface_ListAll_Call) RunAndReturn(run func(context.Context, dashboards.ListDashboardsRequest) ([]dashboards.Dashboard, error)) *MockLakeviewInterface_ListAll_Call { - _c.Call.Return(run) - return _c -} - // ListSchedules provides a mock function with given fields: ctx, request func (_m *MockLakeviewInterface) ListSchedules(ctx context.Context, request dashboards.ListSchedulesRequest) listing.Iterator[dashboards.Schedule] { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/serving/mock_apps_interface.go b/experimental/mocks/service/serving/mock_apps_interface.go index ddd2c9954..7ebbff688 100644 --- a/experimental/mocks/service/serving/mock_apps_interface.go +++ b/experimental/mocks/service/serving/mock_apps_interface.go @@ -1065,65 +1065,6 @@ func (_c *MockAppsInterface_ListDeploymentsByAppName_Call) RunAndReturn(run func return _c } -// Start provides a mock function with given fields: ctx, request -func (_m *MockAppsInterface) Start(ctx context.Context, request serving.StartAppRequest) (*serving.AppDeployment, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for Start") - } - - var r0 *serving.AppDeployment - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, serving.StartAppRequest) (*serving.AppDeployment, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, serving.StartAppRequest) *serving.AppDeployment); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*serving.AppDeployment) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, serving.StartAppRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockAppsInterface_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' -type MockAppsInterface_Start_Call struct { - *mock.Call -} - -// Start is a helper method to define mock.On call -// - ctx context.Context -// - request serving.StartAppRequest -func (_e *MockAppsInterface_Expecter) Start(ctx interface{}, request interface{}) *MockAppsInterface_Start_Call { - return &MockAppsInterface_Start_Call{Call: _e.mock.On("Start", ctx, request)} -} - -func (_c *MockAppsInterface_Start_Call) Run(run func(ctx context.Context, request serving.StartAppRequest)) *MockAppsInterface_Start_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(serving.StartAppRequest)) - }) - return _c -} - -func (_c *MockAppsInterface_Start_Call) Return(_a0 *serving.AppDeployment, _a1 error) *MockAppsInterface_Start_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockAppsInterface_Start_Call) RunAndReturn(run func(context.Context, serving.StartAppRequest) (*serving.AppDeployment, error)) *MockAppsInterface_Start_Call { - _c.Call.Return(run) - return _c -} - // Stop provides a mock function with given fields: ctx, request func (_m *MockAppsInterface) Stop(ctx context.Context, request serving.StopAppRequest) error { ret := _m.Called(ctx, request) diff --git a/experimental/mocks/service/vectorsearch/mock_vector_search_indexes_interface.go b/experimental/mocks/service/vectorsearch/mock_vector_search_indexes_interface.go index 8041f921a..7b609f982 100644 --- a/experimental/mocks/service/vectorsearch/mock_vector_search_indexes_interface.go +++ b/experimental/mocks/service/vectorsearch/mock_vector_search_indexes_interface.go @@ -568,65 +568,6 @@ func (_c *MockVectorSearchIndexesInterface_QueryIndex_Call) RunAndReturn(run fun return _c } -// QueryNextPage provides a mock function with given fields: ctx, request -func (_m *MockVectorSearchIndexesInterface) QueryNextPage(ctx context.Context, request vectorsearch.QueryVectorIndexNextPageRequest) (*vectorsearch.QueryVectorIndexResponse, error) { - ret := _m.Called(ctx, request) - - if len(ret) == 0 { - panic("no return value specified for QueryNextPage") - } - - var r0 *vectorsearch.QueryVectorIndexResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, vectorsearch.QueryVectorIndexNextPageRequest) (*vectorsearch.QueryVectorIndexResponse, error)); ok { - return rf(ctx, request) - } - if rf, ok := ret.Get(0).(func(context.Context, vectorsearch.QueryVectorIndexNextPageRequest) *vectorsearch.QueryVectorIndexResponse); ok { - r0 = rf(ctx, request) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*vectorsearch.QueryVectorIndexResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, vectorsearch.QueryVectorIndexNextPageRequest) error); ok { - r1 = rf(ctx, request) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockVectorSearchIndexesInterface_QueryNextPage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QueryNextPage' -type MockVectorSearchIndexesInterface_QueryNextPage_Call struct { - *mock.Call -} - -// QueryNextPage is a helper method to define mock.On call -// - ctx context.Context -// - request vectorsearch.QueryVectorIndexNextPageRequest -func (_e *MockVectorSearchIndexesInterface_Expecter) QueryNextPage(ctx interface{}, request interface{}) *MockVectorSearchIndexesInterface_QueryNextPage_Call { - return &MockVectorSearchIndexesInterface_QueryNextPage_Call{Call: _e.mock.On("QueryNextPage", ctx, request)} -} - -func (_c *MockVectorSearchIndexesInterface_QueryNextPage_Call) Run(run func(ctx context.Context, request vectorsearch.QueryVectorIndexNextPageRequest)) *MockVectorSearchIndexesInterface_QueryNextPage_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(vectorsearch.QueryVectorIndexNextPageRequest)) - }) - return _c -} - -func (_c *MockVectorSearchIndexesInterface_QueryNextPage_Call) Return(_a0 *vectorsearch.QueryVectorIndexResponse, _a1 error) *MockVectorSearchIndexesInterface_QueryNextPage_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockVectorSearchIndexesInterface_QueryNextPage_Call) RunAndReturn(run func(context.Context, vectorsearch.QueryVectorIndexNextPageRequest) (*vectorsearch.QueryVectorIndexResponse, error)) *MockVectorSearchIndexesInterface_QueryNextPage_Call { - _c.Call.Return(run) - return _c -} - // ScanIndex provides a mock function with given fields: ctx, request func (_m *MockVectorSearchIndexesInterface) ScanIndex(ctx context.Context, request vectorsearch.ScanVectorIndexRequest) (*vectorsearch.ScanVectorIndexResponse, error) { ret := _m.Called(ctx, request) diff --git a/service/catalog/api.go b/service/catalog/api.go index 5027e7730..344a4e07b 100755 --- a/service/catalog/api.go +++ b/service/catalog/api.go @@ -1,6 +1,6 @@ // Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. -// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Artifact Allowlists, Catalogs, Connections, External Locations, Functions, Grants, Metastores, Model Versions, Online Tables, Quality Monitors, Registered Models, Schemas, Storage Credentials, System Schemas, Table Constraints, Tables, Volumes, Workspace Bindings, etc. +// These APIs allow you to manage Account Metastore Assignments, Account Metastores, Account Storage Credentials, Artifact Allowlists, Catalogs, Connections, Endpoints, External Locations, Functions, Grants, Metastores, Model Versions, Online Tables, Quality Monitors, Registered Models, Schemas, Storage Credentials, System Schemas, Table Constraints, Tables, Volumes, Workspace Bindings, etc. package catalog import ( @@ -854,18 +854,12 @@ func (a *CatalogsAPI) List(ctx context.Context, request ListCatalogsRequest) lis getItems := func(resp *ListCatalogsResponse) []CatalogInfo { return resp.Catalogs } - getNextReq := func(resp *ListCatalogsResponse) *ListCatalogsRequest { - if resp.NextPageToken == "" { - return nil - } - request.PageToken = resp.NextPageToken - return &request - } + iterator := listing.NewIterator( &request, getNextPage, getItems, - getNextReq) + nil) return iterator } @@ -880,8 +874,7 @@ func (a *CatalogsAPI) List(ctx context.Context, request ListCatalogsRequest) lis // This method is generated by Databricks SDK Code Generator. func (a *CatalogsAPI) ListAll(ctx context.Context, request ListCatalogsRequest) ([]CatalogInfo, error) { iterator := a.List(ctx, request) - return listing.ToSliceN[CatalogInfo, int](ctx, iterator, request.MaxResults) - + return listing.ToSlice[CatalogInfo](ctx, iterator) } // Update a catalog. @@ -1115,6 +1108,90 @@ func (a *ConnectionsAPI) Update(ctx context.Context, request UpdateConnection) ( return a.impl.Update(ctx, request) } +type EndpointsInterface 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 MockEndpointsInterface instead. + WithImpl(impl EndpointsService) EndpointsInterface + + // Impl returns low-level Endpoints API implementation + // Deprecated: use MockEndpointsInterface instead. + Impl() EndpointsService + + // Create an Endpoint. + Create(ctx context.Context, request CreateEndpointRequest) (*Endpoint, error) + + // Delete an Endpoint. + Delete(ctx context.Context, request DeleteEndpointRequest) error + + // Delete an Endpoint. + DeleteByName(ctx context.Context, name string) error + + // Get an Endpoint. + Get(ctx context.Context, request GetEndpointRequest) (*Endpoint, error) + + // Get an Endpoint. + GetByName(ctx context.Context, name string) (*Endpoint, error) +} + +func NewEndpoints(client *client.DatabricksClient) *EndpointsAPI { + return &EndpointsAPI{ + impl: &endpointsImpl{ + client: client, + }, + } +} + +// Endpoints are used to connect to PG clusters. +type EndpointsAPI struct { + // impl contains low-level REST API interface, that could be overridden + // through WithImpl(EndpointsService) + impl EndpointsService +} + +// 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 MockEndpointsInterface instead. +func (a *EndpointsAPI) WithImpl(impl EndpointsService) EndpointsInterface { + a.impl = impl + return a +} + +// Impl returns low-level Endpoints API implementation +// Deprecated: use MockEndpointsInterface instead. +func (a *EndpointsAPI) Impl() EndpointsService { + return a.impl +} + +// Create an Endpoint. +func (a *EndpointsAPI) Create(ctx context.Context, request CreateEndpointRequest) (*Endpoint, error) { + return a.impl.Create(ctx, request) +} + +// Delete an Endpoint. +func (a *EndpointsAPI) Delete(ctx context.Context, request DeleteEndpointRequest) error { + return a.impl.Delete(ctx, request) +} + +// Delete an Endpoint. +func (a *EndpointsAPI) DeleteByName(ctx context.Context, name string) error { + return a.impl.Delete(ctx, DeleteEndpointRequest{ + Name: name, + }) +} + +// Get an Endpoint. +func (a *EndpointsAPI) Get(ctx context.Context, request GetEndpointRequest) (*Endpoint, error) { + return a.impl.Get(ctx, request) +} + +// Get an Endpoint. +func (a *EndpointsAPI) GetByName(ctx context.Context, name string) (*Endpoint, error) { + return a.impl.Get(ctx, GetEndpointRequest{ + Name: name, + }) +} + type ExternalLocationsInterface interface { // WithImpl could be used to override low-level API implementations for unit // testing purposes with [github.com/golang/mock] or other mocking frameworks. @@ -1345,8 +1422,6 @@ type FunctionsInterface interface { // Create a function. // - // **WARNING: This API is experimental and will change in future versions** - // // Creates a new function // // The user must have the following permissions in order for the function to be @@ -1482,8 +1557,6 @@ func (a *FunctionsAPI) Impl() FunctionsService { // Create a function. // -// **WARNING: This API is experimental and will change in future versions** -// // # Creates a new function // // The user must have the following permissions in order for the function to be diff --git a/service/catalog/impl.go b/service/catalog/impl.go index 312d9522c..93a6a4928 100755 --- a/service/catalog/impl.go +++ b/service/catalog/impl.go @@ -294,6 +294,39 @@ func (a *connectionsImpl) Update(ctx context.Context, request UpdateConnection) return &connectionInfo, err } +// unexported type that holds implementations of just Endpoints API methods +type endpointsImpl struct { + client *client.DatabricksClient +} + +func (a *endpointsImpl) Create(ctx context.Context, request CreateEndpointRequest) (*Endpoint, error) { + var endpoint Endpoint + path := "/api/2.0/hadron-endpoints" + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + err := a.client.Do(ctx, http.MethodPost, path, headers, request, &endpoint) + return &endpoint, err +} + +func (a *endpointsImpl) Delete(ctx context.Context, request DeleteEndpointRequest) error { + var deleteResponse DeleteResponse + path := fmt.Sprintf("/api/2.0/hadron-endpoints/%v", request.Name) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodDelete, path, headers, request, &deleteResponse) + return err +} + +func (a *endpointsImpl) Get(ctx context.Context, request GetEndpointRequest) (*Endpoint, error) { + var endpoint Endpoint + path := fmt.Sprintf("/api/2.0/hadron-endpoints/%v", request.Name) + headers := make(map[string]string) + headers["Accept"] = "application/json" + err := a.client.Do(ctx, http.MethodGet, path, headers, request, &endpoint) + return &endpoint, err +} + // unexported type that holds implementations of just ExternalLocations API methods type externalLocationsImpl struct { client *client.DatabricksClient diff --git a/service/catalog/interface.go b/service/catalog/interface.go index 02d5a781b..3aab6d738 100755 --- a/service/catalog/interface.go +++ b/service/catalog/interface.go @@ -178,7 +178,7 @@ type CatalogsService interface { // privilege) will be retrieved. There is no guarantee of a specific // ordering of the elements in the array. // - // Use ListAll() to get all CatalogInfo instances, which will iterate over every result page. + // Use ListAll() to get all CatalogInfo instances List(ctx context.Context, request ListCatalogsRequest) (*ListCatalogsResponse, error) // Update a catalog. @@ -234,6 +234,19 @@ type ConnectionsService interface { Update(ctx context.Context, request UpdateConnection) (*ConnectionInfo, error) } +// Endpoints are used to connect to PG clusters. +type EndpointsService interface { + + // Create an Endpoint. + Create(ctx context.Context, request CreateEndpointRequest) (*Endpoint, error) + + // Delete an Endpoint. + Delete(ctx context.Context, request DeleteEndpointRequest) error + + // Get an Endpoint. + Get(ctx context.Context, request GetEndpointRequest) (*Endpoint, error) +} + // An external location is an object that combines a cloud storage path with a // storage credential that authorizes access to the cloud storage path. Each // external location is subject to Unity Catalog access-control policies that @@ -298,8 +311,6 @@ type FunctionsService interface { // Create a function. // - // **WARNING: This API is experimental and will change in future versions** - // // Creates a new function // // The user must have the following permissions in order for the function to diff --git a/service/catalog/model.go b/service/catalog/model.go index 6c03eddc1..7fe1e82d9 100755 --- a/service/catalog/model.go +++ b/service/catalog/model.go @@ -244,7 +244,7 @@ type CatalogInfo struct { FullName string `json:"full_name,omitempty"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` // Unique identifier of parent metastore. MetastoreId string `json:"metastore_id,omitempty"` // Name of catalog. @@ -338,35 +338,6 @@ func (f *CatalogInfoSecurableKind) Type() string { return "CatalogInfoSecurableKind" } -// Whether the current securable is accessible from all workspaces or a specific -// set of workspaces. -type CatalogIsolationMode string - -const CatalogIsolationModeIsolated CatalogIsolationMode = `ISOLATED` - -const CatalogIsolationModeOpen CatalogIsolationMode = `OPEN` - -// String representation for [fmt.Print] -func (f *CatalogIsolationMode) String() string { - return string(*f) -} - -// Set raw string value and validate it against allowed values -func (f *CatalogIsolationMode) Set(v string) error { - switch v { - case `ISOLATED`, `OPEN`: - *f = CatalogIsolationMode(v) - return nil - default: - return fmt.Errorf(`value "%s" is not one of "ISOLATED", "OPEN"`, v) - } -} - -// Type always returns CatalogIsolationMode to satisfy [pflag.Value] interface -func (f *CatalogIsolationMode) Type() string { - return "CatalogIsolationMode" -} - // The type of the catalog. type CatalogType string @@ -745,6 +716,11 @@ func (s CreateConnection) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +type CreateEndpointRequest struct { + // Endpoint + Endpoint *Endpoint `json:"endpoint,omitempty"` +} + type CreateExternalLocation struct { // The AWS access point to use when accesing s3 for this external location. AccessPoint string `json:"access_point,omitempty"` @@ -955,10 +931,9 @@ func (f *CreateFunctionSqlDataAccess) Type() string { type CreateMetastore struct { // The user-specified name of the metastore. Name string `json:"name"` - // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). - // The field can be omitted in the __workspace-level__ __API__ but not in - // the __account-level__ __API__. If this field is omitted, the region of - // the workspace receiving the request will be used. + // Cloud region which the metastore serves (e.g., `us-west-2`, `westus`). If + // this field is omitted, the region of the workspace receiving the request + // will be used. Region string `json:"region,omitempty"` // The storage root URL for metastore StorageRoot string `json:"storage_root,omitempty"` @@ -1373,6 +1348,11 @@ type DeleteConnectionRequest struct { Name string `json:"-" url:"-"` } +// Delete an Endpoint +type DeleteEndpointRequest struct { + Name string `json:"-" url:"-"` +} + // Delete an external location type DeleteExternalLocationRequest struct { // Force deletion even if there are dependent external tables or mounts. @@ -1686,6 +1666,56 @@ type EncryptionDetails struct { SseEncryptionDetails *SseEncryptionDetails `json:"sse_encryption_details,omitempty"` } +// Endpoint +type Endpoint struct { + Name string `json:"name,omitempty"` + + Status EndpointState `json:"status,omitempty"` + + ForceSendFields []string `json:"-"` +} + +func (s *Endpoint) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s Endpoint) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + +type EndpointState string + +const EndpointStateEndpointDeleting EndpointState = `ENDPOINT_DELETING` + +const EndpointStateEndpointFailed EndpointState = `ENDPOINT_FAILED` + +const EndpointStateEndpointOnline EndpointState = `ENDPOINT_ONLINE` + +const EndpointStateEndpointProvisioning EndpointState = `ENDPOINT_PROVISIONING` + +const EndpointStateEndpointStateUnspecified EndpointState = `ENDPOINT_STATE_UNSPECIFIED` + +// String representation for [fmt.Print] +func (f *EndpointState) String() string { + return string(*f) +} + +// Set raw string value and validate it against allowed values +func (f *EndpointState) Set(v string) error { + switch v { + case `ENDPOINT_DELETING`, `ENDPOINT_FAILED`, `ENDPOINT_ONLINE`, `ENDPOINT_PROVISIONING`, `ENDPOINT_STATE_UNSPECIFIED`: + *f = EndpointState(v) + return nil + default: + return fmt.Errorf(`value "%s" is not one of "ENDPOINT_DELETING", "ENDPOINT_FAILED", "ENDPOINT_ONLINE", "ENDPOINT_PROVISIONING", "ENDPOINT_STATE_UNSPECIFIED"`, v) + } +} + +// Type always returns EndpointState to satisfy [pflag.Value] interface +func (f *EndpointState) Type() string { + return "EndpointState" +} + // Get boolean reflecting if table exists type ExistsRequest struct { // Full name of the table. @@ -2161,6 +2191,11 @@ func (s GetEffectiveRequest) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Get an Endpoint +type GetEndpointRequest struct { + Name string `json:"-" url:"-"` +} + // Get an external location type GetExternalLocationRequest struct { // Whether to include external locations in the response for which the @@ -2475,18 +2510,6 @@ type ListCatalogsRequest struct { // Whether to include catalogs in the response for which the principal can // only access selective metadata for IncludeBrowse bool `json:"-" url:"include_browse,omitempty"` - // Maximum number of catalogs to return. - when set to 0, the page length is - // set to a server configured value (recommended); - when set to a value - // greater than 0, the page length is the minimum of this value and a server - // configured value; - when set to a value less than 0, an invalid parameter - // error is returned; - If not set, all valid catalogs are returned (not - // recommended). - Note: The number of returned catalogs might be less than - // the specified max_results size, even zero. The only definitive indication - // that no further catalogs can be fetched is when the next_page_token is - // unset from the response. - MaxResults int `json:"-" url:"max_results,omitempty"` - // Opaque pagination token to go to next page based on previous query. - PageToken string `json:"-" url:"page_token,omitempty"` ForceSendFields []string `json:"-"` } @@ -2502,20 +2525,6 @@ func (s ListCatalogsRequest) MarshalJSON() ([]byte, error) { type ListCatalogsResponse struct { // An array of catalog information objects. Catalogs []CatalogInfo `json:"catalogs,omitempty"` - // Opaque token to retrieve the next page of results. Absent if there are no - // more pages. __page_token__ should be set to this value for the next - // request (for the next page of results). - NextPageToken string `json:"next_page_token,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *ListCatalogsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s ListCatalogsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) } // List connections @@ -3682,8 +3691,6 @@ type OnlineTable struct { Spec *OnlineTableSpec `json:"spec,omitempty"` // Online Table status Status *OnlineTableStatus `json:"status,omitempty"` - // Data serving REST API URL for this table - TableServingUrl string `json:"table_serving_url,omitempty"` ForceSendFields []string `json:"-"` } @@ -3941,6 +3948,8 @@ const PrivilegeSelect Privilege = `SELECT` const PrivilegeSetSharePermission Privilege = `SET_SHARE_PERMISSION` +const PrivilegeSingleUserAccess Privilege = `SINGLE_USER_ACCESS` + const PrivilegeUsage Privilege = `USAGE` const PrivilegeUseCatalog Privilege = `USE_CATALOG` @@ -3971,11 +3980,11 @@ func (f *Privilege) String() string { // Set raw string value and validate it against allowed values func (f *Privilege) Set(v string) error { switch v { - case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: + case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `SINGLE_USER_ACCESS`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: *f = Privilege(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) + return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "SINGLE_USER_ACCESS", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) } } @@ -4646,7 +4655,7 @@ type UpdateCatalog struct { EnablePredictiveOptimization EnablePredictiveOptimization `json:"enable_predictive_optimization,omitempty"` // Whether the current securable is accessible from all workspaces or a // specific set of workspaces. - IsolationMode CatalogIsolationMode `json:"isolation_mode,omitempty"` + IsolationMode IsolationMode `json:"isolation_mode,omitempty"` // The name of the catalog. Name string `json:"-" url:"-"` // New name for the catalog. @@ -4700,9 +4709,6 @@ type UpdateExternalLocation struct { // Force update even if changing url invalidates dependent external tables // or mounts. Force bool `json:"force,omitempty"` - // Whether the current securable is accessible from all workspaces or a - // specific set of workspaces. - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` // Name of the external location. Name string `json:"-" url:"-"` // New name for the external location. @@ -4964,9 +4970,6 @@ type UpdateStorageCredential struct { // Force update even if there are dependent external locations or external // tables. Force bool `json:"force,omitempty"` - // Whether the current securable is accessible from all workspaces or a - // specific set of workspaces. - IsolationMode IsolationMode `json:"isolation_mode,omitempty"` // Name of the storage credential. Name string `json:"-" url:"-"` // New name for the storage credential. diff --git a/service/compute/model.go b/service/compute/model.go index 7a7f04464..3f4fba20a 100755 --- a/service/compute/model.go +++ b/service/compute/model.go @@ -2355,9 +2355,9 @@ type EditPolicyResponse struct { type EditResponse struct { } -// The environment entity used to preserve serverless environment side panel and -// jobs' environment for non-notebook task. In this minimal environment spec, -// only pip dependencies are supported. +// The a environment entity used to preserve serverless environment side panel +// and jobs' environment for non-notebook task. In this minimal environment +// spec, only pip dependencies are supported. Next ID: 5 type Environment struct { // Client version used by the environment The client is the user-facing // environment of the runtime. Each client comes with a specific set of diff --git a/service/dashboards/api.go b/service/dashboards/api.go index 96e0e82b7..3e23829a1 100755 --- a/service/dashboards/api.go +++ b/service/dashboards/api.go @@ -76,16 +76,6 @@ type LakeviewInterface interface { // Get schedule subscription. GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId(ctx context.Context, dashboardId string, scheduleId string, subscriptionId string) (*Subscription, error) - // List dashboards. - // - // This method is generated by Databricks SDK Code Generator. - List(ctx context.Context, request ListDashboardsRequest) listing.Iterator[Dashboard] - - // List dashboards. - // - // This method is generated by Databricks SDK Code Generator. - ListAll(ctx context.Context, request ListDashboardsRequest) ([]Dashboard, error) - // List dashboard schedules. // // This method is generated by Databricks SDK Code Generator. @@ -285,41 +275,6 @@ func (a *LakeviewAPI) GetSubscriptionByDashboardIdAndScheduleIdAndSubscriptionId }) } -// List dashboards. -// -// This method is generated by Databricks SDK Code Generator. -func (a *LakeviewAPI) List(ctx context.Context, request ListDashboardsRequest) listing.Iterator[Dashboard] { - - getNextPage := func(ctx context.Context, req ListDashboardsRequest) (*ListDashboardsResponse, error) { - ctx = useragent.InContext(ctx, "sdk-feature", "pagination") - return a.impl.List(ctx, req) - } - getItems := func(resp *ListDashboardsResponse) []Dashboard { - return resp.Dashboards - } - getNextReq := func(resp *ListDashboardsResponse) *ListDashboardsRequest { - if resp.NextPageToken == "" { - return nil - } - request.PageToken = resp.NextPageToken - return &request - } - iterator := listing.NewIterator( - &request, - getNextPage, - getItems, - getNextReq) - return iterator -} - -// List dashboards. -// -// This method is generated by Databricks SDK Code Generator. -func (a *LakeviewAPI) ListAll(ctx context.Context, request ListDashboardsRequest) ([]Dashboard, error) { - iterator := a.List(ctx, request) - return listing.ToSlice[Dashboard](ctx, iterator) -} - // List dashboard schedules. // // This method is generated by Databricks SDK Code Generator. diff --git a/service/dashboards/impl.go b/service/dashboards/impl.go index 46a756120..ea15b310d 100755 --- a/service/dashboards/impl.go +++ b/service/dashboards/impl.go @@ -99,15 +99,6 @@ func (a *lakeviewImpl) GetSubscription(ctx context.Context, request GetSubscript return &subscription, err } -func (a *lakeviewImpl) List(ctx context.Context, request ListDashboardsRequest) (*ListDashboardsResponse, error) { - var listDashboardsResponse ListDashboardsResponse - path := "/api/2.0/lakeview/dashboards" - headers := make(map[string]string) - headers["Accept"] = "application/json" - err := a.client.Do(ctx, http.MethodGet, path, headers, request, &listDashboardsResponse) - return &listDashboardsResponse, err -} - func (a *lakeviewImpl) ListSchedules(ctx context.Context, request ListSchedulesRequest) (*ListSchedulesResponse, error) { var listSchedulesResponse ListSchedulesResponse path := fmt.Sprintf("/api/2.0/lakeview/dashboards/%v/schedules", request.DashboardId) diff --git a/service/dashboards/interface.go b/service/dashboards/interface.go index 94edde5ef..e8e491caa 100755 --- a/service/dashboards/interface.go +++ b/service/dashboards/interface.go @@ -44,11 +44,6 @@ type LakeviewService interface { // Get schedule subscription. GetSubscription(ctx context.Context, request GetSubscriptionRequest) (*Subscription, error) - // List dashboards. - // - // Use ListAll() to get all Dashboard instances, which will iterate over every result page. - List(ctx context.Context, request ListDashboardsRequest) (*ListDashboardsResponse, error) - // List dashboard schedules. // // Use ListSchedulesAll() to get all Schedule instances, which will iterate over every result page. diff --git a/service/dashboards/model.go b/service/dashboards/model.go index ad8537099..3b8d07f52 100755 --- a/service/dashboards/model.go +++ b/service/dashboards/model.go @@ -110,33 +110,6 @@ func (s Dashboard) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -type DashboardView string - -const DashboardViewDashboardViewBasic DashboardView = `DASHBOARD_VIEW_BASIC` - -const DashboardViewDashboardViewFull DashboardView = `DASHBOARD_VIEW_FULL` - -// String representation for [fmt.Print] -func (f *DashboardView) String() string { - return string(*f) -} - -// Set raw string value and validate it against allowed values -func (f *DashboardView) Set(v string) error { - switch v { - case `DASHBOARD_VIEW_BASIC`, `DASHBOARD_VIEW_FULL`: - *f = DashboardView(v) - return nil - default: - return fmt.Errorf(`value "%s" is not one of "DASHBOARD_VIEW_BASIC", "DASHBOARD_VIEW_FULL"`, v) - } -} - -// Type always returns DashboardView to satisfy [pflag.Value] interface -func (f *DashboardView) Type() string { - return "DashboardView" -} - // Delete dashboard schedule type DeleteScheduleRequest struct { // UUID identifying the dashboard to which the schedule belongs. @@ -244,49 +217,6 @@ func (f *LifecycleState) Type() string { return "LifecycleState" } -// List dashboards -type ListDashboardsRequest struct { - // The number of dashboards to return per page. - PageSize int `json:"-" url:"page_size,omitempty"` - // A page token, received from a previous `ListDashboards` call. This token - // can be used to retrieve the subsequent page. - PageToken string `json:"-" url:"page_token,omitempty"` - // The flag to include dashboards located in the trash. If unspecified, only - // active dashboards will be returned. - ShowTrashed bool `json:"-" url:"show_trashed,omitempty"` - // Indicates whether to include all metadata from the dashboard in the - // response. If unset, the response defaults to `DASHBOARD_VIEW_BASIC` which - // only includes summary metadata from the dashboard. - View DashboardView `json:"-" url:"view,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *ListDashboardsRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s ListDashboardsRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) -} - -type ListDashboardsResponse struct { - Dashboards []Dashboard `json:"dashboards,omitempty"` - // A token, which can be sent as `page_token` to retrieve the next page. If - // this field is omitted, there are no subsequent dashboards. - NextPageToken string `json:"next_page_token,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *ListDashboardsResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s ListDashboardsResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) -} - // List dashboard schedules type ListSchedulesRequest struct { // UUID identifying the dashboard to which the schedule belongs. diff --git a/service/jobs/model.go b/service/jobs/model.go index bec612f48..7a17a360d 100755 --- a/service/jobs/model.go +++ b/service/jobs/model.go @@ -1053,14 +1053,6 @@ type JobEmailNotifications struct { // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. OnStart []string `json:"on_start,omitempty"` - // A list of email addresses to notify when any streaming backlog thresholds - // are exceeded for any stream. Streaming backlog thresholds can be set in - // the `health` field using the following metrics: - // `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, - // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is - // based on the 10-minute average of these metrics. If the issue persists, - // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If @@ -1082,9 +1074,9 @@ func (s JobEmailNotifications) MarshalJSON() ([]byte, error) { type JobEnvironment struct { // The key of an environment. It has to be unique within a job. EnvironmentKey string `json:"environment_key"` - // The environment entity used to preserve serverless environment side panel - // and jobs' environment for non-notebook task. In this minimal environment - // spec, only pip dependencies are supported. + // The a environment entity used to preserve serverless environment side + // panel and jobs' environment for non-notebook task. In this minimal + // environment spec, only pip dependencies are supported. Next ID: 5 Spec *compute.Environment `json:"spec,omitempty"` } @@ -1415,37 +1407,10 @@ func (f *JobSourceDirtyState) Type() string { // Specifies the health metric that is being evaluated for a particular health // rule. -// -// * `RUN_DURATION_SECONDS`: Expected total time for a run in seconds. * -// `STREAMING_BACKLOG_BYTES`: An estimate of the maximum bytes of data waiting -// to be consumed across all streams. This metric is in Private Preview. * -// `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset lag across all -// streams. This metric is in Private Preview. * `STREAMING_BACKLOG_SECONDS`: An -// estimate of the maximum consumer delay across all streams. This metric is in -// Private Preview. * `STREAMING_BACKLOG_FILES`: An estimate of the maximum -// number of outstanding files across all streams. This metric is in Private -// Preview. type JobsHealthMetric string -// Expected total time for a run in seconds. const JobsHealthMetricRunDurationSeconds JobsHealthMetric = `RUN_DURATION_SECONDS` -// An estimate of the maximum bytes of data waiting to be consumed across all -// streams. This metric is in Private Preview. -const JobsHealthMetricStreamingBacklogBytes JobsHealthMetric = `STREAMING_BACKLOG_BYTES` - -// An estimate of the maximum number of outstanding files across all streams. -// This metric is in Private Preview. -const JobsHealthMetricStreamingBacklogFiles JobsHealthMetric = `STREAMING_BACKLOG_FILES` - -// An estimate of the maximum offset lag across all streams. This metric is in -// Private Preview. -const JobsHealthMetricStreamingBacklogRecords JobsHealthMetric = `STREAMING_BACKLOG_RECORDS` - -// An estimate of the maximum consumer delay across all streams. This metric is -// in Private Preview. -const JobsHealthMetricStreamingBacklogSeconds JobsHealthMetric = `STREAMING_BACKLOG_SECONDS` - // String representation for [fmt.Print] func (f *JobsHealthMetric) String() string { return string(*f) @@ -1454,11 +1419,11 @@ func (f *JobsHealthMetric) String() string { // Set raw string value and validate it against allowed values func (f *JobsHealthMetric) Set(v string) error { switch v { - case `RUN_DURATION_SECONDS`, `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_FILES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`: + case `RUN_DURATION_SECONDS`: *f = JobsHealthMetric(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "RUN_DURATION_SECONDS", "STREAMING_BACKLOG_BYTES", "STREAMING_BACKLOG_FILES", "STREAMING_BACKLOG_RECORDS", "STREAMING_BACKLOG_SECONDS"`, v) + return fmt.Errorf(`value "%s" is not one of "RUN_DURATION_SECONDS"`, v) } } @@ -1497,16 +1462,6 @@ func (f *JobsHealthOperator) Type() string { type JobsHealthRule struct { // Specifies the health metric that is being evaluated for a particular // health rule. - // - // * `RUN_DURATION_SECONDS`: Expected total time for a run in seconds. * - // `STREAMING_BACKLOG_BYTES`: An estimate of the maximum bytes of data - // waiting to be consumed across all streams. This metric is in Private - // Preview. * `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset - // lag across all streams. This metric is in Private Preview. * - // `STREAMING_BACKLOG_SECONDS`: An estimate of the maximum consumer delay - // across all streams. This metric is in Private Preview. * - // `STREAMING_BACKLOG_FILES`: An estimate of the maximum number of - // outstanding files across all streams. This metric is in Private Preview. Metric JobsHealthMetric `json:"metric"` // Specifies the operator used to compare the health metric value with the // specified threshold. @@ -1750,9 +1705,8 @@ func (f *PauseStatus) Type() string { } type PeriodicTriggerConfiguration struct { - // The interval at which the trigger should run. Interval int `json:"interval"` - // The unit of time for the interval. + Unit PeriodicTriggerConfigurationTimeUnit `json:"unit"` } @@ -2918,10 +2872,6 @@ type RunTask struct { // The time at which this run ended in epoch milliseconds (milliseconds // since 1/1/1970 UTC). This field is set to 0 if the job is still running. EndTime int64 `json:"end_time,omitempty"` - // The key that references an environment spec in a job. This field is - // required for Python script, Python wheel and dbt tasks when using - // serverless compute. - EnvironmentKey string `json:"environment_key,omitempty"` // The time in milliseconds it took to execute the commands in the JAR or // notebook until they completed, failed, timed out, were cancelled, or // encountered an unexpected error. The duration of a task run is the sum of @@ -3497,12 +3447,17 @@ func (s SqlTaskSubscription) MarshalJSON() ([]byte, error) { type SubmitRun struct { // List of permissions to set on the job. AccessControlList []iam.AccessControlRequest `json:"access_control_list,omitempty"` + // If condition_task, specifies a condition with an outcome that can be used + // to control the execution of other tasks. Does not require a cluster to + // execute and does not support retries or notifications. + ConditionTask *ConditionTask `json:"condition_task,omitempty"` + // If dbt_task, indicates that this must execute a dbt task. It requires + // both Databricks SQL and the ability to use a serverless or a pro SQL + // warehouse. + DbtTask *DbtTask `json:"dbt_task,omitempty"` // An optional set of email addresses notified when the run begins or // completes. EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` - // A list of task execution environment specifications that can be - // referenced by tasks of this run. - Environments []JobEnvironment `json:"environments,omitempty"` // An optional specification for a remote Git repository containing the // source code used by tasks. Version-controlled source code is supported by // notebook, dbt, Python script, and SQL File tasks. @@ -3532,17 +3487,50 @@ type SubmitRun struct { // // [How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html IdempotencyToken string `json:"idempotency_token,omitempty"` + // If notebook_task, indicates that this task must run a notebook. This + // field may not be specified in conjunction with spark_jar_task. + NotebookTask *NotebookTask `json:"notebook_task,omitempty"` // Optional notification settings that are used when sending notifications // to each of the `email_notifications` and `webhook_notifications` for this // run. NotificationSettings *JobNotificationSettings `json:"notification_settings,omitempty"` + // If pipeline_task, indicates that this task must execute a Pipeline. + PipelineTask *PipelineTask `json:"pipeline_task,omitempty"` + // If python_wheel_task, indicates that this job must execute a PythonWheel. + PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty"` // The queue settings of the one-time run. Queue *QueueSettings `json:"queue,omitempty"` // Specifies the user or service principal that the job runs as. If not // specified, the job runs as the user who submits the request. RunAs *JobRunAs `json:"run_as,omitempty"` + // If run_job_task, indicates that this task must execute another job. + RunJobTask *RunJobTask `json:"run_job_task,omitempty"` // An optional name for the run. The default value is `Untitled`. RunName string `json:"run_name,omitempty"` + // If spark_jar_task, indicates that this task must run a JAR. + SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty"` + // If spark_python_task, indicates that this task must run a Python file. + SparkPythonTask *SparkPythonTask `json:"spark_python_task,omitempty"` + // If `spark_submit_task`, indicates that this task must be launched by the + // spark submit script. This task can run only on new clusters. + // + // In the `new_cluster` specification, `libraries` and `spark_conf` are not + // supported. Instead, use `--jars` and `--py-files` to add Java and Python + // libraries and `--conf` to set the Spark configurations. + // + // `master`, `deploy-mode`, and `executor-cores` are automatically + // configured by Databricks; you _cannot_ specify them in parameters. + // + // By default, the Spark submit job uses all available memory (excluding + // reserved memory for Databricks services). You can set `--driver-memory`, + // and `--executor-memory` to a smaller value to leave some room for + // off-heap usage. + // + // The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 + // paths. + SparkSubmitTask *SparkSubmitTask `json:"spark_submit_task,omitempty"` + // If sql_task, indicates that this job must execute a SQL task. + SqlTask *SqlTask `json:"sql_task,omitempty"` Tasks []SubmitTask `json:"tasks,omitempty"` // An optional timeout applied to each run of this job. A value of `0` means @@ -3584,10 +3572,6 @@ type SubmitTask struct { // to control the execution of other tasks. Does not require a cluster to // execute and does not support retries or notifications. ConditionTask *ConditionTask `json:"condition_task,omitempty"` - // If dbt_task, indicates that this must execute a dbt task. It requires - // both Databricks SQL and the ability to use a serverless or a pro SQL - // warehouse. - DbtTask *DbtTask `json:"dbt_task,omitempty"` // An optional array of objects specifying the dependency graph of the task. // All tasks specified in this field must complete successfully before // executing this task. The key is `task_key`, and the value is the name @@ -3598,10 +3582,6 @@ type SubmitTask struct { // An optional set of email addresses notified when the task run begins or // completes. The default behavior is to not send any emails. EmailNotifications *JobEmailNotifications `json:"email_notifications,omitempty"` - // The key that references an environment spec in a job. This field is - // required for Python script, Python wheel and dbt tasks when using - // serverless compute. - EnvironmentKey string `json:"environment_key,omitempty"` // If existing_cluster_id, the ID of an existing cluster that is used for // all runs. When running jobs or tasks on an existing cluster, you may need // to manually restart the cluster if it stops responding. We suggest @@ -3876,14 +3856,6 @@ type TaskEmailNotifications struct { // specified on job creation, reset, or update, the list is empty, and // notifications are not sent. OnStart []string `json:"on_start,omitempty"` - // A list of email addresses to notify when any streaming backlog thresholds - // are exceeded for any stream. Streaming backlog thresholds can be set in - // the `health` field using the following metrics: - // `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, - // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is - // based on the 10-minute average of these metrics. If the issue persists, - // notifications are resent every 30 minutes. - OnStreamingBacklogExceeded []string `json:"on_streaming_backlog_exceeded,omitempty"` // A list of email addresses to be notified when a run successfully // completes. A run is considered to have completed successfully if it ends // with a `TERMINATED` `life_cycle_state` and a `SUCCESS` result_state. If @@ -3946,7 +3918,7 @@ type TriggerSettings struct { FileArrival *FileArrivalTriggerConfiguration `json:"file_arrival,omitempty"` // Whether this trigger is paused or not. PauseStatus PauseStatus `json:"pause_status,omitempty"` - // Periodic trigger settings. + Periodic *PeriodicTriggerConfiguration `json:"periodic,omitempty"` // Old table trigger settings name. Deprecated in favor of `table_update`. Table *TableUpdateTriggerConfiguration `json:"table,omitempty"` @@ -4132,15 +4104,6 @@ type WebhookNotifications struct { // An optional list of system notification IDs to call when the run starts. // A maximum of 3 destinations can be specified for the `on_start` property. OnStart []Webhook `json:"on_start,omitempty"` - // An optional list of system notification IDs to call when any streaming - // backlog thresholds are exceeded for any stream. Streaming backlog - // thresholds can be set in the `health` field using the following metrics: - // `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, - // `STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is - // based on the 10-minute average of these metrics. If the issue persists, - // notifications are resent every 30 minutes. A maximum of 3 destinations - // can be specified for the `on_streaming_backlog_exceeded` property. - OnStreamingBacklogExceeded []Webhook `json:"on_streaming_backlog_exceeded,omitempty"` // An optional list of system notification IDs to call when the run // completes successfully. A maximum of 3 destinations can be specified for // the `on_success` property. diff --git a/service/marketplace/model.go b/service/marketplace/model.go index 968515d9d..efc78aa57 100755 --- a/service/marketplace/model.go +++ b/service/marketplace/model.go @@ -1378,9 +1378,6 @@ type Listing struct { Detail *ListingDetail `json:"detail,omitempty"` Id string `json:"id,omitempty"` - // we can not use just ProviderListingSummary since we already have same - // name on entity side of the state - ProviderSummary *ProviderListingSummaryInfo `json:"provider_summary,omitempty"` // Next Number: 26 Summary ListingSummary `json:"summary"` @@ -1759,53 +1756,6 @@ type ProviderAnalyticsDashboard struct { Id string `json:"id"` } -type ProviderIconFile struct { - IconFileId string `json:"icon_file_id,omitempty"` - - IconFilePath string `json:"icon_file_path,omitempty"` - - IconType ProviderIconType `json:"icon_type,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *ProviderIconFile) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s ProviderIconFile) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) -} - -type ProviderIconType string - -const ProviderIconTypeDark ProviderIconType = `DARK` - -const ProviderIconTypePrimary ProviderIconType = `PRIMARY` - -const ProviderIconTypeProviderIconTypeUnspecified ProviderIconType = `PROVIDER_ICON_TYPE_UNSPECIFIED` - -// String representation for [fmt.Print] -func (f *ProviderIconType) String() string { - return string(*f) -} - -// Set raw string value and validate it against allowed values -func (f *ProviderIconType) Set(v string) error { - switch v { - case `DARK`, `PRIMARY`, `PROVIDER_ICON_TYPE_UNSPECIFIED`: - *f = ProviderIconType(v) - return nil - default: - return fmt.Errorf(`value "%s" is not one of "DARK", "PRIMARY", "PROVIDER_ICON_TYPE_UNSPECIFIED"`, v) - } -} - -// Type always returns ProviderIconType to satisfy [pflag.Value] interface -func (f *ProviderIconType) Type() string { - return "ProviderIconType" -} - type ProviderInfo struct { BusinessContactEmail string `json:"business_contact_email"` @@ -1846,26 +1796,6 @@ func (s ProviderInfo) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } -// we can not use just ProviderListingSummary since we already have same name on -// entity side of the state -type ProviderListingSummaryInfo struct { - Description string `json:"description,omitempty"` - - IconFiles []ProviderIconFile `json:"icon_files,omitempty"` - - Name string `json:"name,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *ProviderListingSummaryInfo) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s ProviderListingSummaryInfo) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) -} - type RegionInfo struct { Cloud string `json:"cloud,omitempty"` diff --git a/service/pkg.go b/service/pkg.go index ab8d6c4c3..85d379413 100644 --- a/service/pkg.go +++ b/service/pkg.go @@ -64,6 +64,8 @@ // // - [provisioning.EncryptionKeysAPI]: These APIs manage encryption key configurations for this workspace (optional). // +// - [catalog.EndpointsAPI]: Endpoints are used to connect to PG clusters. +// // - [settings.EnhancedSecurityMonitoringAPI]: Controls whether enhanced security monitoring is enabled for the current workspace. // // - [settings.EsmEnablementAccountAPI]: The enhanced security monitoring setting at the account level controls whether to enable the feature on new workspaces. @@ -289,6 +291,7 @@ var ( _ *sql.DbsqlPermissionsAPI = nil _ *settings.DefaultNamespaceAPI = nil _ *provisioning.EncryptionKeysAPI = nil + _ *catalog.EndpointsAPI = nil _ *settings.EnhancedSecurityMonitoringAPI = nil _ *settings.EsmEnablementAccountAPI = nil _ *ml.ExperimentsAPI = nil diff --git a/service/serving/api.go b/service/serving/api.go index 051f0bec2..cda65bc75 100755 --- a/service/serving/api.go +++ b/service/serving/api.go @@ -134,11 +134,6 @@ type AppsInterface interface { // Lists all app deployments for the app with the supplied name. ListDeploymentsByAppName(ctx context.Context, appName string) (*ListAppDeploymentsResponse, error) - // Start an app. - // - // Start the last active deployment of the app in the workspace. - Start(ctx context.Context, request StartAppRequest) (*AppDeployment, error) - // Stop an app. // // Stops the active deployment of the app in the workspace. @@ -544,13 +539,6 @@ func (a *AppsAPI) ListDeploymentsByAppName(ctx context.Context, appName string) }) } -// Start an app. -// -// Start the last active deployment of the app in the workspace. -func (a *AppsAPI) Start(ctx context.Context, request StartAppRequest) (*AppDeployment, error) { - return a.impl.Start(ctx, request) -} - // Stop an app. // // Stops the active deployment of the app in the workspace. diff --git a/service/serving/impl.go b/service/serving/impl.go index 7b1cefe3f..65dd0f465 100755 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -94,16 +94,6 @@ func (a *appsImpl) ListDeployments(ctx context.Context, request ListAppDeploymen return &listAppDeploymentsResponse, err } -func (a *appsImpl) Start(ctx context.Context, request StartAppRequest) (*AppDeployment, error) { - var appDeployment AppDeployment - path := fmt.Sprintf("/api/2.0/preview/apps/%v/start", request.Name) - headers := make(map[string]string) - headers["Accept"] = "application/json" - headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &appDeployment) - return &appDeployment, err -} - func (a *appsImpl) Stop(ctx context.Context, request StopAppRequest) error { var stopAppResponse StopAppResponse path := fmt.Sprintf("/api/2.0/preview/apps/%v/stop", request.Name) diff --git a/service/serving/interface.go b/service/serving/interface.go index 727ce8876..5de0c60ee 100755 --- a/service/serving/interface.go +++ b/service/serving/interface.go @@ -56,11 +56,6 @@ type AppsService interface { // Use ListDeploymentsAll() to get all AppDeployment instances, which will iterate over every result page. ListDeployments(ctx context.Context, request ListAppDeploymentsRequest) (*ListAppDeploymentsResponse, error) - // Start an app. - // - // Start the last active deployment of the app in the workspace. - Start(ctx context.Context, request StartAppRequest) (*AppDeployment, error) - // Stop an app. // // Stops the active deployment of the app in the workspace. diff --git a/service/serving/model.go b/service/serving/model.go index 44b9bb9f5..472d7a34d 100755 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -298,15 +298,16 @@ func (s AppStatus) MarshalJSON() ([]byte, error) { type AutoCaptureConfigInput struct { // The name of the catalog in Unity Catalog. NOTE: On update, you cannot - // change the catalog name if the inference table is already enabled. + // change the catalog name if it was already set. CatalogName string `json:"catalog_name,omitempty"` - // Indicates whether the inference table is enabled. + // If inference tables are enabled or not. NOTE: If you have already + // disabled payload logging once, you cannot enable again. Enabled bool `json:"enabled,omitempty"` // The name of the schema in Unity Catalog. NOTE: On update, you cannot - // change the schema name if the inference table is already enabled. + // change the schema name if it was already set. SchemaName string `json:"schema_name,omitempty"` // The prefix of the table in Unity Catalog. NOTE: On update, you cannot - // change the prefix name if the inference table is already enabled. + // change the prefix name if it was already set. TableNamePrefix string `json:"table_name_prefix,omitempty"` ForceSendFields []string `json:"-"` @@ -323,7 +324,7 @@ func (s AutoCaptureConfigInput) MarshalJSON() ([]byte, error) { type AutoCaptureConfigOutput struct { // The name of the catalog in Unity Catalog. CatalogName string `json:"catalog_name,omitempty"` - // Indicates whether the inference table is enabled. + // If inference tables are enabled or not. Enabled bool `json:"enabled,omitempty"` // The name of the schema in Unity Catalog. SchemaName string `json:"schema_name,omitempty"` @@ -2012,11 +2013,6 @@ type ServingEndpointPermissionsRequest struct { ServingEndpointId string `json:"-" url:"-"` } -type StartAppRequest struct { - // The name of the app. - Name string `json:"-" url:"-"` -} - type StopAppRequest struct { // The name of the app. Name string `json:"-" url:"-"` diff --git a/service/settings/model.go b/service/settings/model.go index 418e66ab5..7c096b930 100755 --- a/service/settings/model.go +++ b/service/settings/model.go @@ -247,8 +247,6 @@ type ComplianceStandard string const ComplianceStandardComplianceStandardUnspecified ComplianceStandard = `COMPLIANCE_STANDARD_UNSPECIFIED` -const ComplianceStandardCyberEssentialPlus ComplianceStandard = `CYBER_ESSENTIAL_PLUS` - const ComplianceStandardFedrampHigh ComplianceStandard = `FEDRAMP_HIGH` const ComplianceStandardFedrampIl5 ComplianceStandard = `FEDRAMP_IL5` @@ -273,11 +271,11 @@ func (f *ComplianceStandard) String() string { // Set raw string value and validate it against allowed values func (f *ComplianceStandard) Set(v string) error { switch v { - case `COMPLIANCE_STANDARD_UNSPECIFIED`, `CYBER_ESSENTIAL_PLUS`, `FEDRAMP_HIGH`, `FEDRAMP_IL5`, `FEDRAMP_MODERATE`, `HIPAA`, `IRAP_PROTECTED`, `ITAR_EAR`, `NONE`, `PCI_DSS`: + case `COMPLIANCE_STANDARD_UNSPECIFIED`, `FEDRAMP_HIGH`, `FEDRAMP_IL5`, `FEDRAMP_MODERATE`, `HIPAA`, `IRAP_PROTECTED`, `ITAR_EAR`, `NONE`, `PCI_DSS`: *f = ComplianceStandard(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "COMPLIANCE_STANDARD_UNSPECIFIED", "CYBER_ESSENTIAL_PLUS", "FEDRAMP_HIGH", "FEDRAMP_IL5", "FEDRAMP_MODERATE", "HIPAA", "IRAP_PROTECTED", "ITAR_EAR", "NONE", "PCI_DSS"`, v) + return fmt.Errorf(`value "%s" is not one of "COMPLIANCE_STANDARD_UNSPECIFIED", "FEDRAMP_HIGH", "FEDRAMP_IL5", "FEDRAMP_MODERATE", "HIPAA", "IRAP_PROTECTED", "ITAR_EAR", "NONE", "PCI_DSS"`, v) } } diff --git a/service/sharing/model.go b/service/sharing/model.go index f6385d15d..617fefb13 100755 --- a/service/sharing/model.go +++ b/service/sharing/model.go @@ -749,6 +749,8 @@ const PrivilegeSelect Privilege = `SELECT` const PrivilegeSetSharePermission Privilege = `SET_SHARE_PERMISSION` +const PrivilegeSingleUserAccess Privilege = `SINGLE_USER_ACCESS` + const PrivilegeUsage Privilege = `USAGE` const PrivilegeUseCatalog Privilege = `USE_CATALOG` @@ -779,11 +781,11 @@ func (f *Privilege) String() string { // Set raw string value and validate it against allowed values func (f *Privilege) Set(v string) error { switch v { - case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: + case `ACCESS`, `ALL_PRIVILEGES`, `APPLY_TAG`, `CREATE`, `CREATE_CATALOG`, `CREATE_CONNECTION`, `CREATE_EXTERNAL_LOCATION`, `CREATE_EXTERNAL_TABLE`, `CREATE_EXTERNAL_VOLUME`, `CREATE_FOREIGN_CATALOG`, `CREATE_FUNCTION`, `CREATE_MANAGED_STORAGE`, `CREATE_MATERIALIZED_VIEW`, `CREATE_MODEL`, `CREATE_PROVIDER`, `CREATE_RECIPIENT`, `CREATE_SCHEMA`, `CREATE_SERVICE_CREDENTIAL`, `CREATE_SHARE`, `CREATE_STORAGE_CREDENTIAL`, `CREATE_TABLE`, `CREATE_VIEW`, `CREATE_VOLUME`, `EXECUTE`, `MANAGE_ALLOWLIST`, `MODIFY`, `READ_FILES`, `READ_PRIVATE_FILES`, `READ_VOLUME`, `REFRESH`, `SELECT`, `SET_SHARE_PERMISSION`, `SINGLE_USER_ACCESS`, `USAGE`, `USE_CATALOG`, `USE_CONNECTION`, `USE_MARKETPLACE_ASSETS`, `USE_PROVIDER`, `USE_RECIPIENT`, `USE_SCHEMA`, `USE_SHARE`, `WRITE_FILES`, `WRITE_PRIVATE_FILES`, `WRITE_VOLUME`: *f = Privilege(v) return nil default: - return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) + return fmt.Errorf(`value "%s" is not one of "ACCESS", "ALL_PRIVILEGES", "APPLY_TAG", "CREATE", "CREATE_CATALOG", "CREATE_CONNECTION", "CREATE_EXTERNAL_LOCATION", "CREATE_EXTERNAL_TABLE", "CREATE_EXTERNAL_VOLUME", "CREATE_FOREIGN_CATALOG", "CREATE_FUNCTION", "CREATE_MANAGED_STORAGE", "CREATE_MATERIALIZED_VIEW", "CREATE_MODEL", "CREATE_PROVIDER", "CREATE_RECIPIENT", "CREATE_SCHEMA", "CREATE_SERVICE_CREDENTIAL", "CREATE_SHARE", "CREATE_STORAGE_CREDENTIAL", "CREATE_TABLE", "CREATE_VIEW", "CREATE_VOLUME", "EXECUTE", "MANAGE_ALLOWLIST", "MODIFY", "READ_FILES", "READ_PRIVATE_FILES", "READ_VOLUME", "REFRESH", "SELECT", "SET_SHARE_PERMISSION", "SINGLE_USER_ACCESS", "USAGE", "USE_CATALOG", "USE_CONNECTION", "USE_MARKETPLACE_ASSETS", "USE_PROVIDER", "USE_RECIPIENT", "USE_SCHEMA", "USE_SHARE", "WRITE_FILES", "WRITE_PRIVATE_FILES", "WRITE_VOLUME"`, v) } } diff --git a/service/sql/api.go b/service/sql/api.go index bd18788f6..09a8f0547 100755 --- a/service/sql/api.go +++ b/service/sql/api.go @@ -29,65 +29,35 @@ type AlertsInterface interface { // Creates an alert. An alert is a Databricks SQL object that periodically runs // a query, evaluates a condition of its result, and notifies users or // notification destinations if the condition was met. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Create(ctx context.Context, request CreateAlert) (*Alert, error) // Delete an alert. // // Deletes an alert. Deleted alerts are no longer accessible and cannot be - // restored. **Note**: Unlike queries and dashboards, alerts cannot be moved to + // restored. **Note:** Unlike queries and dashboards, alerts cannot be moved to // the trash. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Delete(ctx context.Context, request DeleteAlertRequest) error // Delete an alert. // // Deletes an alert. Deleted alerts are no longer accessible and cannot be - // restored. **Note**: Unlike queries and dashboards, alerts cannot be moved to + // restored. **Note:** Unlike queries and dashboards, alerts cannot be moved to // the trash. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources DeleteByAlertId(ctx context.Context, alertId string) error // Get an alert. // // Gets an alert. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Get(ctx context.Context, request GetAlertRequest) (*Alert, error) // Get an alert. // // Gets an alert. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources GetByAlertId(ctx context.Context, alertId string) (*Alert, error) // Get alerts. // // Gets a list of alerts. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources List(ctx context.Context) ([]Alert, error) // AlertNameToIdMap calls [AlertsAPI.List] and creates a map of results with [Alert].Name as key and [Alert].Id as value. @@ -111,11 +81,6 @@ type AlertsInterface interface { // Update an alert. // // Updates an alert. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Update(ctx context.Context, request EditAlert) error } @@ -132,11 +97,6 @@ func NewAlerts(client *client.DatabricksClient) *AlertsAPI { // of its result, and notifies one or more users and/or notification // destinations if the condition was met. Alerts can be scheduled using the // `sql_task` type of the Jobs API, e.g. :method:jobs/create. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type AlertsAPI struct { // impl contains low-level REST API interface, that could be overridden // through WithImpl(AlertsService) @@ -162,11 +122,6 @@ func (a *AlertsAPI) Impl() AlertsService { // Creates an alert. An alert is a Databricks SQL object that periodically runs // a query, evaluates a condition of its result, and notifies users or // notification destinations if the condition was met. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *AlertsAPI) Create(ctx context.Context, request CreateAlert) (*Alert, error) { return a.impl.Create(ctx, request) } @@ -174,13 +129,8 @@ func (a *AlertsAPI) Create(ctx context.Context, request CreateAlert) (*Alert, er // Delete an alert. // // Deletes an alert. Deleted alerts are no longer accessible and cannot be -// restored. **Note**: Unlike queries and dashboards, alerts cannot be moved to +// restored. **Note:** Unlike queries and dashboards, alerts cannot be moved to // the trash. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *AlertsAPI) Delete(ctx context.Context, request DeleteAlertRequest) error { return a.impl.Delete(ctx, request) } @@ -188,13 +138,8 @@ func (a *AlertsAPI) Delete(ctx context.Context, request DeleteAlertRequest) erro // Delete an alert. // // Deletes an alert. Deleted alerts are no longer accessible and cannot be -// restored. **Note**: Unlike queries and dashboards, alerts cannot be moved to +// restored. **Note:** Unlike queries and dashboards, alerts cannot be moved to // the trash. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *AlertsAPI) DeleteByAlertId(ctx context.Context, alertId string) error { return a.impl.Delete(ctx, DeleteAlertRequest{ AlertId: alertId, @@ -204,11 +149,6 @@ func (a *AlertsAPI) DeleteByAlertId(ctx context.Context, alertId string) error { // Get an alert. // // Gets an alert. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *AlertsAPI) Get(ctx context.Context, request GetAlertRequest) (*Alert, error) { return a.impl.Get(ctx, request) } @@ -216,11 +156,6 @@ func (a *AlertsAPI) Get(ctx context.Context, request GetAlertRequest) (*Alert, e // Get an alert. // // Gets an alert. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *AlertsAPI) GetByAlertId(ctx context.Context, alertId string) (*Alert, error) { return a.impl.Get(ctx, GetAlertRequest{ AlertId: alertId, @@ -230,11 +165,6 @@ func (a *AlertsAPI) GetByAlertId(ctx context.Context, alertId string) (*Alert, e // Get alerts. // // Gets a list of alerts. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *AlertsAPI) List(ctx context.Context) ([]Alert, error) { return a.impl.List(ctx) } @@ -295,11 +225,6 @@ func (a *AlertsAPI) GetByName(ctx context.Context, name string) (*Alert, error) // Update an alert. // // Updates an alert. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *AlertsAPI) Update(ctx context.Context, request EditAlert) error { return a.impl.Update(ctx, request) } @@ -421,8 +346,8 @@ type DashboardsInterface interface { // // Fetch a paginated list of dashboard objects. // - // **Warning**: Calling this API concurrently 10 or more times could result in - // throttling, service degradation, or a temporary ban. + // ### **Warning: Calling this API concurrently 10 or more times could result in + // throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. List(ctx context.Context, request ListDashboardsRequest) listing.Iterator[Dashboard] @@ -431,8 +356,8 @@ type DashboardsInterface interface { // // Fetch a paginated list of dashboard objects. // - // **Warning**: Calling this API concurrently 10 or more times could result in - // throttling, service degradation, or a temporary ban. + // ### **Warning: Calling this API concurrently 10 or more times could result in + // throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. ListAll(ctx context.Context, request ListDashboardsRequest) ([]Dashboard, error) @@ -548,8 +473,8 @@ func (a *DashboardsAPI) GetByDashboardId(ctx context.Context, dashboardId string // // Fetch a paginated list of dashboard objects. // -// **Warning**: Calling this API concurrently 10 or more times could result in -// throttling, service degradation, or a temporary ban. +// ### **Warning: Calling this API concurrently 10 or more times could result in +// throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. func (a *DashboardsAPI) List(ctx context.Context, request ListDashboardsRequest) listing.Iterator[Dashboard] { @@ -587,8 +512,8 @@ func (a *DashboardsAPI) List(ctx context.Context, request ListDashboardsRequest) // // Fetch a paginated list of dashboard objects. // -// **Warning**: Calling this API concurrently 10 or more times could result in -// throttling, service degradation, or a temporary ban. +// ### **Warning: Calling this API concurrently 10 or more times could result in +// throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. func (a *DashboardsAPI) ListAll(ctx context.Context, request ListDashboardsRequest) ([]Dashboard, error) { @@ -682,11 +607,6 @@ type DataSourcesInterface interface { // Retrieves a full list of SQL warehouses available in this workspace. All // fields that appear in this API response are enumerated for clarity. However, // you need only a SQL warehouse's `id` to create new queries against it. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources List(ctx context.Context) ([]DataSource, error) // DataSourceNameToIdMap calls [DataSourcesAPI.List] and creates a map of results with [DataSource].Name as key and [DataSource].Id as value. @@ -726,11 +646,6 @@ func NewDataSources(client *client.DatabricksClient) *DataSourcesAPI { // warehouses in your workspace. We advise you to use any text editor, REST // client, or `grep` to search the response from this API for the name of your // SQL warehouse as it appears in Databricks SQL. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type DataSourcesAPI struct { // impl contains low-level REST API interface, that could be overridden // through WithImpl(DataSourcesService) @@ -756,11 +671,6 @@ func (a *DataSourcesAPI) Impl() DataSourcesService { // Retrieves a full list of SQL warehouses available in this workspace. All // fields that appear in this API response are enumerated for clarity. However, // you need only a SQL warehouse's `id` to create new queries against it. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *DataSourcesAPI) List(ctx context.Context) ([]DataSource, error) { return a.impl.List(ctx) } @@ -832,44 +742,24 @@ type DbsqlPermissionsInterface interface { // // Gets a JSON representation of the access control list (ACL) for a specified // object. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Get(ctx context.Context, request GetDbsqlPermissionRequest) (*GetResponse, error) // Get object ACL. // // Gets a JSON representation of the access control list (ACL) for a specified // object. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources GetByObjectTypeAndObjectId(ctx context.Context, objectType ObjectTypePlural, objectId string) (*GetResponse, error) // Set object ACL. // // Sets the access control list (ACL) for a specified object. This operation // will complete rewrite the ACL. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Set(ctx context.Context, request SetRequest) (*SetResponse, error) // Transfer object ownership. // // Transfers ownership of a dashboard, query, or alert to an active user. // Requires an admin API key. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources TransferOwnership(ctx context.Context, request TransferOwnershipRequest) (*Success, error) } @@ -894,11 +784,6 @@ func NewDbsqlPermissions(client *client.DatabricksClient) *DbsqlPermissionsAPI { // // - `CAN_MANAGE`: Allows all actions: read, run, edit, delete, modify // permissions (superset of `CAN_RUN`) -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type DbsqlPermissionsAPI struct { // impl contains low-level REST API interface, that could be overridden // through WithImpl(DbsqlPermissionsService) @@ -923,11 +808,6 @@ func (a *DbsqlPermissionsAPI) Impl() DbsqlPermissionsService { // // Gets a JSON representation of the access control list (ACL) for a specified // object. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *DbsqlPermissionsAPI) Get(ctx context.Context, request GetDbsqlPermissionRequest) (*GetResponse, error) { return a.impl.Get(ctx, request) } @@ -936,11 +816,6 @@ func (a *DbsqlPermissionsAPI) Get(ctx context.Context, request GetDbsqlPermissio // // Gets a JSON representation of the access control list (ACL) for a specified // object. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *DbsqlPermissionsAPI) GetByObjectTypeAndObjectId(ctx context.Context, objectType ObjectTypePlural, objectId string) (*GetResponse, error) { return a.impl.Get(ctx, GetDbsqlPermissionRequest{ ObjectType: objectType, @@ -952,11 +827,6 @@ func (a *DbsqlPermissionsAPI) GetByObjectTypeAndObjectId(ctx context.Context, ob // // Sets the access control list (ACL) for a specified object. This operation // will complete rewrite the ACL. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *DbsqlPermissionsAPI) Set(ctx context.Context, request SetRequest) (*SetResponse, error) { return a.impl.Set(ctx, request) } @@ -965,11 +835,6 @@ func (a *DbsqlPermissionsAPI) Set(ctx context.Context, request SetRequest) (*Set // // Transfers ownership of a dashboard, query, or alert to an active user. // Requires an admin API key. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *DbsqlPermissionsAPI) TransferOwnership(ctx context.Context, request TransferOwnershipRequest) (*Success, error) { return a.impl.TransferOwnership(ctx, request) } @@ -995,11 +860,6 @@ type QueriesInterface interface { // existing query. // // **Note**: You cannot add a visualization until you create the query. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Create(ctx context.Context, request QueryPostContent) (*Query, error) // Delete a query. @@ -1007,11 +867,6 @@ type QueriesInterface interface { // Moves a query to the trash. Trashed queries immediately disappear from // searches and list views, and they cannot be used for alerts. The trash is // deleted after 30 days. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Delete(ctx context.Context, request DeleteQueryRequest) error // Delete a query. @@ -1019,33 +874,18 @@ type QueriesInterface interface { // Moves a query to the trash. Trashed queries immediately disappear from // searches and list views, and they cannot be used for alerts. The trash is // deleted after 30 days. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources DeleteByQueryId(ctx context.Context, queryId string) error // Get a query definition. // // Retrieve a query object definition along with contextual permissions // information about the currently authenticated user. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Get(ctx context.Context, request GetQueryRequest) (*Query, error) // Get a query definition. // // Retrieve a query object definition along with contextual permissions // information about the currently authenticated user. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources GetByQueryId(ctx context.Context, queryId string) (*Query, error) // Get a list of queries. @@ -1053,13 +893,8 @@ type QueriesInterface interface { // Gets a list of queries. Optionally, this list can be filtered by a search // term. // - // **Warning**: Calling this API concurrently 10 or more times could result in - // throttling, service degradation, or a temporary ban. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources + // ### **Warning: Calling this API concurrently 10 or more times could result in + // throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. List(ctx context.Context, request ListQueriesRequest) listing.Iterator[Query] @@ -1069,13 +904,8 @@ type QueriesInterface interface { // Gets a list of queries. Optionally, this list can be filtered by a search // term. // - // **Warning**: Calling this API concurrently 10 or more times could result in - // throttling, service degradation, or a temporary ban. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources + // ### **Warning: Calling this API concurrently 10 or more times could result in + // throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. ListAll(ctx context.Context, request ListQueriesRequest) ([]Query, error) @@ -1102,11 +932,6 @@ type QueriesInterface interface { // // Restore a query that has been moved to the trash. A restored query appears in // list views and searches. You can use restored queries for alerts. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Restore(ctx context.Context, request RestoreQueryRequest) error // Change a query definition. @@ -1114,11 +939,6 @@ type QueriesInterface interface { // Modify this query definition. // // **Note**: You cannot undo this operation. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Update(ctx context.Context, request QueryEditContent) (*Query, error) } @@ -1134,11 +954,6 @@ func NewQueries(client *client.DatabricksClient) *QueriesAPI { // definitions include the target SQL warehouse, query text, name, description, // tags, parameters, and visualizations. Queries can be scheduled using the // `sql_task` type of the Jobs API, e.g. :method:jobs/create. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type QueriesAPI struct { // impl contains low-level REST API interface, that could be overridden // through WithImpl(QueriesService) @@ -1170,11 +985,6 @@ func (a *QueriesAPI) Impl() QueriesService { // existing query. // // **Note**: You cannot add a visualization until you create the query. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) Create(ctx context.Context, request QueryPostContent) (*Query, error) { return a.impl.Create(ctx, request) } @@ -1184,11 +994,6 @@ func (a *QueriesAPI) Create(ctx context.Context, request QueryPostContent) (*Que // Moves a query to the trash. Trashed queries immediately disappear from // searches and list views, and they cannot be used for alerts. The trash is // deleted after 30 days. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) Delete(ctx context.Context, request DeleteQueryRequest) error { return a.impl.Delete(ctx, request) } @@ -1198,11 +1003,6 @@ func (a *QueriesAPI) Delete(ctx context.Context, request DeleteQueryRequest) err // Moves a query to the trash. Trashed queries immediately disappear from // searches and list views, and they cannot be used for alerts. The trash is // deleted after 30 days. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) DeleteByQueryId(ctx context.Context, queryId string) error { return a.impl.Delete(ctx, DeleteQueryRequest{ QueryId: queryId, @@ -1213,11 +1013,6 @@ func (a *QueriesAPI) DeleteByQueryId(ctx context.Context, queryId string) error // // Retrieve a query object definition along with contextual permissions // information about the currently authenticated user. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) Get(ctx context.Context, request GetQueryRequest) (*Query, error) { return a.impl.Get(ctx, request) } @@ -1226,11 +1021,6 @@ func (a *QueriesAPI) Get(ctx context.Context, request GetQueryRequest) (*Query, // // Retrieve a query object definition along with contextual permissions // information about the currently authenticated user. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) GetByQueryId(ctx context.Context, queryId string) (*Query, error) { return a.impl.Get(ctx, GetQueryRequest{ QueryId: queryId, @@ -1242,15 +1032,10 @@ func (a *QueriesAPI) GetByQueryId(ctx context.Context, queryId string) (*Query, // Gets a list of queries. Optionally, this list can be filtered by a search // term. // -// **Warning**: Calling this API concurrently 10 or more times could result in -// throttling, service degradation, or a temporary ban. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] +// ### **Warning: Calling this API concurrently 10 or more times could result in +// throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) List(ctx context.Context, request ListQueriesRequest) listing.Iterator[Query] { request.Page = 1 // start iterating from the first page @@ -1287,15 +1072,10 @@ func (a *QueriesAPI) List(ctx context.Context, request ListQueriesRequest) listi // Gets a list of queries. Optionally, this list can be filtered by a search // term. // -// **Warning**: Calling this API concurrently 10 or more times could result in -// throttling, service degradation, or a temporary ban. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] +// ### **Warning: Calling this API concurrently 10 or more times could result in +// throttling, service degradation, or a temporary ban.** // // This method is generated by Databricks SDK Code Generator. -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) ListAll(ctx context.Context, request ListQueriesRequest) ([]Query, error) { iterator := a.List(ctx, request) return listing.ToSliceN[Query, int](ctx, iterator, request.PageSize) @@ -1359,11 +1139,6 @@ func (a *QueriesAPI) GetByName(ctx context.Context, name string) (*Query, error) // // Restore a query that has been moved to the trash. A restored query appears in // list views and searches. You can use restored queries for alerts. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) Restore(ctx context.Context, request RestoreQueryRequest) error { return a.impl.Restore(ctx, request) } @@ -1373,11 +1148,6 @@ func (a *QueriesAPI) Restore(ctx context.Context, request RestoreQueryRequest) e // Modify this query definition. // // **Note**: You cannot undo this operation. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources func (a *QueriesAPI) Update(ctx context.Context, request QueryEditContent) (*Query, error) { return a.impl.Update(ctx, request) } diff --git a/service/sql/interface.go b/service/sql/interface.go index be39220e3..d7df019aa 100755 --- a/service/sql/interface.go +++ b/service/sql/interface.go @@ -11,11 +11,6 @@ import ( // of its result, and notifies one or more users and/or notification // destinations if the condition was met. Alerts can be scheduled using the // `sql_task` type of the Jobs API, e.g. :method:jobs/create. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type AlertsService interface { // Create an alert. @@ -23,53 +18,28 @@ type AlertsService interface { // Creates an alert. An alert is a Databricks SQL object that periodically // runs a query, evaluates a condition of its result, and notifies users or // notification destinations if the condition was met. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Create(ctx context.Context, request CreateAlert) (*Alert, error) // Delete an alert. // // Deletes an alert. Deleted alerts are no longer accessible and cannot be - // restored. **Note**: Unlike queries and dashboards, alerts cannot be moved + // restored. **Note:** Unlike queries and dashboards, alerts cannot be moved // to the trash. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Delete(ctx context.Context, request DeleteAlertRequest) error // Get an alert. // // Gets an alert. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Get(ctx context.Context, request GetAlertRequest) (*Alert, error) // Get alerts. // // Gets a list of alerts. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources List(ctx context.Context) ([]Alert, error) // Update an alert. // // Updates an alert. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Update(ctx context.Context, request EditAlert) error } @@ -115,8 +85,8 @@ type DashboardsService interface { // // Fetch a paginated list of dashboard objects. // - // **Warning**: Calling this API concurrently 10 or more times could result - // in throttling, service degradation, or a temporary ban. + // ### **Warning: Calling this API concurrently 10 or more times could + // result in throttling, service degradation, or a temporary ban.** // // Use ListAll() to get all Dashboard instances, which will iterate over every result page. List(ctx context.Context, request ListDashboardsRequest) (*ListResponse, error) @@ -146,11 +116,6 @@ type DashboardsService interface { // warehouses in your workspace. We advise you to use any text editor, REST // client, or `grep` to search the response from this API for the name of your // SQL warehouse as it appears in Databricks SQL. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type DataSourcesService interface { // Get a list of SQL warehouses. @@ -159,11 +124,6 @@ type DataSourcesService interface { // fields that appear in this API response are enumerated for clarity. // However, you need only a SQL warehouse's `id` to create new queries // against it. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources List(ctx context.Context) ([]DataSource, error) } @@ -180,44 +140,24 @@ type DataSourcesService interface { // // - `CAN_MANAGE`: Allows all actions: read, run, edit, delete, modify // permissions (superset of `CAN_RUN`) -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type DbsqlPermissionsService interface { // Get object ACL. // // Gets a JSON representation of the access control list (ACL) for a // specified object. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Get(ctx context.Context, request GetDbsqlPermissionRequest) (*GetResponse, error) // Set object ACL. // // Sets the access control list (ACL) for a specified object. This operation // will complete rewrite the ACL. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Set(ctx context.Context, request SetRequest) (*SetResponse, error) // Transfer object ownership. // // Transfers ownership of a dashboard, query, or alert to an active user. // Requires an admin API key. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources TransferOwnership(ctx context.Context, request TransferOwnershipRequest) (*Success, error) } @@ -225,11 +165,6 @@ type DbsqlPermissionsService interface { // definitions include the target SQL warehouse, query text, name, description, // tags, parameters, and visualizations. Queries can be scheduled using the // `sql_task` type of the Jobs API, e.g. :method:jobs/create. -// -// **Note**: A new version of the Databricks SQL API will soon be available. -// [Learn more] -// -// [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources type QueriesService interface { // Create a new query definition. @@ -243,11 +178,6 @@ type QueriesService interface { // from an existing query. // // **Note**: You cannot add a visualization until you create the query. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Create(ctx context.Context, request QueryPostContent) (*Query, error) // Delete a query. @@ -255,22 +185,12 @@ type QueriesService interface { // Moves a query to the trash. Trashed queries immediately disappear from // searches and list views, and they cannot be used for alerts. The trash is // deleted after 30 days. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Delete(ctx context.Context, request DeleteQueryRequest) error // Get a query definition. // // Retrieve a query object definition along with contextual permissions // information about the currently authenticated user. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Get(ctx context.Context, request GetQueryRequest) (*Query, error) // Get a list of queries. @@ -278,13 +198,8 @@ type QueriesService interface { // Gets a list of queries. Optionally, this list can be filtered by a search // term. // - // **Warning**: Calling this API concurrently 10 or more times could result - // in throttling, service degradation, or a temporary ban. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources + // ### **Warning: Calling this API concurrently 10 or more times could + // result in throttling, service degradation, or a temporary ban.** // // Use ListAll() to get all Query instances, which will iterate over every result page. List(ctx context.Context, request ListQueriesRequest) (*QueryList, error) @@ -294,11 +209,6 @@ type QueriesService interface { // Restore a query that has been moved to the trash. A restored query // appears in list views and searches. You can use restored queries for // alerts. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Restore(ctx context.Context, request RestoreQueryRequest) error // Change a query definition. @@ -306,11 +216,6 @@ type QueriesService interface { // Modify this query definition. // // **Note**: You cannot undo this operation. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Update(ctx context.Context, request QueryEditContent) (*Query, error) } diff --git a/service/sql/model.go b/service/sql/model.go index 1a21e941d..c7db41440 100755 --- a/service/sql/model.go +++ b/service/sql/model.go @@ -138,7 +138,7 @@ type AlertQuery struct { // The timestamp when this query was created. CreatedAt string `json:"created_at,omitempty"` // Data source ID maps to the ID of the data source used by the resource and - // is distinct from the warehouse ID. [Learn more] + // is distinct from the warehouse ID. [Learn more]. // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list DataSourceId string `json:"data_source_id,omitempty"` @@ -743,7 +743,7 @@ func (s DashboardPostContent) MarshalJSON() ([]byte, error) { // A JSON object representing a DBSQL data source / SQL warehouse. type DataSource struct { // Data source ID maps to the ID of the data source used by the resource and - // is distinct from the warehouse ID. [Learn more] + // is distinct from the warehouse ID. [Learn more]. // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list Id string `json:"id,omitempty"` @@ -2224,7 +2224,7 @@ type Query struct { // The timestamp when this query was created. CreatedAt string `json:"created_at,omitempty"` // Data source ID maps to the ID of the data source used by the resource and - // is distinct from the warehouse ID. [Learn more] + // is distinct from the warehouse ID. [Learn more]. // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list DataSourceId string `json:"data_source_id,omitempty"` @@ -2300,7 +2300,7 @@ func (s Query) MarshalJSON() ([]byte, error) { type QueryEditContent struct { // Data source ID maps to the ID of the data source used by the resource and - // is distinct from the warehouse ID. [Learn more] + // is distinct from the warehouse ID. [Learn more]. // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list DataSourceId string `json:"data_source_id,omitempty"` @@ -2534,7 +2534,7 @@ func (s QueryOptions) MarshalJSON() ([]byte, error) { type QueryPostContent struct { // Data source ID maps to the ID of the data source used by the resource and - // is distinct from the warehouse ID. [Learn more] + // is distinct from the warehouse ID. [Learn more]. // // [Learn more]: https://docs.databricks.com/api/workspace/datasources/list DataSourceId string `json:"data_source_id,omitempty"` diff --git a/service/vectorsearch/api.go b/service/vectorsearch/api.go index 937f0d283..a763a1dbc 100755 --- a/service/vectorsearch/api.go +++ b/service/vectorsearch/api.go @@ -314,12 +314,6 @@ type VectorSearchIndexesInterface interface { // Query the specified vector index. QueryIndex(ctx context.Context, request QueryVectorIndexRequest) (*QueryVectorIndexResponse, error) - // Query next page. - // - // Use `next_page_token` returned from previous `QueryVectorIndex` or - // `QueryVectorIndexNextPage` request to fetch next page of results. - QueryNextPage(ctx context.Context, request QueryVectorIndexNextPageRequest) (*QueryVectorIndexResponse, error) - // Scan an index. // // Scan the specified vector index and return the first `num_results` entries @@ -467,14 +461,6 @@ func (a *VectorSearchIndexesAPI) QueryIndex(ctx context.Context, request QueryVe return a.impl.QueryIndex(ctx, request) } -// Query next page. -// -// Use `next_page_token` returned from previous `QueryVectorIndex` or -// `QueryVectorIndexNextPage` request to fetch next page of results. -func (a *VectorSearchIndexesAPI) QueryNextPage(ctx context.Context, request QueryVectorIndexNextPageRequest) (*QueryVectorIndexResponse, error) { - return a.impl.QueryNextPage(ctx, request) -} - // Scan an index. // // Scan the specified vector index and return the first `num_results` entries diff --git a/service/vectorsearch/impl.go b/service/vectorsearch/impl.go index 92563db06..976099dfa 100755 --- a/service/vectorsearch/impl.go +++ b/service/vectorsearch/impl.go @@ -112,16 +112,6 @@ func (a *vectorSearchIndexesImpl) QueryIndex(ctx context.Context, request QueryV return &queryVectorIndexResponse, err } -func (a *vectorSearchIndexesImpl) QueryNextPage(ctx context.Context, request QueryVectorIndexNextPageRequest) (*QueryVectorIndexResponse, error) { - var queryVectorIndexResponse QueryVectorIndexResponse - path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/query-next-page", request.IndexName) - headers := make(map[string]string) - headers["Accept"] = "application/json" - headers["Content-Type"] = "application/json" - err := a.client.Do(ctx, http.MethodPost, path, headers, request, &queryVectorIndexResponse) - return &queryVectorIndexResponse, err -} - func (a *vectorSearchIndexesImpl) ScanIndex(ctx context.Context, request ScanVectorIndexRequest) (*ScanVectorIndexResponse, error) { var scanVectorIndexResponse ScanVectorIndexResponse path := fmt.Sprintf("/api/2.0/vector-search/indexes/%v/scan", request.IndexName) diff --git a/service/vectorsearch/interface.go b/service/vectorsearch/interface.go index 326f552c8..9c416c3fd 100755 --- a/service/vectorsearch/interface.go +++ b/service/vectorsearch/interface.go @@ -70,12 +70,6 @@ type VectorSearchIndexesService interface { // Query the specified vector index. QueryIndex(ctx context.Context, request QueryVectorIndexRequest) (*QueryVectorIndexResponse, error) - // Query next page. - // - // Use `next_page_token` returned from previous `QueryVectorIndex` or - // `QueryVectorIndexNextPage` request to fetch next page of results. - QueryNextPage(ctx context.Context, request QueryVectorIndexNextPageRequest) (*QueryVectorIndexResponse, error) - // Scan an index. // // Scan the specified vector index and return the first `num_results` diff --git a/service/vectorsearch/model.go b/service/vectorsearch/model.go index d1267893e..b49f15634 100755 --- a/service/vectorsearch/model.go +++ b/service/vectorsearch/model.go @@ -543,27 +543,6 @@ func (f *PipelineType) Type() string { return "PipelineType" } -// Request payload for getting next page of results. -type QueryVectorIndexNextPageRequest struct { - // Name of the endpoint. - EndpointName string `json:"endpoint_name,omitempty"` - // Name of the vector index to query. - IndexName string `json:"-" url:"-"` - // Page token returned from previous `QueryVectorIndex` or - // `QueryVectorIndexNextPage` API. - PageToken string `json:"page_token,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *QueryVectorIndexNextPageRequest) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s QueryVectorIndexNextPageRequest) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) -} - type QueryVectorIndexRequest struct { // List of column names to include in the response. Columns []string `json:"columns"` @@ -602,22 +581,8 @@ func (s QueryVectorIndexRequest) MarshalJSON() ([]byte, error) { type QueryVectorIndexResponse struct { // Metadata about the result set. Manifest *ResultManifest `json:"manifest,omitempty"` - // [Optional] Token that can be used in `QueryVectorIndexNextPage` API to - // get next page of results. If more than 1000 results satisfy the query, - // they are returned in groups of 1000. Empty value means no more results. - NextPageToken string `json:"next_page_token,omitempty"` // Data returned in the query result. Result *ResultData `json:"result,omitempty"` - - ForceSendFields []string `json:"-"` -} - -func (s *QueryVectorIndexResponse) UnmarshalJSON(b []byte) error { - return marshal.Unmarshal(b, s) -} - -func (s QueryVectorIndexResponse) MarshalJSON() ([]byte, error) { - return marshal.Marshal(s) } // Data returned in the query result. diff --git a/workspace_client.go b/workspace_client.go index 9d32b1547..906dedfd9 100755 --- a/workspace_client.go +++ b/workspace_client.go @@ -42,11 +42,6 @@ type WorkspaceClient struct { // notification destinations if the condition was met. Alerts can be // scheduled using the `sql_task` type of the Jobs API, e.g. // :method:jobs/create. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Alerts sql.AlertsInterface // Apps run directly on a customer’s Databricks instance, integrate with @@ -199,11 +194,6 @@ type WorkspaceClient struct { // warehouses in your workspace. We advise you to use any text editor, REST // client, or `grep` to search the response from this API for the name of // your SQL warehouse as it appears in Databricks SQL. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources DataSources sql.DataSourcesInterface // DBFS API makes it simple to interact with various data sources without @@ -223,13 +213,11 @@ type WorkspaceClient struct { // // - `CAN_MANAGE`: Allows all actions: read, run, edit, delete, modify // permissions (superset of `CAN_RUN`) - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources DbsqlPermissions sql.DbsqlPermissionsInterface + // Endpoints are used to connect to PG clusters. + Endpoints catalog.EndpointsInterface + // Experiments are the primary unit of organization in MLflow; all MLflow // runs belong to an experiment. Each experiment lets you visualize, search, // and compare runs, as well as download run artifacts or metadata for @@ -594,11 +582,6 @@ type WorkspaceClient struct { // description, tags, parameters, and visualizations. Queries can be // scheduled using the `sql_task` type of the Jobs API, e.g. // :method:jobs/create. - // - // **Note**: A new version of the Databricks SQL API will soon be available. - // [Learn more] - // - // [Learn more]: https://docs.databricks.com/en/whats-coming.html#updates-to-the-databricks-sql-api-for-managing-queries-alerts-and-data-sources Queries sql.QueriesInterface // Access the history of queries through SQL warehouses. @@ -1050,6 +1033,7 @@ func NewWorkspaceClient(c ...*Config) (*WorkspaceClient, error) { DataSources: sql.NewDataSources(databricksClient), Dbfs: files.NewDbfs(databricksClient), DbsqlPermissions: sql.NewDbsqlPermissions(databricksClient), + Endpoints: catalog.NewEndpoints(databricksClient), Experiments: ml.NewExperiments(databricksClient), ExternalLocations: catalog.NewExternalLocations(databricksClient), Files: files.NewFiles(databricksClient),