diff --git a/.codegen/_openapi_sha b/.codegen/_openapi_sha index 74d67612d..93fcd45da 100644 --- a/.codegen/_openapi_sha +++ b/.codegen/_openapi_sha @@ -1 +1 @@ -aa64d6796e23b2b78365de6b81611ad1ed97736c \ No newline at end of file +f985e23511da16cd044c91d468083974c14759e0 \ No newline at end of file diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 67cdbc78a..08fb2cc1d 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -15,4 +15,6 @@ ### API Changes * Add `SpecialDestinationSchemaOwner`, `SpecialDestinationTableOwner`, `SpecialDestinationVolumeOwner`, `SpecialDestinationFunctionOwner` and `SpecialDestinationRegisteredModelOwner` enum values for [catalog.SpecialDestination](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/catalog#SpecialDestination). * [Breaking] Change `CreateDeployment` method for [w.BundleDeployments](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/bundledeployments#BundleDeploymentsAPI) workspace-level service with new required argument order. -* [Breaking] Remove `DeploymentId` field for [bundledeployments.CreateDeploymentRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/bundledeployments#CreateDeploymentRequest). \ No newline at end of file +* [Breaking] Remove `DeploymentId` field for [bundledeployments.CreateDeploymentRequest](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/bundledeployments#CreateDeploymentRequest). +* Add `PatchTelemetryConfig` method for [w.ServingEndpoints](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/serving#ServingEndpointsAPI) workspace-level service. +* Add `FanoutOptions` field for [pipelines.SchemaSpec](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/pipelines#SchemaSpec). \ No newline at end of file diff --git a/experimental/mocks/service/serving/mock_serving_endpoints_interface.go b/experimental/mocks/service/serving/mock_serving_endpoints_interface.go old mode 100755 new mode 100644 index ef66c8b72..1d34feaa7 --- a/experimental/mocks/service/serving/mock_serving_endpoints_interface.go +++ b/experimental/mocks/service/serving/mock_serving_endpoints_interface.go @@ -1437,6 +1437,65 @@ func (_c *MockServingEndpointsInterface_Patch_Call) RunAndReturn(run func(contex return _c } +// PatchTelemetryConfig provides a mock function with given fields: ctx, request +func (_m *MockServingEndpointsInterface) PatchTelemetryConfig(ctx context.Context, request serving.PatchTelemetryConfigRequest) (*serving.ServingEndpointDetailed, error) { + ret := _m.Called(ctx, request) + + if len(ret) == 0 { + panic("no return value specified for PatchTelemetryConfig") + } + + var r0 *serving.ServingEndpointDetailed + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, serving.PatchTelemetryConfigRequest) (*serving.ServingEndpointDetailed, error)); ok { + return rf(ctx, request) + } + if rf, ok := ret.Get(0).(func(context.Context, serving.PatchTelemetryConfigRequest) *serving.ServingEndpointDetailed); ok { + r0 = rf(ctx, request) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*serving.ServingEndpointDetailed) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, serving.PatchTelemetryConfigRequest) error); ok { + r1 = rf(ctx, request) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockServingEndpointsInterface_PatchTelemetryConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PatchTelemetryConfig' +type MockServingEndpointsInterface_PatchTelemetryConfig_Call struct { + *mock.Call +} + +// PatchTelemetryConfig is a helper method to define mock.On call +// - ctx context.Context +// - request serving.PatchTelemetryConfigRequest +func (_e *MockServingEndpointsInterface_Expecter) PatchTelemetryConfig(ctx interface{}, request interface{}) *MockServingEndpointsInterface_PatchTelemetryConfig_Call { + return &MockServingEndpointsInterface_PatchTelemetryConfig_Call{Call: _e.mock.On("PatchTelemetryConfig", ctx, request)} +} + +func (_c *MockServingEndpointsInterface_PatchTelemetryConfig_Call) Run(run func(ctx context.Context, request serving.PatchTelemetryConfigRequest)) *MockServingEndpointsInterface_PatchTelemetryConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(serving.PatchTelemetryConfigRequest)) + }) + return _c +} + +func (_c *MockServingEndpointsInterface_PatchTelemetryConfig_Call) Return(_a0 *serving.ServingEndpointDetailed, _a1 error) *MockServingEndpointsInterface_PatchTelemetryConfig_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockServingEndpointsInterface_PatchTelemetryConfig_Call) RunAndReturn(run func(context.Context, serving.PatchTelemetryConfigRequest) (*serving.ServingEndpointDetailed, error)) *MockServingEndpointsInterface_PatchTelemetryConfig_Call { + _c.Call.Return(run) + return _c +} + // Put provides a mock function with given fields: ctx, request func (_m *MockServingEndpointsInterface) Put(ctx context.Context, request serving.PutRequest) (*serving.PutResponse, error) { ret := _m.Called(ctx, request) diff --git a/service/files/model.go b/service/files/model.go old mode 100755 new mode 100644 index 351201244..8819a3578 --- a/service/files/model.go +++ b/service/files/model.go @@ -139,7 +139,7 @@ func (s DownloadResponse) MarshalJSON() ([]byte, error) { } type FileInfo struct { - // The length of the file in bytes. This field is omitted for directories. + // The length of the file in bytes. Set to 0 for directories. FileSize int64 `json:"file_size,omitempty"` // True if the path is a directory. IsDir bool `json:"is_dir,omitempty"` diff --git a/service/pipelines/model.go b/service/pipelines/model.go index 31c3f8500..ec12984f2 100644 --- a/service/pipelines/model.go +++ b/service/pipelines/model.go @@ -1286,6 +1286,30 @@ func (s IngestionPipelineDefinition) MarshalJSON() ([]byte, error) { return marshal.Marshal(s) } +// Fanout configuration for multi-table routing from streaming sources. Routes +// each input record to a destination table based on a routing key derived from +// the record. The key value becomes the table name suffix: +// {destination_catalog}.{destination_schema}.{key_value}. +type IngestionPipelineDefinitionFanoutOptions struct { + // Column path or SQL expression whose value determines the destination + // table. Supports dotted paths (e.g. "value.event_name") and expressions + // (e.g. "value:event_name::string"). + FanoutBy string `json:"fanout_by,omitempty"` + // Optional transforms applied to each route's DataFrame before writing to + // the destination table. + Transforms []Transformer `json:"transforms,omitempty"` + + ForceSendFields []string `json:"-" url:"-"` +} + +func (s *IngestionPipelineDefinitionFanoutOptions) UnmarshalJSON(b []byte) error { + return marshal.Unmarshal(b, s) +} + +func (s IngestionPipelineDefinitionFanoutOptions) MarshalJSON() ([]byte, error) { + return marshal.Marshal(s) +} + // Configurations that are only applicable for query-based ingestion connectors. type IngestionPipelineDefinitionTableSpecificConfigQueryBasedConnectorConfig struct { // The names of the monotonically increasing columns in the source table @@ -2967,6 +2991,11 @@ type SchemaSpec struct { // name as the source tables are created in this destination schema. The // pipeline fails If a table with the same name already exists. DestinationSchema string `json:"destination_schema"` + // Fanout options for multi-table routing from streaming sources. When set, + // records are routed to destination tables based on a per-record routing + // key. The key value becomes the table name: + // {destination_catalog}.{destination_schema}.{key_value}. + FanoutOptions *IngestionPipelineDefinitionFanoutOptions `json:"fanout_options,omitempty"` // The source catalog name. Might be optional depending on the type of // source. SourceCatalog string `json:"source_catalog,omitempty"` diff --git a/service/serving/api.go b/service/serving/api.go old mode 100755 new mode 100644 index 9421aa288..7da629290 --- a/service/serving/api.go +++ b/service/serving/api.go @@ -116,6 +116,9 @@ type ServingEndpointsInterface interface { // call. Patch(ctx context.Context, request PatchServingEndpointTags) (*EndpointTags, error) + // Updates the telemetry configuration of a serving endpoint. + PatchTelemetryConfig(ctx context.Context, request PatchTelemetryConfigRequest) (*ServingEndpointDetailed, error) + // Deprecated: Please use AI Gateway to manage rate limits instead. Put(ctx context.Context, request PutRequest) (*PutResponse, error) diff --git a/service/serving/impl.go b/service/serving/impl.go old mode 100755 new mode 100644 index eae1e69b5..bef4d8e06 --- a/service/serving/impl.go +++ b/service/serving/impl.go @@ -231,6 +231,21 @@ func (a *servingEndpointsImpl) Patch(ctx context.Context, request PatchServingEn return &endpointTags, err } +func (a *servingEndpointsImpl) PatchTelemetryConfig(ctx context.Context, request PatchTelemetryConfigRequest) (*ServingEndpointDetailed, error) { + var servingEndpointDetailed ServingEndpointDetailed + path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/telemetry-config", request.Name) + queryParams := make(map[string]any) + headers := make(map[string]string) + headers["Accept"] = "application/json" + headers["Content-Type"] = "application/json" + cfg := a.client.Config + if cfg.WorkspaceID != "" { + headers["X-Databricks-Workspace-Id"] = cfg.WorkspaceID + } + err := a.client.Do(ctx, http.MethodPatch, path, headers, queryParams, request, &servingEndpointDetailed) + return &servingEndpointDetailed, err +} + func (a *servingEndpointsImpl) Put(ctx context.Context, request PutRequest) (*PutResponse, error) { var putResponse PutResponse path := fmt.Sprintf("/api/2.0/serving-endpoints/%v/rate-limits", request.Name) diff --git a/service/serving/interface.go b/service/serving/interface.go old mode 100755 new mode 100644 index 85a02b4d7..d61837fdc --- a/service/serving/interface.go +++ b/service/serving/interface.go @@ -68,6 +68,9 @@ type ServingEndpointsService interface { // API call. Patch(ctx context.Context, request PatchServingEndpointTags) (*EndpointTags, error) + // Updates the telemetry configuration of a serving endpoint. + PatchTelemetryConfig(ctx context.Context, request PatchTelemetryConfigRequest) (*ServingEndpointDetailed, error) + // Deprecated: Please use AI Gateway to manage rate limits instead. Put(ctx context.Context, request PutRequest) (*PutResponse, error) diff --git a/service/serving/model.go b/service/serving/model.go index 34e72cc51..3780943ea 100644 --- a/service/serving/model.go +++ b/service/serving/model.go @@ -1419,6 +1419,19 @@ type PatchServingEndpointTags struct { Name string `json:"-" url:"-"` } +// Updates the telemetry configuration of a serving endpoint. +type PatchTelemetryConfigRequest struct { + // The name of the serving endpoint whose telemetry configuration is being + // updated. This field is required. + Name string `json:"-" url:"-"` + // The telemetry configuration to be applied to the serving endpoint. Can + // specify either a telemetry_profile_id to use an existing profile, or + // table_names to create a new profile with the specified Unity Catalog + // tables. If not provided, the telemetry configuration will be removed from + // the endpoint. + TelemetryConfig *TelemetryConfig `json:"telemetry_config,omitempty"` +} + type PayloadTable struct { Name string `json:"name,omitempty"`